From 9e30b3430b6801286d630de269a69ff76c390d7d Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Wed, 21 Aug 2024 11:03:54 +0200 Subject: [PATCH] `z_check` and `z_null` made internal (#605) * fix: Rename `bump.bash` to `bump-and-tag.bash` * feat: Add `version.txt` and infer version in `bump-and-tag.bash` * fix: Clone repository using actions/checkout * fix: Add `CMakeFiles` to `.gitignore` * fix: Add `debug` and `release` to `.gitignore` * fix: Provide default release number for testing * fix: Don't bump deps when pattern is undefined * fix sizes of zcu_owned_matching_listener_t and z_owned_reply_t * build: Sync with eclipse-zenoh/zenoh@580f0b6 from 2024-04-11 (#330) Co-authored-by: eclipse-zenoh-bot * fix: Specify git remote when pushing the tag * fix: Require `VERSION`in `bump-and-tag.bash` * fix: Override release tag if it already exists * feat(tracing): using tracing and zenoh-util init_log (#308) * feat(tracing): using tracing and zenoh-util init_log Signed-off-by: gabrik * chore: adding Cargo.lock Signed-off-by: gabrik * chore: updated Cargo.toml.in Signed-off-by: gabrik * feat(tracing): using zenoh main branch Signed-off-by: gabrik --------- Signed-off-by: gabrik * build: Sync with eclipse-zenoh/zenoh@580f0b6 from 2024-04-11 (#335) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@23c5932 from 2024-04-16 (#337) Co-authored-by: eclipse-zenoh-bot * fix: Support jq 1.6 ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168. * chore: using new try_init_log_from_env Signed-off-by: gabrik * Align examples and remove reading from stdin (#255) * Remove reading from stdin, align example implementations * Add argument parsing implementation for examples * Add argument parsing to examples, format files * Replace getchar with sleep in z_pong example * Fix typo in include * Use null-pointers instead of empty strings, remove unnecessary mallocs * Free returned pointer after parse_pos_args usage * Add common and positional args parsing to z_ping example * Add formatting for parsed config options * Add const to function parameters * Update mode option help * Fix pos_args memory leak * Refactor parse_args, remove possible strcpy buffer overflow * Change parse_args function returns to const where applicable * Fix const initialization warning * Remove redundant const for value parameters * Fix buf variable memory leak * Update insert json-list config error message * Add usage example for -e and -l arguments in help * Update example notation in help message Co-authored-by: Alexander * Update example notation in help message (2/2) * Fix parameter in error message Co-authored-by: Alexander --------- Co-authored-by: Alexander * Bugfix: Unable to build z_queryable_with_channels.c (#340) Signed-off-by: ChenYing Kuo * build: Sync with eclipse-zenoh/zenoh@0283aaa from 2024-04-19 (#341) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@e8916bf from 2024-04-26 (#343) Co-authored-by: eclipse-zenoh-bot * Update README and specify Rust version (#342) * Clean up the Markdown format. Signed-off-by: ChenYing Kuo * Specify Rust version in README. Signed-off-by: ChenYing Kuo --------- Signed-off-by: ChenYing Kuo * build: Sync with eclipse-zenoh/zenoh@ea604b6 from 2024-04-29 (#344) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@371ca6b from 2024-04-30 (#347) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@7a47445 from 2024-05-03 (#348) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@f5195c0 from 2024-05-03 (#350) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@e53364f from 2024-05-04 (#351) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@7e5d5e8 from 2024-05-07 (#355) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@b8dd01d from 2024-05-07 (#356) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@45e05f0 from 2024-05-13 (#360) Co-authored-by: eclipse-zenoh-bot * Fix build with CMAKE_BUILD_TYPE=None This is the default build type for debhelper (Debian). * build: Sync with eclipse-zenoh/zenoh@763a05f from 2024-05-14 (#363) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@75aa273 from 2024-05-15 (#364) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@25f06bd from 2024-05-21 (#369) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@3118d31 from 2024-05-28 (#399) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@009f666 from 2024-05-30 (#411) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@d574654 from 2024-06-03 (#420) Co-authored-by: eclipse-zenoh-bot * chore: Update artifacts action to v4 (#421) artifacts actions v3 are deprecated * build: Sync with eclipse-zenoh/zenoh@c279982 from 2024-06-05 (#424) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@d8e66de from 2024-06-10 (#436) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@9d09742 from 2024-06-11 (#446) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@ed6c636 from 2024-06-12 (#450) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@8160b01 from 2024-06-13 (#457) Co-authored-by: eclipse-zenoh-bot * Enable releasing from any branch (#456) * build: Sync with eclipse-zenoh/zenoh@7adad94 from 2024-06-14 (#460) Co-authored-by: eclipse-zenoh-bot * Update to latest zenoh * Replace `-rc` with `-pre` and document versioning (#466) * build: Sync with eclipse-zenoh/zenoh@2500e5a from 2024-06-20 (#467) Co-authored-by: eclipse-zenoh-bot * macro generation * moved types added to decl * moved type drop * switched rust to z_moved * moved closures * build macros fixed * z_move name restored * into_rust_type for moved, payloads * tests updated * cargo fmt * moved structs in some drops/undeclares * moved as separate parameter * removed asref from moved * moved unfinished * build: Sync with eclipse-zenoh/zenoh@869ace6 from 2024-07-02 (#494) Co-authored-by: eclipse-zenoh-bot * moved type with into_rust_type trait, comiles without shm * build with shm passed * option added to some decl_c_type * clippy fix * build fix * moved types added * task moved used * build: Sync with eclipse-zenoh/zenoh@b93ca84 from 2024-07-03 (#500) Co-authored-by: eclipse-zenoh-bot * some examples fixes * macros corrected to use auto derive loaned type from owned feature * optional comma allowed in macros where forgotten * property moved get * put options move * publisher delete options made simpler * put options with moved * delete options timestamp simplified * more moved in options, timestamp simplified * examples,tests updated * tests compile fixes * fix for test failure due to calling z_moved_xxx_t destructor on unitialized memory * cargo fmt imports * build fixes * build: Sync with eclipse-zenoh/zenoh@b3e42ce from 2024-07-08 (#508) Co-authored-by: eclipse-zenoh-bot * Ensure that find_package(zenohc) can be called two times (#470) * Update CMakeLists.txt (#473) * Install zenohc.dll in /bin on Windows (#471) * build: Sync with eclipse-zenoh/zenoh@0a969cb from 2024-07-25 (#546) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@e587aa9 from 2024-07-26 (#552) Co-authored-by: eclipse-zenoh-bot * some xompile errors fixed * some build errors fixed * some build errors fixed * build fixes * cargo fmt * into_rust_type usage fixes * encoding drop fixed * restored headers * zcu renamed back to zc * zcu renamed back to zc * z_xxx_move is static inline, cpp fixes * build: Sync with eclipse-zenoh/zenoh@2d88c7b from 2024-07-29 (#556) Co-authored-by: eclipse-zenoh-bot * clang format from start * cargo fmt * macros contains funcions now, it needs types defined * removed zenoh_macros include * zenoh_macros include returned back to place * C++ build test added, fails for now * C++ enabling correction * C++ compilation for tests added * C++ build test * cargo lock update * retrun value if not void from template functions * cargo fmt * build fixes * build fix after cargo.lock update * moved types for buffer creation functions * clippy fix * clippy fix: c_char can be i8 or u8 depending on platform * headers restored * cargo fmt * -c c++ flag for clang only * c++ build fix - brackets removed * type specific take functions added, _ptr in moved * generic_take_cpp * z_take impls at the end * take funcs before generics * take moved after null * names fix * missing null functioj added * tests fixed for c++ * explicit null calls * fix generic parameter names c compilation * null call fix * misprint fixed * return removed * Rename `close` to `undeclare` for Publication Cache and Querying Subscriber * Temporarily use original pull request branch * Update to eclipse-zenoh/zenoh@ce4e9bf * Fix `z_ref_shm_client_storage_global` * Update Cargo.toml * decl_c_type corrected * cargo check run * borrow error fix * compilation fix * parse arg fix * example compilation fix * examples compile fix * examples build fixes * removed duplicated z_config_default (it's called in parsing args later) * clang format * clang format * cargo.toml restore * added underscore to _z_null and _z_check * missing functions updated * rename to z_internal_null/check * clang format fix * restored headers, corrected cargo.toml --------- Signed-off-by: gabrik Signed-off-by: ChenYing Kuo Co-authored-by: Mahmoud Mazouz Co-authored-by: Denis Biryukov Co-authored-by: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Co-authored-by: eclipse-zenoh-bot Co-authored-by: Mahmoud Mazouz Co-authored-by: Gabriele Baldoni Co-authored-by: gabrik Co-authored-by: oteffahi <70609372+oteffahi@users.noreply.github.com> Co-authored-by: Alexander Co-authored-by: ChenYing Kuo (CY) Co-authored-by: Jochen Sprickerhof Co-authored-by: Diogo Matsubara Co-authored-by: OlivierHecart Co-authored-by: Silvio Traversaro Co-authored-by: Luca Cominardi --- Cargo.toml | 14 +- build.rs | 22 +- include/zenoh_commons.h | 857 ++++++++++++------------ include/zenoh_macros.h | 366 +++++----- src/closures/hello_closure.rs | 6 +- src/closures/log_closure.rs | 6 +- src/closures/matching_status_closure.rs | 4 +- src/closures/query_channel.rs | 16 +- src/closures/query_closure.rs | 6 +- src/closures/reply_closure.rs | 6 +- src/closures/response_channel.rs | 16 +- src/closures/sample_channel.rs | 12 +- src/closures/sample_closure.rs | 6 +- src/closures/zenohid_closure.rs | 6 +- src/collections.rs | 12 +- src/commons.rs | 8 +- src/config.rs | 18 +- src/encoding.rs | 4 +- src/get.rs | 8 +- src/keyexpr.rs | 4 +- src/liveliness.rs | 6 +- src/payload.rs | 4 +- src/platform/synchronization.rs | 12 +- src/publication_cache.rs | 8 +- src/publisher.rs | 12 +- src/queryable.rs | 8 +- src/querying_subscriber.rs | 6 +- src/scouting.rs | 4 +- src/session.rs | 4 +- src/shm/buffer/zshm.rs | 4 +- src/shm/buffer/zshmmut.rs | 4 +- src/shm/client/shm_client.rs | 4 +- src/shm/client_storage/mod.rs | 14 +- src/shm/provider/alloc_layout.rs | 4 +- src/shm/provider/shm_provider.rs | 4 +- src/shm/provider/types.rs | 18 +- src/subscriber.rs | 4 +- tests/z_api_alignment_test.c | 16 +- tests/z_api_double_drop_test.c | 38 +- tests/z_api_drop_options.c | 8 +- tests/z_api_encoding_test.c | 18 +- tests/z_api_keyexpr_drop_test.c | 2 +- tests/z_api_keyexpr_test.c | 4 +- tests/z_api_null_drop_test.c | 26 +- tests/z_api_unitinialized_check.c | 4 +- 45 files changed, 850 insertions(+), 783 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3c651a157..865011179 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,11 @@ build = "build.rs" [features] logger-autoinit = [] -shared-memory = ["zenoh/shared-memory", "dep:zenoh-ext", "zenoh-ext/shared-memory"] +shared-memory = [ + "zenoh/shared-memory", + "dep:zenoh-ext", + "zenoh-ext/shared-memory", +] unstable = ["zenoh/unstable", "zenoh-ext/unstable", "dep:zenoh-ext"] default = ["zenoh/default"] @@ -52,10 +56,12 @@ rand = "0.8.5" spin = "0.9.5" unwrap-infallible = "0.1.5" const_format = "0.2.32" -zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = ["internal"] } -zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" , optional = true } +zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = [ + "internal", +] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", optional = true } zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } -zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } +zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } flume = "*" [build-dependencies] diff --git a/build.rs b/build.rs index 98f558a70..5aa58e2e7 100644 --- a/build.rs +++ b/build.rs @@ -992,7 +992,7 @@ pub fn create_generics_header(path_in: &str, path_out: &str) { if drops != nulls { msgs.push(format!( - "the list of z_xxx_drop and z_xxx_null functions are different:\n missing z_xxx_null for {:?}\n missing z_xxx_drop for {:?}", + "the list of z_xxx_drop and z_internal_xxx_null functions are different:\n missing z_internal_xxx_null for {:?}\n missing z_xxx_drop for {:?}", drops.difference(&nulls), nulls.difference(&drops) )); @@ -1000,7 +1000,7 @@ pub fn create_generics_header(path_in: &str, path_out: &str) { if drops != checks { msgs.push(format!( - "the list of z_xxx_drop and z_xxx_check functions are different:\n missing z_xxx_check for {:?}\n missing z_xxx_drop for {:?}", + "the list of z_xxx_drop and z_internal_xxx_check functions are different:\n missing z_internal_xxx_check for {:?}\n missing z_xxx_drop for {:?}", drops.difference(&checks), checks.difference(&drops) )); @@ -1244,7 +1244,7 @@ pub fn find_drop_functions(path_in: &str) -> Vec { pub fn find_null_functions(path_in: &str) -> Vec { let bindings = std::fs::read_to_string(path_in).unwrap(); - let re = Regex::new(r"(\w+)_null\(struct (\w+) \*(\w+)\);").unwrap(); + let re = Regex::new(r" (z.?_internal_\w+_null)\(struct (\w+) \*(\w+)\);").unwrap(); let mut res = Vec::::new(); for (_, [func_name, arg_type, arg_name]) in re.captures_iter(&bindings).map(|c| c.extract()) { @@ -1252,7 +1252,7 @@ pub fn find_null_functions(path_in: &str) -> Vec { let f = FunctionSignature::new( semantic, "void", - func_name.to_string() + "_null", + func_name.to_string(), vec![FuncArg::new(&(arg_type.to_string() + "*"), arg_name)], ); res.push(f); @@ -1262,7 +1262,7 @@ pub fn find_null_functions(path_in: &str) -> Vec { pub fn find_check_functions(path_in: &str) -> Vec { let bindings = std::fs::read_to_string(path_in).unwrap(); - let re = Regex::new(r"bool (\w+)_check\(const struct (\w+) \*(\w+)\);").unwrap(); + let re = Regex::new(r"bool (z.?_internal_\w+_check)\(const struct (\w+) \*(\w+)\);").unwrap(); let mut res = Vec::::new(); for (_, [func_name, arg_type, arg_name]) in re.captures_iter(&bindings).map(|c| c.extract()) { @@ -1270,7 +1270,7 @@ pub fn find_check_functions(path_in: &str) -> Vec { let f = FunctionSignature::new( semantic, "bool", - func_name.to_string() + "_check", + func_name.to_string(), vec![FuncArg::new( &("const ".to_string() + arg_type + "*"), arg_name, @@ -1415,7 +1415,7 @@ pub fn generate_take_functions(macro_func: &[FunctionSignature]) -> String { for sig in macro_func { let (prefix, _, semantic, _) = split_type_name(&sig.args[0].typename.typename); out += &format!( - "static inline void {}({} {}, {} {}) {{ *{} = {}->_this; {}_{}_null(&{}->_this); }}\n", + "static inline void {}({} {}, {} {}) {{ *{} = {}->_this; {}_internal_{}_null(&{}->_this); }}\n", sig.func_name, sig.args[0].typename.typename, sig.args[0].name, @@ -1460,11 +1460,11 @@ pub fn generate_move_functions_cpp(macro_func: &[FunctionSignature]) -> String { } pub fn generate_generic_null_c(macro_func: &[FunctionSignature]) -> String { - generate_generic_c(macro_func, "z_null", false) + generate_generic_c(macro_func, "z_internal_null", false) } pub fn generate_generic_check_c(macro_func: &[FunctionSignature]) -> String { - generate_generic_c(macro_func, "z_check", true) + generate_generic_c(macro_func, "z_internal_check", true) } pub fn generate_generic_call_c(macro_func: &[FunctionSignature]) -> String { @@ -1589,11 +1589,11 @@ pub fn generate_generic_take_cpp(macro_func: &[FunctionSignature]) -> String { } pub fn generate_generic_null_cpp(macro_func: &[FunctionSignature]) -> String { - generate_generic_cpp(macro_func, "z_null", false) + generate_generic_cpp(macro_func, "z_internal_null", false) } pub fn generate_generic_check_cpp(macro_func: &[FunctionSignature]) -> String { - generate_generic_cpp(macro_func, "z_check", true) + generate_generic_cpp(macro_func, "z_internal_check", true) } pub fn generate_generic_call_cpp(macro_func: &[FunctionSignature]) -> String { diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 4497f0c5e..97283212a 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -1185,12 +1185,6 @@ ZENOHC_API void z_alloc_layout_alloc_gc_defrag_dealloc(struct z_buf_alloc_result_t *out_result, const z_loaned_alloc_layout_t *layout); #endif -/** - * Returns ``true`` if `this` is valid. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_alloc_layout_check(const z_owned_alloc_layout_t *this_); -#endif /** * Deletes Alloc Layout */ @@ -1213,12 +1207,6 @@ z_result_t z_alloc_layout_new(z_owned_alloc_layout_t *this_, size_t size, struct z_alloc_alignment_t alignment); #endif -/** - * Constructs Alloc Layout in its gravestone value. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_alloc_layout_null(z_owned_alloc_layout_t *this_); -#endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_alloc_layout_threadsafe_alloc_gc_defrag_async(struct z_buf_alloc_result_t *out_result, @@ -1227,10 +1215,6 @@ z_result_t z_alloc_layout_threadsafe_alloc_gc_defrag_async(struct z_buf_alloc_re void (*result_callback)(void*, struct z_buf_alloc_result_t*)); #endif -/** - * Returns ``true`` if `this_` is in a valid state, ``false`` if it is in a gravestone state. - */ -ZENOHC_API bool z_bytes_check(const struct z_owned_bytes_t *this_); /** * Constructs an owned shallow copy of data in provided uninitialized memory location. */ @@ -1487,10 +1471,6 @@ ZENOHC_API const struct z_loaned_bytes_t *z_bytes_loan(const struct z_owned_byte * Muatably borrows data. */ ZENOHC_API struct z_loaned_bytes_t *z_bytes_loan_mut(struct z_owned_bytes_t *this_); -/** - * The gravestone value for `z_owned_bytes_t`. - */ -ZENOHC_API void z_bytes_null(struct z_owned_bytes_t *this_); /** * Reads data into specified destination. * @@ -1639,12 +1619,6 @@ ZENOHC_API z_result_t z_bytes_writer_write_all(struct z_bytes_writer_t *this_, const uint8_t *src, size_t len); -/** - * Returns ``true`` if `this` is valid. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_chunk_alloc_result_check(const z_owned_chunk_alloc_result_t *this_); -#endif /** * Deletes Chunk Alloc Result */ @@ -1674,12 +1648,6 @@ ZENOHC_API z_result_t z_chunk_alloc_result_new_ok(z_owned_chunk_alloc_result_t *this_, struct z_allocated_chunk_t allocated_chunk); #endif -/** - * Constructs Chunk Alloc Result in its gravestone value. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_chunk_alloc_result_null(z_owned_chunk_alloc_result_t *this_); -#endif /** * Get number of milliseconds passed since creation of `time`. */ @@ -1710,10 +1678,6 @@ z_result_t z_close(struct z_moved_session_t *session); ZENOHC_API void z_closure_hello_call(const struct z_loaned_closure_hello_t *closure, const struct z_loaned_hello_t *hello); -/** - * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_closure_hello_check(const struct z_owned_closure_hello_t *this_); /** * Drops the closure. Droping an uninitialized closure is a no-op. */ @@ -1723,20 +1687,12 @@ ZENOHC_API void z_closure_hello_drop(struct z_moved_closure_hello_t *this_); */ ZENOHC_API const struct z_loaned_closure_hello_t *z_closure_hello_loan(const struct z_owned_closure_hello_t *closure); -/** - * Constructs a closure in a gravestone state. - */ -ZENOHC_API void z_closure_hello_null(struct z_owned_closure_hello_t *this_); /** * Calls the closure. Calling an uninitialized closure is a no-op. */ ZENOHC_API void z_closure_query_call(const struct z_loaned_closure_query_t *closure, const struct z_loaned_query_t *query); -/** - * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_closure_query_check(const struct z_owned_closure_query_t *this_); /** * Drops the closure, resetting it to its gravestone state. */ @@ -1746,20 +1702,12 @@ ZENOHC_API void z_closure_query_drop(struct z_moved_closure_query_t *closure_); */ ZENOHC_API const struct z_loaned_closure_query_t *z_closure_query_loan(const struct z_owned_closure_query_t *closure); -/** - * Constructs a closure in its gravestone state. - */ -ZENOHC_API void z_closure_query_null(struct z_owned_closure_query_t *this_); /** * Calls the closure. Calling an uninitialized closure is a no-op. */ ZENOHC_API void z_closure_reply_call(const struct z_loaned_closure_reply_t *closure, const struct z_loaned_reply_t *reply); -/** - * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_closure_reply_check(const struct z_owned_closure_reply_t *this_); /** * Drops the closure, resetting it to its gravestone state. Droping an uninitialized closure is a no-op. */ @@ -1770,20 +1718,12 @@ void z_closure_reply_drop(struct z_moved_closure_reply_t *closure_); */ ZENOHC_API const struct z_loaned_closure_reply_t *z_closure_reply_loan(const struct z_owned_closure_reply_t *closure); -/** - * Constructs a closure int its gravestone state. - */ -ZENOHC_API void z_closure_reply_null(struct z_owned_closure_reply_t *this_); /** * Calls the closure. Calling an uninitialized closure is a no-op. */ ZENOHC_API void z_closure_sample_call(const struct z_loaned_closure_sample_t *closure, const struct z_loaned_sample_t *sample); -/** - * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_closure_sample_check(const struct z_owned_closure_sample_t *this_); /** * Drops the closure. Droping an uninitialized closure is a no-op. */ @@ -1793,10 +1733,6 @@ ZENOHC_API void z_closure_sample_drop(struct z_moved_closure_sample_t *closure_) */ ZENOHC_API const struct z_loaned_closure_sample_t *z_closure_sample_loan(const struct z_owned_closure_sample_t *closure); -/** - * Constructs a closure in its gravestone state. - */ -ZENOHC_API void z_closure_sample_null(struct z_owned_closure_sample_t *this_); /** * Calls the closure. Calling an uninitialized closure is a no-op. */ @@ -1805,12 +1741,6 @@ ZENOHC_API void z_closure_zid_call(const struct z_loaned_closure_zid_t *closure, const z_id_t *z_id); #endif -/** - * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. - */ -#if defined(UNSTABLE) -ZENOHC_API bool z_closure_zid_check(const struct z_owned_closure_zid_t *this_); -#endif /** * Drops the closure, resetting it to its gravestone state. Droping an uninitialized (null) closure is a no-op. */ @@ -1825,16 +1755,6 @@ void z_closure_zid_drop(struct z_moved_closure_zid_t *closure_); ZENOHC_API const struct z_loaned_closure_zid_t *z_closure_zid_loan(const struct z_owned_closure_zid_t *closure); #endif -/** - * Constructs a null closure. - */ -#if defined(UNSTABLE) -ZENOHC_API void z_closure_zid_null(struct z_owned_closure_zid_t *this_); -#endif -/** - * Returns ``true`` if conditional variable is valid, ``false`` otherwise. - */ -ZENOHC_API bool z_condvar_check(const struct z_owned_condvar_t *this_); /** * Drops conditional variable. */ @@ -1851,10 +1771,6 @@ ZENOHC_API const struct z_loaned_condvar_t *z_condvar_loan(const struct z_owned_ * Mutably borrows conditional variable. */ ZENOHC_API struct z_loaned_condvar_t *z_condvar_loan_mut(struct z_owned_condvar_t *this_); -/** - * Constructs conditional variable in a gravestone state. - */ -ZENOHC_API void z_condvar_null(struct z_owned_condvar_t *this_); /** * Wakes up one blocked thread waiting on this condiitonal variable. * @return 0 in case of success, negative error code in case of failure. @@ -1870,10 +1786,6 @@ ZENOHC_API z_result_t z_condvar_signal(const struct z_loaned_condvar_t *this_); ZENOHC_API z_result_t z_condvar_wait(const struct z_loaned_condvar_t *this_, struct z_loaned_mutex_t *m); -/** - * Returns ``true`` if config is valid, ``false`` if it is in a gravestone state. - */ -ZENOHC_API bool z_config_check(const struct z_owned_config_t *this_); /** * Constructs a default, zenoh-allocated, client mode configuration. * @@ -1906,10 +1818,6 @@ ZENOHC_API const struct z_loaned_config_t *z_config_loan(const struct z_owned_co * Mutably borrows config. */ ZENOHC_API struct z_loaned_config_t *z_config_loan_mut(struct z_owned_config_t *this_); -/** - * Constructs config in its gravestone state. - */ -ZENOHC_API void z_config_null(struct z_owned_config_t *this_); /** * Constructs a default peer mode configuration. */ @@ -2150,10 +2058,6 @@ ZENOHC_API const struct z_loaned_encoding_t *z_encoding_audio_ogg(void); * Constant alias for string: `"audio/vorbis"`. */ ZENOHC_API const struct z_loaned_encoding_t *z_encoding_audio_vorbis(void); -/** - * Returns ``true`` if encoding is in non-default state, ``false`` otherwise. - */ -ZENOHC_API bool z_encoding_check(const struct z_owned_encoding_t *this_); /** * Constructs an owned copy of the encoding in provided uninitilized memory location. */ @@ -2218,10 +2122,6 @@ ZENOHC_API const struct z_loaned_encoding_t *z_encoding_loan_default(void); * Mutably borrows encoding. */ ZENOHC_API struct z_loaned_encoding_t *z_encoding_loan_mut(struct z_owned_encoding_t *this_); -/** - * Constructs a default `z_owned_encoding_t`. - */ -ZENOHC_API void z_encoding_null(struct z_owned_encoding_t *this_); /** * Set a schema to this encoding from a c string. Zenoh does not define what a schema is and its semantichs is left to the implementer. * E.g. a common schema for `text/plain` encoding is `utf-8`. @@ -2527,10 +2427,6 @@ ZENOHC_API void z_fifo_channel_sample_new(struct z_owned_closure_sample_t *callback, struct z_owned_fifo_handler_sample_t *handler, size_t capacity); -/** - * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_fifo_handler_query_check(const struct z_owned_fifo_handler_query_t *this_); /** * Drops the handler and resets it to a gravestone state. */ @@ -2540,10 +2436,6 @@ ZENOHC_API void z_fifo_handler_query_drop(struct z_moved_fifo_handler_query_t *t */ ZENOHC_API const struct z_loaned_fifo_handler_query_t *z_fifo_handler_query_loan(const struct z_owned_fifo_handler_query_t *this_); -/** - * Constructs a handler in gravestone state. - */ -ZENOHC_API void z_fifo_handler_query_null(struct z_owned_fifo_handler_query_t *this_); /** * Returns query from the fifo buffer. If there are no more pending queries will block until next query is received, or until * the channel is dropped (normally when Queryable is dropped). @@ -2561,10 +2453,6 @@ z_result_t z_fifo_handler_query_recv(const struct z_loaned_fifo_handler_query_t ZENOHC_API z_result_t z_fifo_handler_query_try_recv(const struct z_loaned_fifo_handler_query_t *this_, struct z_owned_query_t *query); -/** - * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_fifo_handler_reply_check(const struct z_owned_fifo_handler_reply_t *this_); /** * Drops the handler and resets it to a gravestone state. */ @@ -2574,10 +2462,6 @@ ZENOHC_API void z_fifo_handler_reply_drop(struct z_moved_fifo_handler_reply_t *t */ ZENOHC_API const struct z_loaned_fifo_handler_reply_t *z_fifo_handler_reply_loan(const struct z_owned_fifo_handler_reply_t *this_); -/** - * Constructs a handler in gravestone state. - */ -ZENOHC_API void z_fifo_handler_reply_null(struct z_owned_fifo_handler_reply_t *this_); /** * Returns reply from the fifo buffer. If there are no more pending replies will block until next reply is received, or until * the channel is dropped (normally when all replies are received). @@ -2594,10 +2478,6 @@ z_result_t z_fifo_handler_reply_recv(const struct z_loaned_fifo_handler_reply_t ZENOHC_API z_result_t z_fifo_handler_reply_try_recv(const struct z_loaned_fifo_handler_reply_t *this_, struct z_owned_reply_t *reply); -/** - * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_fifo_handler_sample_check(const struct z_owned_fifo_handler_sample_t *this_); /** * Drops the handler and resets it to a gravestone state. */ @@ -2607,10 +2487,6 @@ ZENOHC_API void z_fifo_handler_sample_drop(struct z_moved_fifo_handler_sample_t */ ZENOHC_API const struct z_loaned_fifo_handler_sample_t *z_fifo_handler_sample_loan(const struct z_owned_fifo_handler_sample_t *this_); -/** - * Constructs a handler in gravestone state. - */ -ZENOHC_API void z_fifo_handler_sample_null(struct z_owned_fifo_handler_sample_t *this_); /** * Returns sample from the fifo buffer. If there are no more pending replies will block until next sample is received, or until * the channel is dropped (normally when there are no more samples to receive). @@ -2650,10 +2526,6 @@ z_result_t z_get(const struct z_loaned_session_t *session, * Constructs default `z_get_options_t` */ ZENOHC_API void z_get_options_default(struct z_get_options_t *this_); -/** - * Returns ``true`` if `hello message` is valid, ``false`` if it is in a gravestone state. - */ -ZENOHC_API bool z_hello_check(const struct z_owned_hello_t *this_); /** * Frees memory and resets hello message to its gravestone state. */ @@ -2670,10 +2542,6 @@ ZENOHC_API const struct z_loaned_hello_t *z_hello_loan(const struct z_owned_hell ZENOHC_API void z_hello_locators(const struct z_loaned_hello_t *this_, struct z_owned_string_array_t *locators_out); -/** - * Constructs hello message in a gravestone state. - */ -ZENOHC_API void z_hello_null(struct z_owned_hello_t *this_); /** * Returns type of Zenoh entity that transmitted hello message. */ @@ -2720,6 +2588,364 @@ z_result_t z_info_routers_zid(const struct z_loaned_session_t *session, #if defined(UNSTABLE) ZENOHC_API z_id_t z_info_zid(const struct z_loaned_session_t *session); #endif +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool z_internal_alloc_layout_check(const z_owned_alloc_layout_t *this_); +#endif +/** + * Constructs Alloc Layout in its gravestone value. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API void z_internal_alloc_layout_null(z_owned_alloc_layout_t *this_); +#endif +/** + * Returns ``true`` if `this_` is in a valid state, ``false`` if it is in a gravestone state. + */ +ZENOHC_API bool z_internal_bytes_check(const struct z_owned_bytes_t *this_); +/** + * The gravestone value for `z_owned_bytes_t`. + */ +ZENOHC_API void z_internal_bytes_null(struct z_owned_bytes_t *this_); +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool z_internal_chunk_alloc_result_check(const z_owned_chunk_alloc_result_t *this_); +#endif +/** + * Constructs Chunk Alloc Result in its gravestone value. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API void z_internal_chunk_alloc_result_null(z_owned_chunk_alloc_result_t *this_); +#endif +/** + * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool z_internal_closure_hello_check(const struct z_owned_closure_hello_t *this_); +/** + * Constructs a closure in a gravestone state. + */ +ZENOHC_API void z_internal_closure_hello_null(struct z_owned_closure_hello_t *this_); +/** + * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool z_internal_closure_query_check(const struct z_owned_closure_query_t *this_); +/** + * Constructs a closure in its gravestone state. + */ +ZENOHC_API void z_internal_closure_query_null(struct z_owned_closure_query_t *this_); +/** + * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool z_internal_closure_reply_check(const struct z_owned_closure_reply_t *this_); +/** + * Constructs a closure int its gravestone state. + */ +ZENOHC_API void z_internal_closure_reply_null(struct z_owned_closure_reply_t *this_); +/** + * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool z_internal_closure_sample_check(const struct z_owned_closure_sample_t *this_); +/** + * Constructs a closure in its gravestone state. + */ +ZENOHC_API void z_internal_closure_sample_null(struct z_owned_closure_sample_t *this_); +/** + * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. + */ +#if defined(UNSTABLE) +ZENOHC_API bool z_internal_closure_zid_check(const struct z_owned_closure_zid_t *this_); +#endif +/** + * Constructs a null closure. + */ +#if defined(UNSTABLE) +ZENOHC_API void z_internal_closure_zid_null(struct z_owned_closure_zid_t *this_); +#endif +/** + * Returns ``true`` if conditional variable is valid, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_condvar_check(const struct z_owned_condvar_t *this_); +/** + * Constructs conditional variable in a gravestone state. + */ +ZENOHC_API void z_internal_condvar_null(struct z_owned_condvar_t *this_); +/** + * Returns ``true`` if config is valid, ``false`` if it is in a gravestone state. + */ +ZENOHC_API bool z_internal_config_check(const struct z_owned_config_t *this_); +/** + * Constructs config in its gravestone state. + */ +ZENOHC_API void z_internal_config_null(struct z_owned_config_t *this_); +/** + * Returns ``true`` if encoding is in non-default state, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_encoding_check(const struct z_owned_encoding_t *this_); +/** + * Constructs a default `z_owned_encoding_t`. + */ +ZENOHC_API void z_internal_encoding_null(struct z_owned_encoding_t *this_); +/** + * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API +bool z_internal_fifo_handler_query_check(const struct z_owned_fifo_handler_query_t *this_); +/** + * Constructs a handler in gravestone state. + */ +ZENOHC_API void z_internal_fifo_handler_query_null(struct z_owned_fifo_handler_query_t *this_); +/** + * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API +bool z_internal_fifo_handler_reply_check(const struct z_owned_fifo_handler_reply_t *this_); +/** + * Constructs a handler in gravestone state. + */ +ZENOHC_API void z_internal_fifo_handler_reply_null(struct z_owned_fifo_handler_reply_t *this_); +/** + * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API +bool z_internal_fifo_handler_sample_check(const struct z_owned_fifo_handler_sample_t *this_); +/** + * Constructs a handler in gravestone state. + */ +ZENOHC_API void z_internal_fifo_handler_sample_null(struct z_owned_fifo_handler_sample_t *this_); +/** + * Returns ``true`` if `hello message` is valid, ``false`` if it is in a gravestone state. + */ +ZENOHC_API bool z_internal_hello_check(const struct z_owned_hello_t *this_); +/** + * Constructs hello message in a gravestone state. + */ +ZENOHC_API void z_internal_hello_null(struct z_owned_hello_t *this_); +/** + * Returns ``true`` if `keyexpr` is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool z_internal_keyexpr_check(const struct z_owned_keyexpr_t *this_); +/** + * Constructs an owned key expression in a gravestone state. + */ +ZENOHC_API void z_internal_keyexpr_null(struct z_owned_keyexpr_t *this_); +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool z_internal_memory_layout_check(const z_owned_memory_layout_t *this_); +#endif +/** + * Constructs Memory Layout in its gravestone value. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API void z_internal_memory_layout_null(z_owned_memory_layout_t *this_); +#endif +/** + * Returns ``true`` if mutex is valid, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_mutex_check(const struct z_owned_mutex_t *this_); +/** + * Constructs mutex in a gravestone state. + */ +ZENOHC_API void z_internal_mutex_null(struct z_owned_mutex_t *this_); +/** + * Returns ``true`` if publisher is valid, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_publisher_check(const struct z_owned_publisher_t *this_); +/** + * Constructs a publisher in a gravestone state. + */ +ZENOHC_API void z_internal_publisher_null(struct z_owned_publisher_t *this_); +/** + * Returns `false` if `this` is in a gravestone state, `true` otherwise. + */ +ZENOHC_API bool z_internal_query_check(const struct z_owned_query_t *query); +/** + * Constructs query in its gravestone value. + */ +ZENOHC_API void z_internal_query_null(struct z_owned_query_t *this_); +/** + * Returns ``true`` if queryable is valid, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_queryable_check(const struct z_owned_queryable_t *this_); +/** + * Constructs a queryable in its gravestone value. + */ +ZENOHC_API void z_internal_queryable_null(struct z_owned_queryable_t *this_); +/** + * Returns ``true`` if `reply` is valid, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_reply_check(const struct z_owned_reply_t *this_); +/** + * Returns ``true`` if reply error is in non-default state, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_reply_err_check(const struct z_owned_reply_err_t *this_); +/** + * Constructs an empty `z_owned_reply_err_t`. + */ +ZENOHC_API void z_internal_reply_err_null(struct z_owned_reply_err_t *this_); +/** + * Constructs the reply in its gravestone state. + */ +ZENOHC_API void z_internal_reply_null(struct z_owned_reply_t *this_); +/** + * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API +bool z_internal_ring_handler_query_check(const struct z_owned_ring_handler_query_t *this_); +/** + * Constructs a handler in gravestone state. + */ +ZENOHC_API void z_internal_ring_handler_query_null(struct z_owned_ring_handler_query_t *this_); +/** + * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API +bool z_internal_ring_handler_reply_check(const struct z_owned_ring_handler_reply_t *this_); +/** + * Constructs a handler in gravestone state. + */ +ZENOHC_API void z_internal_ring_handler_reply_null(struct z_owned_ring_handler_reply_t *this_); +/** + * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API +bool z_internal_ring_handler_sample_check(const struct z_owned_ring_handler_sample_t *this_); +/** + * Constructs a handler in gravestone state. + */ +ZENOHC_API void z_internal_ring_handler_sample_null(struct z_owned_ring_handler_sample_t *this_); +/** + * Returns ``true`` if sample is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool z_internal_sample_check(const struct z_owned_sample_t *this_); +/** + * Constructs sample in its gravestone state. + */ +ZENOHC_API void z_internal_sample_null(struct z_owned_sample_t *this_); +/** + * Returns ``true`` if `session` is valid, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_session_check(const struct z_owned_session_t *this_); +/** + * Constructs a Zenoh session in its gravestone state. + */ +ZENOHC_API void z_internal_session_null(struct z_owned_session_t *this_); +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool z_internal_shm_check(const z_owned_shm_t *this_); +#endif +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool z_internal_shm_client_check(const z_owned_shm_client_t *this_); +#endif +/** + * Constructs SHM client in its gravestone value. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API void z_internal_shm_client_null(z_owned_shm_client_t *this_); +#endif +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool z_internal_shm_client_storage_check(const z_owned_shm_client_storage_t *this_); +#endif +/** + * Constructs SHM Client Storage in its gravestone value. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API void z_internal_shm_client_storage_null(z_owned_shm_client_storage_t *this_); +#endif +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool z_internal_shm_mut_check(const z_owned_shm_mut_t *this_); +#endif +/** + * Constructs ZShmMut slice in its gravestone value. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API void z_internal_shm_mut_null(z_owned_shm_mut_t *this_); +#endif +/** + * Constructs ZShm slice in its gravestone value. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API void z_internal_shm_null(z_owned_shm_t *this_); +#endif +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool z_internal_shm_provider_check(const z_owned_shm_provider_t *this_); +#endif +/** + * Constructs SHM Provider in its gravestone value. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API void z_internal_shm_provider_null(z_owned_shm_provider_t *this_); +#endif +/** + * @return ``true`` if slice is not empty, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_slice_check(const struct z_owned_slice_t *this_); +/** + * Constructs an empty `z_owned_slice_t`. + */ +ZENOHC_API void z_internal_slice_null(struct z_owned_slice_t *this_); +/** + * Returns ``true`` if source info is valid, ``false`` if it is in gravestone state. + */ +#if defined(UNSTABLE) +ZENOHC_API bool z_internal_source_info_check(const z_owned_source_info_t *this_); +#endif +/** + * Constructs source info in its gravestone state. + */ +#if defined(UNSTABLE) +ZENOHC_API void z_internal_source_info_null(z_owned_source_info_t *this_); +#endif +/** + * @return ``true`` if the string array is valid, ``false`` if it is in a gravestone state. + */ +ZENOHC_API bool z_internal_string_array_check(const struct z_owned_string_array_t *this_); +/** + * Constructs string array in its gravestone state. + */ +ZENOHC_API void z_internal_string_array_null(struct z_owned_string_array_t *this_); +/** + * @return ``true`` if `this_` is a valid string, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool z_internal_string_check(const struct z_owned_string_t *this_); +/** + * Constructs owned string in a gravestone state. + */ +ZENOHC_API void z_internal_string_null(struct z_owned_string_t *this_); +/** + * Returns ``true`` if subscriber is valid, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_subscriber_check(const struct z_owned_subscriber_t *this_); +/** + * Constructs a subscriber in a gravestone state. + */ +ZENOHC_API void z_internal_subscriber_null(struct z_owned_subscriber_t *this_); +/** + * Returns ``true`` if task is valid, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_task_check(const struct z_owned_task_t *this_); +/** + * Constructs task in a gravestone state. + */ +ZENOHC_API void z_internal_task_null(struct z_owned_task_t *this_); /** * Constructs a non-owned non-null-terminated string from key expression. */ @@ -2746,10 +2972,6 @@ z_result_t z_keyexpr_canonize(char *start, */ ZENOHC_API z_result_t z_keyexpr_canonize_null_terminated(char *start); -/** - * Returns ``true`` if `keyexpr` is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_keyexpr_check(const struct z_owned_keyexpr_t *this_); /** * Constructs key expression by concatenation of key expression in `left` with a string in `right`. * Returns 0 in case of success, negative error code otherwise. @@ -2844,10 +3066,6 @@ z_result_t z_keyexpr_join(struct z_owned_keyexpr_t *this_, * Borrows `z_owned_keyexpr_t`. */ ZENOHC_API const struct z_loaned_keyexpr_t *z_keyexpr_loan(const struct z_owned_keyexpr_t *this_); -/** - * Constructs an owned key expression in a gravestone state. - */ -ZENOHC_API void z_keyexpr_null(struct z_owned_keyexpr_t *this_); /** * Returns the relation between `left` and `right` from `left`'s point of view. * @@ -2858,12 +3076,6 @@ ZENOHC_API enum z_keyexpr_intersection_level_t z_keyexpr_relation_to(const struct z_loaned_keyexpr_t *left, const struct z_loaned_keyexpr_t *right); #endif -/** - * Returns ``true`` if `this` is valid. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_memory_layout_check(const z_owned_memory_layout_t *this_); -#endif /** * Deletes Memory Layout */ @@ -2895,16 +3107,6 @@ z_result_t z_memory_layout_new(z_owned_memory_layout_t *this_, size_t size, struct z_alloc_alignment_t alignment); #endif -/** - * Constructs Memory Layout in its gravestone value. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_memory_layout_null(z_owned_memory_layout_t *this_); -#endif -/** - * Returns ``true`` if mutex is valid, ``false`` otherwise. - */ -ZENOHC_API bool z_mutex_check(const struct z_owned_mutex_t *this_); /** * Drops mutex and resets it to its gravestone state. */ @@ -2923,10 +3125,6 @@ ZENOHC_API struct z_loaned_mutex_t *z_mutex_loan_mut(struct z_owned_mutex_t *thi * @return 0 in case of success, negative error code in case of failure. */ ZENOHC_API z_result_t z_mutex_lock(struct z_loaned_mutex_t *this_); -/** - * Constructs mutex in a gravestone state. - */ -ZENOHC_API void z_mutex_null(struct z_owned_mutex_t *this_); /** * Tries to lock mutex. If mutex is already locked, return immediately. * @return 0 in case of success, negative value if failed to aquire the lock. @@ -2975,10 +3173,6 @@ z_result_t z_posix_shm_provider_new(z_owned_shm_provider_t *this_, * Returns the default value of #z_priority_t. */ ZENOHC_API enum z_priority_t z_priority_default(void); -/** - * Returns ``true`` if publisher is valid, ``false`` otherwise. - */ -ZENOHC_API bool z_publisher_check(const struct z_owned_publisher_t *this_); /** * Sends a `DELETE` message onto the publisher's key expression. * @@ -3015,10 +3209,6 @@ const struct z_loaned_publisher_t *z_publisher_loan(const struct z_owned_publish * Mutably borrows publisher. */ ZENOHC_API struct z_loaned_publisher_t *z_publisher_loan_mut(struct z_owned_publisher_t *this_); -/** - * Constructs a publisher in a gravestone state. - */ -ZENOHC_API void z_publisher_null(struct z_owned_publisher_t *this_); /** * Constructs the default value for `z_publisher_options_t`. */ @@ -3069,10 +3259,6 @@ ZENOHC_API void z_put_options_default(struct z_put_options_t *this_); * Returns NULL if query does not contain an attachment. */ ZENOHC_API const struct z_loaned_bytes_t *z_query_attachment(const struct z_loaned_query_t *this_); -/** - * Returns `false` if `this` is in a gravestone state, `true` otherwise. - */ -ZENOHC_API bool z_query_check(const struct z_owned_query_t *query); /** * Constructs a shallow copy of the query, allowing to keep it in an "open" state past the callback's return. * @@ -3132,11 +3318,7 @@ ZENOHC_API const struct z_loaned_keyexpr_t *z_query_keyexpr(const struct z_loane /** * Borrows the query. */ -ZENOHC_API const struct z_loaned_query_t *z_query_loan(const struct z_owned_query_t *this_); -/** - * Constructs query in its gravestone value. - */ -ZENOHC_API void z_query_null(struct z_owned_query_t *this_); +ZENOHC_API const struct z_loaned_query_t *z_query_loan(const struct z_owned_query_t *this_); /** * Gets query value selector. */ @@ -3222,20 +3404,12 @@ ZENOHC_API void z_query_reply_options_default(struct z_query_reply_options_t *th * Create a default `z_query_target_t`. */ ZENOHC_API enum z_query_target_t z_query_target_default(void); -/** - * Returns ``true`` if queryable is valid, ``false`` otherwise. - */ -ZENOHC_API bool z_queryable_check(const struct z_owned_queryable_t *this_); /** * Frees memory and resets it to its gravesztone state. Will also attempt to undeclare queryable. */ ZENOHC_API void z_queryable_drop(struct z_moved_queryable_t *this_); ZENOHC_API const struct z_loaned_queryable_t *z_queryable_loan(const struct z_owned_queryable_t *this_); -/** - * Constructs a queryable in its gravestone value. - */ -ZENOHC_API void z_queryable_null(struct z_owned_queryable_t *this_); /** * Constructs the default value for `z_query_reply_options_t`. */ @@ -3263,10 +3437,6 @@ ZENOHC_API uint8_t z_random_u8(void); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_ref_shm_client_storage_global(z_owned_shm_client_storage_t *this_); #endif -/** - * Returns ``true`` if `reply` is valid, ``false`` otherwise. - */ -ZENOHC_API bool z_reply_check(const struct z_owned_reply_t *this_); /** * Constructs an owned shallow copy of reply in provided uninitialized memory location. */ @@ -3281,10 +3451,6 @@ ZENOHC_API void z_reply_drop(struct z_moved_reply_t *this_); * Returns `NULL` if reply does not contain a error (i. e. if `z_reply_is_ok` returns ``true``). */ ZENOHC_API const struct z_loaned_reply_err_t *z_reply_err(const struct z_loaned_reply_t *this_); -/** - * Returns ``true`` if reply error is in non-default state, ``false`` otherwise. - */ -ZENOHC_API bool z_reply_err_check(const struct z_owned_reply_err_t *this_); /** * Frees the memory and resets the reply error it to its default value. */ @@ -3299,10 +3465,6 @@ const struct z_loaned_encoding_t *z_reply_err_encoding(const struct z_loaned_rep */ ZENOHC_API const struct z_loaned_reply_err_t *z_reply_err_loan(const struct z_owned_reply_err_t *this_); -/** - * Constructs an empty `z_owned_reply_err_t`. - */ -ZENOHC_API void z_reply_err_null(struct z_owned_reply_err_t *this_); /** * Returns reply error payload. */ @@ -3317,10 +3479,6 @@ bool z_reply_is_ok(const struct z_loaned_reply_t *this_); * Borrows reply. */ ZENOHC_API const struct z_loaned_reply_t *z_reply_loan(const struct z_owned_reply_t *this_); -/** - * Constructs the reply in its gravestone state. - */ -ZENOHC_API void z_reply_null(struct z_owned_reply_t *this_); /** * Yields the contents of the reply by asserting it indicates a success. * @@ -3355,10 +3513,6 @@ ZENOHC_API void z_ring_channel_sample_new(struct z_owned_closure_sample_t *callback, struct z_owned_ring_handler_sample_t *handler, size_t capacity); -/** - * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_ring_handler_query_check(const struct z_owned_ring_handler_query_t *this_); /** * Drops the handler and resets it to a gravestone state. */ @@ -3368,10 +3522,6 @@ ZENOHC_API void z_ring_handler_query_drop(struct z_moved_ring_handler_query_t *t */ ZENOHC_API const struct z_loaned_ring_handler_query_t *z_ring_handler_query_loan(const struct z_owned_ring_handler_query_t *this_); -/** - * Constructs a handler in gravestone state. - */ -ZENOHC_API void z_ring_handler_query_null(struct z_owned_ring_handler_query_t *this_); /** * Returns query from the ring buffer. If there are no more pending queries will block until next query is received, or until * the channel is dropped (normally when Queryable is dropped). @@ -3388,10 +3538,6 @@ z_result_t z_ring_handler_query_recv(const struct z_loaned_ring_handler_query_t ZENOHC_API z_result_t z_ring_handler_query_try_recv(const struct z_loaned_ring_handler_query_t *this_, struct z_owned_query_t *query); -/** - * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_ring_handler_reply_check(const struct z_owned_ring_handler_reply_t *this_); /** * Drops the handler and resets it to a gravestone state. */ @@ -3401,10 +3547,6 @@ ZENOHC_API void z_ring_handler_reply_drop(struct z_moved_ring_handler_reply_t *t */ ZENOHC_API const struct z_loaned_ring_handler_reply_t *z_ring_handler_reply_loan(const struct z_owned_ring_handler_reply_t *this_); -/** - * Constructs a handler in gravestone state. - */ -ZENOHC_API void z_ring_handler_reply_null(struct z_owned_ring_handler_reply_t *this_); /** * Returns reply from the ring buffer. If there are no more pending replies will block until next reply is received, or until * the channel is dropped (normally when all replies are received). @@ -3421,10 +3563,6 @@ z_result_t z_ring_handler_reply_recv(const struct z_loaned_ring_handler_reply_t ZENOHC_API z_result_t z_ring_handler_reply_try_recv(const struct z_loaned_ring_handler_reply_t *this_, struct z_owned_reply_t *reply); -/** - * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_ring_handler_sample_check(const struct z_owned_ring_handler_sample_t *this_); /** * Drops the handler and resets it to a gravestone state. */ @@ -3434,10 +3572,6 @@ ZENOHC_API void z_ring_handler_sample_drop(struct z_moved_ring_handler_sample_t */ ZENOHC_API const struct z_loaned_ring_handler_sample_t *z_ring_handler_sample_loan(const struct z_owned_ring_handler_sample_t *this_); -/** - * Constructs a handler in gravestone state. - */ -ZENOHC_API void z_ring_handler_sample_null(struct z_owned_ring_handler_sample_t *this_); /** * Returns sample from the ring buffer. If there are no more pending replies will block until next sample is received, or until * the channel is dropped (normally when there are no more replies to receive). @@ -3461,10 +3595,6 @@ z_result_t z_ring_handler_sample_try_recv(const struct z_loaned_ring_handler_sam */ ZENOHC_API const struct z_loaned_bytes_t *z_sample_attachment(const struct z_loaned_sample_t *this_); -/** - * Returns ``true`` if sample is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_sample_check(const struct z_owned_sample_t *this_); /** * Constructs an owned shallow copy of the sample (i.e. all modficiations applied to the copy, might be visible in the original) in provided uninitilized memory location. */ @@ -3501,10 +3631,6 @@ ZENOHC_API enum z_sample_kind_t z_sample_kind(const struct z_loaned_sample_t *th * Borrows sample. */ ZENOHC_API const struct z_loaned_sample_t *z_sample_loan(const struct z_owned_sample_t *this_); -/** - * Constructs sample in its gravestone state. - */ -ZENOHC_API void z_sample_null(struct z_owned_sample_t *this_); /** * Returns the sample payload data. */ @@ -3543,10 +3669,6 @@ z_result_t z_scout(struct z_moved_config_t *config, * Constructs the default values for the scouting operation. */ ZENOHC_API void z_scout_options_default(struct z_scout_options_t *this_); -/** - * Returns ``true`` if `session` is valid, ``false`` otherwise. - */ -ZENOHC_API bool z_session_check(const struct z_owned_session_t *this_); /** * Constructs an owned shallow copy of the session in provided uninitialized memory location. */ @@ -3563,22 +3685,6 @@ ZENOHC_API void z_session_drop(struct z_moved_session_t *this_); * Borrows session. */ ZENOHC_API const struct z_loaned_session_t *z_session_loan(const struct z_owned_session_t *this_); -/** - * Constructs a Zenoh session in its gravestone state. - */ -ZENOHC_API void z_session_null(struct z_owned_session_t *this_); -/** - * Returns ``true`` if `this` is valid. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_check(const z_owned_shm_t *this_); -#endif -/** - * Returns ``true`` if `this` is valid. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_client_check(const z_owned_shm_client_t *this_); -#endif /** * Deletes SHM Client */ @@ -3594,18 +3700,6 @@ void z_shm_client_new(z_owned_shm_client_t *this_, struct zc_threadsafe_context_t context, struct zc_shm_client_callbacks_t callbacks); #endif -/** - * Constructs SHM client in its gravestone value. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_null(z_owned_shm_client_t *this_); -#endif -/** - * Returns ``true`` if `this` is valid. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_client_storage_check(const z_owned_shm_client_storage_t *this_); -#endif /** * Performs a shallow copy of SHM Client Storage */ @@ -3636,12 +3730,6 @@ z_result_t z_shm_client_storage_new(z_owned_shm_client_storage_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_client_storage_new_default(z_owned_shm_client_storage_t *this_); #endif -/** - * Constructs SHM Client Storage in its gravestone value. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_null(z_owned_shm_client_storage_t *this_); -#endif /** * Converts borrowed ZShm slice to owned ZShm slice by performing a shallow SHM reference copy */ @@ -3684,12 +3772,6 @@ ZENOHC_API const z_loaned_shm_t *z_shm_loan(const z_owned_shm_t *this_); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_loaned_shm_t *z_shm_loan_mut(z_owned_shm_t *this_); #endif -/** - * Returns ``true`` if `this` is valid. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_mut_check(const z_owned_shm_mut_t *this_); -#endif /** * @return the immutable pointer to the underlying data */ @@ -3726,24 +3808,12 @@ ZENOHC_API const z_loaned_shm_mut_t *z_shm_mut_loan(const z_owned_shm_mut_t *thi #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_loaned_shm_mut_t *z_shm_mut_loan_mut(z_owned_shm_mut_t *this_); #endif -/** - * Constructs ZShmMut slice in its gravestone value. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_null(z_owned_shm_mut_t *this_); -#endif /** * Tries to construct ZShmMut slice from ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_mut_try_from_immut(z_owned_shm_mut_t *this_, z_moved_shm_t *that); #endif -/** - * Constructs ZShm slice in its gravestone value. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_null(z_owned_shm_t *this_); -#endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc(struct z_buf_layout_alloc_result_t *out_result, @@ -3792,12 +3862,6 @@ void z_shm_provider_alloc_gc_defrag_dealloc(struct z_buf_layout_alloc_result_t * #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API size_t z_shm_provider_available(const z_loaned_shm_provider_t *provider); #endif -/** - * Returns ``true`` if `this` is valid. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_provider_check(const z_owned_shm_provider_t *this_); -#endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API size_t z_shm_provider_defragment(const z_loaned_shm_provider_t *provider); #endif @@ -3833,12 +3897,6 @@ void z_shm_provider_new(z_owned_shm_provider_t *this_, struct zc_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); #endif -/** - * Constructs SHM Provider in its gravestone value. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_provider_null(z_owned_shm_provider_t *this_); -#endif /** * Creates a new threadsafe SHM Provider */ @@ -3873,10 +3931,6 @@ ZENOHC_API int8_t z_sleep_s(size_t time); * Puts current thread to sleep for specified amount of microseconds. */ ZENOHC_API int8_t z_sleep_us(size_t time); -/** - * @return ``true`` if slice is not empty, ``false`` otherwise. - */ -ZENOHC_API bool z_slice_check(const struct z_owned_slice_t *this_); /** * Constructs an owned copy of a slice. */ @@ -3930,16 +3984,6 @@ ZENOHC_API size_t z_slice_len(const struct z_loaned_slice_t *this_); * Borrows slice. */ ZENOHC_API const struct z_loaned_slice_t *z_slice_loan(const struct z_owned_slice_t *this_); -/** - * Constructs an empty `z_owned_slice_t`. - */ -ZENOHC_API void z_slice_null(struct z_owned_slice_t *this_); -/** - * Returns ``true`` if source info is valid, ``false`` if it is in gravestone state. - */ -#if defined(UNSTABLE) -ZENOHC_API bool z_source_info_check(const z_owned_source_info_t *this_); -#endif /** * Frees the memory and invalidates the source info, resetting it to a gravestone state. */ @@ -3967,22 +4011,12 @@ z_result_t z_source_info_new(z_owned_source_info_t *this_, const z_entity_global_id_t *source_id, uint64_t source_sn); #endif -/** - * Constructs source info in its gravestone state. - */ -#if defined(UNSTABLE) -ZENOHC_API void z_source_info_null(z_owned_source_info_t *this_); -#endif /** * Returns the source_sn of the source info. */ #if defined(UNSTABLE) ZENOHC_API uint64_t z_source_info_sn(const z_loaned_source_info_t *this_); #endif -/** - * @return ``true`` if the string array is valid, ``false`` if it is in a gravestone state. - */ -ZENOHC_API bool z_string_array_check(const struct z_owned_string_array_t *this_); /** * Destroys the string array, resetting it to its gravestone value. */ @@ -4017,10 +4051,6 @@ struct z_loaned_string_array_t *z_string_array_loan_mut(struct z_owned_string_ar * Constructs a new empty string array. */ ZENOHC_API void z_string_array_new(struct z_owned_string_array_t *this_); -/** - * Constructs string array in its gravestone state. - */ -ZENOHC_API void z_string_array_null(struct z_owned_string_array_t *this_); /** * Appends specified value to the end of the string array by alias. * @@ -4038,10 +4068,6 @@ ZENOHC_API size_t z_string_array_push_by_copy(struct z_loaned_string_array_t *this_, const struct z_loaned_string_t *value); ZENOHC_API const struct z_loaned_slice_t *z_string_as_slice(const struct z_loaned_string_t *this_); -/** - * @return ``true`` if `this_` is a valid string, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_string_check(const struct z_owned_string_t *this_); /** * Constructs an owned copy of a string. */ @@ -4100,14 +4126,6 @@ ZENOHC_API size_t z_string_len(const struct z_loaned_string_t *this_); * Borrows string. */ ZENOHC_API const struct z_loaned_string_t *z_string_loan(const struct z_owned_string_t *this_); -/** - * Constructs owned string in a gravestone state. - */ -ZENOHC_API void z_string_null(struct z_owned_string_t *this_); -/** - * Returns ``true`` if subscriber is valid, ``false`` otherwise. - */ -ZENOHC_API bool z_subscriber_check(const struct z_owned_subscriber_t *this_); /** * Drops subscriber and resets it to its gravestone state. Also attempts to undeclare it. */ @@ -4122,18 +4140,10 @@ const struct z_loaned_keyexpr_t *z_subscriber_keyexpr(const struct z_loaned_subs */ ZENOHC_API const struct z_loaned_subscriber_t *z_subscriber_loan(const struct z_owned_subscriber_t *this_); -/** - * Constructs a subscriber in a gravestone state. - */ -ZENOHC_API void z_subscriber_null(struct z_owned_subscriber_t *this_); /** * Constructs the default value for `z_subscriber_options_t`. */ ZENOHC_API void z_subscriber_options_default(struct z_subscriber_options_t *this_); -/** - * Returns ``true`` if task is valid, ``false`` otherwise. - */ -ZENOHC_API bool z_task_check(const struct z_owned_task_t *this_); /** * Detaches the task and releases all allocated resources. */ @@ -4159,10 +4169,6 @@ z_result_t z_task_init(struct z_owned_task_t *this_, * Joins the task and releases all allocated resources */ ZENOHC_API z_result_t z_task_join(struct z_moved_task_t *this_); -/** - * Constructs task in a gravestone state. - */ -ZENOHC_API void z_task_null(struct z_owned_task_t *this_); /** * Get number of milliseconds passed since creation of `time`. */ @@ -4388,10 +4394,6 @@ ZENOHC_API void zc_closure_log_call(const struct zc_loaned_closure_log_t *closure, enum zc_log_severity_t severity, const struct z_loaned_string_t *msg); -/** - * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool zc_closure_log_check(const struct zc_owned_closure_log_t *this_); /** * Drops the closure. Droping an uninitialized closure is a no-op. */ @@ -4401,10 +4403,6 @@ ZENOHC_API void zc_closure_log_drop(struct zc_moved_closure_log_t *closure_); */ ZENOHC_API const struct zc_loaned_closure_log_t *zc_closure_log_loan(const struct zc_owned_closure_log_t *closure); -/** - * Constructs a closure in a gravestone state. - */ -ZENOHC_API void zc_closure_log_null(struct zc_owned_closure_log_t *this_); /** * Calls the closure. Calling an uninitialized closure is a no-op. */ @@ -4413,13 +4411,6 @@ ZENOHC_API void zc_closure_matching_status_call(const struct zc_loaned_closure_matching_status_t *closure, const struct zc_matching_status_t *mathing_status); #endif -/** - * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. - */ -#if defined(UNSTABLE) -ZENOHC_API -bool zc_closure_matching_status_check(const struct zc_owned_closure_matching_status_t *this_); -#endif /** * Drops the closure, resetting it to its gravestone state. Droping an uninitialized closure is a no-op. */ @@ -4434,12 +4425,6 @@ void zc_closure_matching_status_drop(struct zc_moved_closure_matching_status_t * ZENOHC_API const struct zc_loaned_closure_matching_status_t *zc_closure_matching_status_loan(const struct zc_owned_closure_matching_status_t *closure); #endif -/** - * Constructs a null value of 'zc_owned_closure_matching_status_t' type - */ -#if defined(UNSTABLE) -ZENOHC_API void zc_closure_matching_status_null(struct zc_owned_closure_matching_status_t *this_); -#endif /** * Constructs a configuration by parsing a file path stored in ZENOH_CONFIG environmental variable. * @@ -4522,6 +4507,64 @@ ZENOHC_API void zc_init_logging(void); ZENOHC_API void zc_init_logging_with_callback(enum zc_log_severity_t min_severity, struct zc_owned_closure_log_t *callback); +/** + * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool zc_internal_closure_log_check(const struct zc_owned_closure_log_t *this_); +/** + * Constructs a closure in a gravestone state. + */ +ZENOHC_API void zc_internal_closure_log_null(struct zc_owned_closure_log_t *this_); +/** + * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. + */ +#if defined(UNSTABLE) +ZENOHC_API +bool zc_internal_closure_matching_status_check(const struct zc_owned_closure_matching_status_t *this_); +#endif +/** + * Constructs a null value of 'zc_owned_closure_matching_status_t' type + */ +#if defined(UNSTABLE) +ZENOHC_API +void zc_internal_closure_matching_status_null(struct zc_owned_closure_matching_status_t *this_); +#endif +/** + * Returns ``true`` if liveliness token is valid, ``false`` otherwise. + */ +#if defined(UNSTABLE) +ZENOHC_API bool zc_internal_liveliness_token_check(const zc_owned_liveliness_token_t *this_); +#endif +/** + * Constructs liveliness token in its gravestone state. + */ +#if defined(UNSTABLE) +ZENOHC_API void zc_internal_liveliness_token_null(zc_owned_liveliness_token_t *this_); +#endif +/** + * Checks the matching listener is for the gravestone state + */ +#if defined(UNSTABLE) +ZENOHC_API bool zc_internal_matching_listener_check(const zc_owned_matching_listener_t *this_); +#endif +/** + * Constructs an empty matching listener + */ +#if defined(UNSTABLE) +ZENOHC_API void zc_internal_matching_listener_null(zc_owned_matching_listener_t *this_); +#endif +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool zc_internal_shm_client_list_check(const zc_owned_shm_client_list_t *this_); +#endif +/** + * Constructs SHM client list in its gravestone value. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API void zc_internal_shm_client_list_null(zc_owned_shm_client_list_t *this_); +#endif /** * Constructs default value for `zc_liveliness_declaration_options_t`. */ @@ -4594,12 +4637,6 @@ ZENOHC_API void zc_liveliness_get_options_default(struct zc_liveliness_get_optio ZENOHC_API void zc_liveliness_subscriber_options_default(struct zc_liveliness_subscriber_options_t *this_); #endif -/** - * Returns ``true`` if liveliness token is valid, ``false`` otherwise. - */ -#if defined(UNSTABLE) -ZENOHC_API bool zc_liveliness_token_check(const zc_owned_liveliness_token_t *this_); -#endif /** * Undeclares liveliness token, frees memory and resets it to a gravestone state. */ @@ -4613,12 +4650,6 @@ ZENOHC_API void zc_liveliness_token_drop(zc_moved_liveliness_token_t *this_); ZENOHC_API const zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const zc_owned_liveliness_token_t *this_); #endif -/** - * Constructs liveliness token in its gravestone state. - */ -#if defined(UNSTABLE) -ZENOHC_API void zc_liveliness_token_null(zc_owned_liveliness_token_t *this_); -#endif /** * Destroys a liveliness token, notifying subscribers of its destruction. */ @@ -4631,18 +4662,6 @@ ZENOHC_API z_result_t zc_liveliness_undeclare_token(zc_moved_liveliness_token_t #if defined(UNSTABLE) ZENOHC_API enum zc_locality_t zc_locality_default(void); #endif -/** - * Checks the matching listener is for the gravestone state - */ -#if defined(UNSTABLE) -ZENOHC_API bool zc_matching_listener_check(const zc_owned_matching_listener_t *this_); -#endif -/** - * Constructs an empty matching listener - */ -#if defined(UNSTABLE) -ZENOHC_API void zc_matching_listener_null(zc_owned_matching_listener_t *this_); -#endif /** * Gets publisher matching status - i.e. if there are any subscribers matching its key expression. * @@ -4696,12 +4715,6 @@ z_result_t zc_shm_client_list_add_client(z_protocol_id_t id, z_moved_shm_client_t *client, zc_loaned_shm_client_list_t *list); #endif -/** - * Returns ``true`` if `this` is valid. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool zc_shm_client_list_check(const zc_owned_shm_client_list_t *this_); -#endif /** * Deletes list of SHM Clients */ @@ -4728,12 +4741,6 @@ zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(zc_owned_shm_client_lis #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void zc_shm_client_list_new(zc_owned_shm_client_list_t *this_); #endif -/** - * Constructs SHM client list in its gravestone value. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_null(zc_owned_shm_client_list_t *this_); -#endif /** * Stops all Zenoh tasks and drops all related static variables. * All Zenoh-related structures should be properly dropped/undeclared PRIOR to this call. @@ -4782,31 +4789,37 @@ z_result_t ze_declare_querying_subscriber(ze_owned_querying_subscriber_t *this_, * Returns ``true`` if publication cache is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool ze_publication_cache_check(const ze_owned_publication_cache_t *this_); +ZENOHC_API bool ze_internal_publication_cache_check(const ze_owned_publication_cache_t *this_); #endif /** - * Drops publication cache. Also attempts to undeclare it. + * Constructs a publication cache in a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_drop(ze_moved_publication_cache_t *this_); +ZENOHC_API void ze_internal_publication_cache_null(ze_owned_publication_cache_t *this_); #endif /** - * Constructs a publication cache in a gravestone state. + * Returns ``true`` if querying subscriber is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_null(ze_owned_publication_cache_t *this_); +ZENOHC_API bool ze_internal_querying_subscriber_check(const ze_owned_querying_subscriber_t *this_); #endif /** - * Constructs the default value for `ze_publication_cache_options_t`. + * Constructs a querying subscriber in a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_options_default(struct ze_publication_cache_options_t *this_); +ZENOHC_API void ze_internal_querying_subscriber_null(ze_owned_querying_subscriber_t *this_); #endif /** - * Returns ``true`` if querying subscriber is valid, ``false`` otherwise. + * Drops publication cache. Also attempts to undeclare it. + */ +#if defined(UNSTABLE) +ZENOHC_API void ze_publication_cache_drop(ze_moved_publication_cache_t *this_); +#endif +/** + * Constructs the default value for `ze_publication_cache_options_t`. */ #if defined(UNSTABLE) -ZENOHC_API bool ze_querying_subscriber_check(const ze_owned_querying_subscriber_t *this_); +ZENOHC_API void ze_publication_cache_options_default(struct ze_publication_cache_options_t *this_); #endif /** * Drops querying subscriber. Also attempts to undeclare it. @@ -4832,12 +4845,6 @@ z_result_t ze_querying_subscriber_get(const ze_loaned_querying_subscriber_t *thi ZENOHC_API const ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const ze_owned_querying_subscriber_t *this_); #endif -/** - * Constructs a querying subscriber in a gravestone state. - */ -#if defined(UNSTABLE) -ZENOHC_API void ze_querying_subscriber_null(ze_owned_querying_subscriber_t *this_); -#endif /** * Constructs the default value for `ze_querying_subscriber_options_t`. */ diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index 6e92ea128..03d4f9ccb 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -150,70 +150,70 @@ static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t zc_owned_closure_log_t : zc_closure_log_move \ )(&this_) -#define z_null(this_) \ +#define z_internal_null(this_) \ _Generic((this_), \ - z_owned_bytes_t* : z_bytes_null, \ - z_owned_closure_hello_t* : z_closure_hello_null, \ - z_owned_closure_query_t* : z_closure_query_null, \ - z_owned_closure_reply_t* : z_closure_reply_null, \ - z_owned_closure_sample_t* : z_closure_sample_null, \ - z_owned_condvar_t* : z_condvar_null, \ - z_owned_config_t* : z_config_null, \ - z_owned_encoding_t* : z_encoding_null, \ - z_owned_fifo_handler_query_t* : z_fifo_handler_query_null, \ - z_owned_fifo_handler_reply_t* : z_fifo_handler_reply_null, \ - z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_null, \ - z_owned_hello_t* : z_hello_null, \ - z_owned_keyexpr_t* : z_keyexpr_null, \ - z_owned_mutex_t* : z_mutex_null, \ - z_owned_publisher_t* : z_publisher_null, \ - z_owned_query_t* : z_query_null, \ - z_owned_queryable_t* : z_queryable_null, \ - z_owned_reply_err_t* : z_reply_err_null, \ - z_owned_reply_t* : z_reply_null, \ - z_owned_ring_handler_query_t* : z_ring_handler_query_null, \ - z_owned_ring_handler_reply_t* : z_ring_handler_reply_null, \ - z_owned_ring_handler_sample_t* : z_ring_handler_sample_null, \ - z_owned_sample_t* : z_sample_null, \ - z_owned_session_t* : z_session_null, \ - z_owned_slice_t* : z_slice_null, \ - z_owned_string_array_t* : z_string_array_null, \ - z_owned_string_t* : z_string_null, \ - z_owned_subscriber_t* : z_subscriber_null, \ - z_owned_task_t* : z_task_null, \ - zc_owned_closure_log_t* : zc_closure_log_null \ + z_owned_bytes_t* : z_internal_bytes_null, \ + z_owned_closure_hello_t* : z_internal_closure_hello_null, \ + z_owned_closure_query_t* : z_internal_closure_query_null, \ + z_owned_closure_reply_t* : z_internal_closure_reply_null, \ + z_owned_closure_sample_t* : z_internal_closure_sample_null, \ + z_owned_condvar_t* : z_internal_condvar_null, \ + z_owned_config_t* : z_internal_config_null, \ + z_owned_encoding_t* : z_internal_encoding_null, \ + z_owned_fifo_handler_query_t* : z_internal_fifo_handler_query_null, \ + z_owned_fifo_handler_reply_t* : z_internal_fifo_handler_reply_null, \ + z_owned_fifo_handler_sample_t* : z_internal_fifo_handler_sample_null, \ + z_owned_hello_t* : z_internal_hello_null, \ + z_owned_keyexpr_t* : z_internal_keyexpr_null, \ + z_owned_mutex_t* : z_internal_mutex_null, \ + z_owned_publisher_t* : z_internal_publisher_null, \ + z_owned_query_t* : z_internal_query_null, \ + z_owned_queryable_t* : z_internal_queryable_null, \ + z_owned_reply_err_t* : z_internal_reply_err_null, \ + z_owned_reply_t* : z_internal_reply_null, \ + z_owned_ring_handler_query_t* : z_internal_ring_handler_query_null, \ + z_owned_ring_handler_reply_t* : z_internal_ring_handler_reply_null, \ + z_owned_ring_handler_sample_t* : z_internal_ring_handler_sample_null, \ + z_owned_sample_t* : z_internal_sample_null, \ + z_owned_session_t* : z_internal_session_null, \ + z_owned_slice_t* : z_internal_slice_null, \ + z_owned_string_array_t* : z_internal_string_array_null, \ + z_owned_string_t* : z_internal_string_null, \ + z_owned_subscriber_t* : z_internal_subscriber_null, \ + z_owned_task_t* : z_internal_task_null, \ + zc_owned_closure_log_t* : zc_internal_closure_log_null \ )(this_) -static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { *this_ = x->_this; z_bytes_null(&x->_this); } -static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { *this_ = x->_this; z_closure_hello_null(&x->_this); } -static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { *closure_ = x->_this; z_closure_query_null(&x->_this); } -static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { *closure_ = x->_this; z_closure_reply_null(&x->_this); } -static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { *closure_ = x->_this; z_closure_sample_null(&x->_this); } -static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { *this_ = x->_this; z_condvar_null(&x->_this); } -static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t* x) { *this_ = x->_this; z_config_null(&x->_this); } -static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t* x) { *this_ = x->_this; z_encoding_null(&x->_this); } -static inline void z_fifo_handler_query_take(z_owned_fifo_handler_query_t* this_, z_moved_fifo_handler_query_t* x) { *this_ = x->_this; z_fifo_handler_query_null(&x->_this); } -static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_, z_moved_fifo_handler_reply_t* x) { *this_ = x->_this; z_fifo_handler_reply_null(&x->_this); } -static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { *this_ = x->_this; z_fifo_handler_sample_null(&x->_this); } -static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *this_ = x->_this; z_hello_null(&x->_this); } -static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_keyexpr_null(&x->_this); } -static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_mutex_null(&x->_this); } -static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_publisher_null(&x->_this); } -static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_query_null(&x->_this); } -static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t* x) { *this_ = x->_this; z_queryable_null(&x->_this); } -static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t* x) { *this_ = x->_this; z_reply_null(&x->_this); } -static inline void z_reply_err_take(z_owned_reply_err_t* this_, z_moved_reply_err_t* x) { *this_ = x->_this; z_reply_err_null(&x->_this); } -static inline void z_ring_handler_query_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t* x) { *this_ = x->_this; z_ring_handler_query_null(&x->_this); } -static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_, z_moved_ring_handler_reply_t* x) { *this_ = x->_this; z_ring_handler_reply_null(&x->_this); } -static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { *this_ = x->_this; z_ring_handler_sample_null(&x->_this); } -static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t* x) { *this_ = x->_this; z_sample_null(&x->_this); } -static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t* x) { *this_ = x->_this; z_session_null(&x->_this); } -static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t* x) { *this_ = x->_this; z_slice_null(&x->_this); } -static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { *this_ = x->_this; z_string_array_null(&x->_this); } -static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t* x) { *this_ = x->_this; z_string_null(&x->_this); } -static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { *this_ = x->_this; z_subscriber_null(&x->_this); } -static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t* x) { *this_ = x->_this; z_task_null(&x->_this); } -static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { *closure_ = x->_this; zc_closure_log_null(&x->_this); } +static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { *this_ = x->_this; z_internal_bytes_null(&x->_this); } +static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { *this_ = x->_this; z_internal_closure_hello_null(&x->_this); } +static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { *closure_ = x->_this; z_internal_closure_query_null(&x->_this); } +static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { *closure_ = x->_this; z_internal_closure_reply_null(&x->_this); } +static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { *closure_ = x->_this; z_internal_closure_sample_null(&x->_this); } +static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { *this_ = x->_this; z_internal_condvar_null(&x->_this); } +static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t* x) { *this_ = x->_this; z_internal_config_null(&x->_this); } +static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t* x) { *this_ = x->_this; z_internal_encoding_null(&x->_this); } +static inline void z_fifo_handler_query_take(z_owned_fifo_handler_query_t* this_, z_moved_fifo_handler_query_t* x) { *this_ = x->_this; z_internal_fifo_handler_query_null(&x->_this); } +static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_, z_moved_fifo_handler_reply_t* x) { *this_ = x->_this; z_internal_fifo_handler_reply_null(&x->_this); } +static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { *this_ = x->_this; z_internal_fifo_handler_sample_null(&x->_this); } +static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *this_ = x->_this; z_internal_hello_null(&x->_this); } +static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_internal_keyexpr_null(&x->_this); } +static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_internal_mutex_null(&x->_this); } +static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_internal_publisher_null(&x->_this); } +static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_internal_query_null(&x->_this); } +static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t* x) { *this_ = x->_this; z_internal_queryable_null(&x->_this); } +static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t* x) { *this_ = x->_this; z_internal_reply_null(&x->_this); } +static inline void z_reply_err_take(z_owned_reply_err_t* this_, z_moved_reply_err_t* x) { *this_ = x->_this; z_internal_reply_err_null(&x->_this); } +static inline void z_ring_handler_query_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t* x) { *this_ = x->_this; z_internal_ring_handler_query_null(&x->_this); } +static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_, z_moved_ring_handler_reply_t* x) { *this_ = x->_this; z_internal_ring_handler_reply_null(&x->_this); } +static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { *this_ = x->_this; z_internal_ring_handler_sample_null(&x->_this); } +static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t* x) { *this_ = x->_this; z_internal_sample_null(&x->_this); } +static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t* x) { *this_ = x->_this; z_internal_session_null(&x->_this); } +static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t* x) { *this_ = x->_this; z_internal_slice_null(&x->_this); } +static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { *this_ = x->_this; z_internal_string_array_null(&x->_this); } +static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t* x) { *this_ = x->_this; z_internal_string_null(&x->_this); } +static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { *this_ = x->_this; z_internal_subscriber_null(&x->_this); } +static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t* x) { *this_ = x->_this; z_internal_task_null(&x->_this); } +static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { *closure_ = x->_this; zc_internal_closure_log_null(&x->_this); } #define z_take(this_, x) \ @@ -250,38 +250,38 @@ static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_move zc_owned_closure_log_t* : zc_closure_log_take \ )(this_, x) -#define z_check(this_) \ +#define z_internal_check(this_) \ _Generic((this_), \ - z_owned_bytes_t : z_bytes_check, \ - z_owned_closure_hello_t : z_closure_hello_check, \ - z_owned_closure_query_t : z_closure_query_check, \ - z_owned_closure_reply_t : z_closure_reply_check, \ - z_owned_closure_sample_t : z_closure_sample_check, \ - z_owned_condvar_t : z_condvar_check, \ - z_owned_config_t : z_config_check, \ - z_owned_encoding_t : z_encoding_check, \ - z_owned_fifo_handler_query_t : z_fifo_handler_query_check, \ - z_owned_fifo_handler_reply_t : z_fifo_handler_reply_check, \ - z_owned_fifo_handler_sample_t : z_fifo_handler_sample_check, \ - z_owned_hello_t : z_hello_check, \ - z_owned_keyexpr_t : z_keyexpr_check, \ - z_owned_mutex_t : z_mutex_check, \ - z_owned_publisher_t : z_publisher_check, \ - z_owned_query_t : z_query_check, \ - z_owned_queryable_t : z_queryable_check, \ - z_owned_reply_t : z_reply_check, \ - z_owned_reply_err_t : z_reply_err_check, \ - z_owned_ring_handler_query_t : z_ring_handler_query_check, \ - z_owned_ring_handler_reply_t : z_ring_handler_reply_check, \ - z_owned_ring_handler_sample_t : z_ring_handler_sample_check, \ - z_owned_sample_t : z_sample_check, \ - z_owned_session_t : z_session_check, \ - z_owned_slice_t : z_slice_check, \ - z_owned_string_array_t : z_string_array_check, \ - z_owned_string_t : z_string_check, \ - z_owned_subscriber_t : z_subscriber_check, \ - z_owned_task_t : z_task_check, \ - zc_owned_closure_log_t : zc_closure_log_check \ + z_owned_bytes_t : z_internal_bytes_check, \ + z_owned_closure_hello_t : z_internal_closure_hello_check, \ + z_owned_closure_query_t : z_internal_closure_query_check, \ + z_owned_closure_reply_t : z_internal_closure_reply_check, \ + z_owned_closure_sample_t : z_internal_closure_sample_check, \ + z_owned_condvar_t : z_internal_condvar_check, \ + z_owned_config_t : z_internal_config_check, \ + z_owned_encoding_t : z_internal_encoding_check, \ + z_owned_fifo_handler_query_t : z_internal_fifo_handler_query_check, \ + z_owned_fifo_handler_reply_t : z_internal_fifo_handler_reply_check, \ + z_owned_fifo_handler_sample_t : z_internal_fifo_handler_sample_check, \ + z_owned_hello_t : z_internal_hello_check, \ + z_owned_keyexpr_t : z_internal_keyexpr_check, \ + z_owned_mutex_t : z_internal_mutex_check, \ + z_owned_publisher_t : z_internal_publisher_check, \ + z_owned_query_t : z_internal_query_check, \ + z_owned_queryable_t : z_internal_queryable_check, \ + z_owned_reply_t : z_internal_reply_check, \ + z_owned_reply_err_t : z_internal_reply_err_check, \ + z_owned_ring_handler_query_t : z_internal_ring_handler_query_check, \ + z_owned_ring_handler_reply_t : z_internal_ring_handler_reply_check, \ + z_owned_ring_handler_sample_t : z_internal_ring_handler_sample_check, \ + z_owned_sample_t : z_internal_sample_check, \ + z_owned_session_t : z_internal_session_check, \ + z_owned_slice_t : z_internal_slice_check, \ + z_owned_string_array_t : z_internal_string_array_check, \ + z_owned_string_t : z_internal_string_check, \ + z_owned_subscriber_t : z_internal_subscriber_check, \ + z_owned_task_t : z_internal_task_check, \ + zc_owned_closure_log_t : zc_internal_closure_log_check \ )(&this_) #define z_call(closure, hello) \ @@ -456,67 +456,67 @@ inline z_moved_task_t* z_move(z_owned_task_t& this_) { return z_task_move(&this_ inline zc_moved_closure_log_t* z_move(zc_owned_closure_log_t& closure_) { return zc_closure_log_move(&closure_); }; -inline void z_null(z_owned_bytes_t* this_) { z_bytes_null(this_); }; -inline void z_null(z_owned_closure_hello_t* this_) { z_closure_hello_null(this_); }; -inline void z_null(z_owned_closure_query_t* this_) { z_closure_query_null(this_); }; -inline void z_null(z_owned_closure_reply_t* this_) { z_closure_reply_null(this_); }; -inline void z_null(z_owned_closure_sample_t* this_) { z_closure_sample_null(this_); }; -inline void z_null(z_owned_condvar_t* this_) { z_condvar_null(this_); }; -inline void z_null(z_owned_config_t* this_) { z_config_null(this_); }; -inline void z_null(z_owned_encoding_t* this_) { z_encoding_null(this_); }; -inline void z_null(z_owned_fifo_handler_query_t* this_) { z_fifo_handler_query_null(this_); }; -inline void z_null(z_owned_fifo_handler_reply_t* this_) { z_fifo_handler_reply_null(this_); }; -inline void z_null(z_owned_fifo_handler_sample_t* this_) { z_fifo_handler_sample_null(this_); }; -inline void z_null(z_owned_hello_t* this_) { z_hello_null(this_); }; -inline void z_null(z_owned_keyexpr_t* this_) { z_keyexpr_null(this_); }; -inline void z_null(z_owned_mutex_t* this_) { z_mutex_null(this_); }; -inline void z_null(z_owned_publisher_t* this_) { z_publisher_null(this_); }; -inline void z_null(z_owned_query_t* this_) { z_query_null(this_); }; -inline void z_null(z_owned_queryable_t* this_) { z_queryable_null(this_); }; -inline void z_null(z_owned_reply_err_t* this_) { z_reply_err_null(this_); }; -inline void z_null(z_owned_reply_t* this_) { z_reply_null(this_); }; -inline void z_null(z_owned_ring_handler_query_t* this_) { z_ring_handler_query_null(this_); }; -inline void z_null(z_owned_ring_handler_reply_t* this_) { z_ring_handler_reply_null(this_); }; -inline void z_null(z_owned_ring_handler_sample_t* this_) { z_ring_handler_sample_null(this_); }; -inline void z_null(z_owned_sample_t* this_) { z_sample_null(this_); }; -inline void z_null(z_owned_session_t* this_) { z_session_null(this_); }; -inline void z_null(z_owned_slice_t* this_) { z_slice_null(this_); }; -inline void z_null(z_owned_string_array_t* this_) { z_string_array_null(this_); }; -inline void z_null(z_owned_string_t* this_) { z_string_null(this_); }; -inline void z_null(z_owned_subscriber_t* this_) { z_subscriber_null(this_); }; -inline void z_null(z_owned_task_t* this_) { z_task_null(this_); }; -inline void z_null(zc_owned_closure_log_t* this_) { zc_closure_log_null(this_); }; - -static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { *this_ = x->_this; z_bytes_null(&x->_this); } -static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { *this_ = x->_this; z_closure_hello_null(&x->_this); } -static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { *closure_ = x->_this; z_closure_query_null(&x->_this); } -static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { *closure_ = x->_this; z_closure_reply_null(&x->_this); } -static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { *closure_ = x->_this; z_closure_sample_null(&x->_this); } -static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { *this_ = x->_this; z_condvar_null(&x->_this); } -static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t* x) { *this_ = x->_this; z_config_null(&x->_this); } -static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t* x) { *this_ = x->_this; z_encoding_null(&x->_this); } -static inline void z_fifo_handler_query_take(z_owned_fifo_handler_query_t* this_, z_moved_fifo_handler_query_t* x) { *this_ = x->_this; z_fifo_handler_query_null(&x->_this); } -static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_, z_moved_fifo_handler_reply_t* x) { *this_ = x->_this; z_fifo_handler_reply_null(&x->_this); } -static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { *this_ = x->_this; z_fifo_handler_sample_null(&x->_this); } -static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *this_ = x->_this; z_hello_null(&x->_this); } -static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_keyexpr_null(&x->_this); } -static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_mutex_null(&x->_this); } -static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_publisher_null(&x->_this); } -static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_query_null(&x->_this); } -static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t* x) { *this_ = x->_this; z_queryable_null(&x->_this); } -static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t* x) { *this_ = x->_this; z_reply_null(&x->_this); } -static inline void z_reply_err_take(z_owned_reply_err_t* this_, z_moved_reply_err_t* x) { *this_ = x->_this; z_reply_err_null(&x->_this); } -static inline void z_ring_handler_query_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t* x) { *this_ = x->_this; z_ring_handler_query_null(&x->_this); } -static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_, z_moved_ring_handler_reply_t* x) { *this_ = x->_this; z_ring_handler_reply_null(&x->_this); } -static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { *this_ = x->_this; z_ring_handler_sample_null(&x->_this); } -static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t* x) { *this_ = x->_this; z_sample_null(&x->_this); } -static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t* x) { *this_ = x->_this; z_session_null(&x->_this); } -static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t* x) { *this_ = x->_this; z_slice_null(&x->_this); } -static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { *this_ = x->_this; z_string_array_null(&x->_this); } -static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t* x) { *this_ = x->_this; z_string_null(&x->_this); } -static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { *this_ = x->_this; z_subscriber_null(&x->_this); } -static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t* x) { *this_ = x->_this; z_task_null(&x->_this); } -static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { *closure_ = x->_this; zc_closure_log_null(&x->_this); } +inline void z_internal_null(z_owned_bytes_t* this_) { z_internal_bytes_null(this_); }; +inline void z_internal_null(z_owned_closure_hello_t* this_) { z_internal_closure_hello_null(this_); }; +inline void z_internal_null(z_owned_closure_query_t* this_) { z_internal_closure_query_null(this_); }; +inline void z_internal_null(z_owned_closure_reply_t* this_) { z_internal_closure_reply_null(this_); }; +inline void z_internal_null(z_owned_closure_sample_t* this_) { z_internal_closure_sample_null(this_); }; +inline void z_internal_null(z_owned_condvar_t* this_) { z_internal_condvar_null(this_); }; +inline void z_internal_null(z_owned_config_t* this_) { z_internal_config_null(this_); }; +inline void z_internal_null(z_owned_encoding_t* this_) { z_internal_encoding_null(this_); }; +inline void z_internal_null(z_owned_fifo_handler_query_t* this_) { z_internal_fifo_handler_query_null(this_); }; +inline void z_internal_null(z_owned_fifo_handler_reply_t* this_) { z_internal_fifo_handler_reply_null(this_); }; +inline void z_internal_null(z_owned_fifo_handler_sample_t* this_) { z_internal_fifo_handler_sample_null(this_); }; +inline void z_internal_null(z_owned_hello_t* this_) { z_internal_hello_null(this_); }; +inline void z_internal_null(z_owned_keyexpr_t* this_) { z_internal_keyexpr_null(this_); }; +inline void z_internal_null(z_owned_mutex_t* this_) { z_internal_mutex_null(this_); }; +inline void z_internal_null(z_owned_publisher_t* this_) { z_internal_publisher_null(this_); }; +inline void z_internal_null(z_owned_query_t* this_) { z_internal_query_null(this_); }; +inline void z_internal_null(z_owned_queryable_t* this_) { z_internal_queryable_null(this_); }; +inline void z_internal_null(z_owned_reply_err_t* this_) { z_internal_reply_err_null(this_); }; +inline void z_internal_null(z_owned_reply_t* this_) { z_internal_reply_null(this_); }; +inline void z_internal_null(z_owned_ring_handler_query_t* this_) { z_internal_ring_handler_query_null(this_); }; +inline void z_internal_null(z_owned_ring_handler_reply_t* this_) { z_internal_ring_handler_reply_null(this_); }; +inline void z_internal_null(z_owned_ring_handler_sample_t* this_) { z_internal_ring_handler_sample_null(this_); }; +inline void z_internal_null(z_owned_sample_t* this_) { z_internal_sample_null(this_); }; +inline void z_internal_null(z_owned_session_t* this_) { z_internal_session_null(this_); }; +inline void z_internal_null(z_owned_slice_t* this_) { z_internal_slice_null(this_); }; +inline void z_internal_null(z_owned_string_array_t* this_) { z_internal_string_array_null(this_); }; +inline void z_internal_null(z_owned_string_t* this_) { z_internal_string_null(this_); }; +inline void z_internal_null(z_owned_subscriber_t* this_) { z_internal_subscriber_null(this_); }; +inline void z_internal_null(z_owned_task_t* this_) { z_internal_task_null(this_); }; +inline void z_internal_null(zc_owned_closure_log_t* this_) { zc_internal_closure_log_null(this_); }; + +static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { *this_ = x->_this; z_internal_bytes_null(&x->_this); } +static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { *this_ = x->_this; z_internal_closure_hello_null(&x->_this); } +static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { *closure_ = x->_this; z_internal_closure_query_null(&x->_this); } +static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { *closure_ = x->_this; z_internal_closure_reply_null(&x->_this); } +static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { *closure_ = x->_this; z_internal_closure_sample_null(&x->_this); } +static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { *this_ = x->_this; z_internal_condvar_null(&x->_this); } +static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t* x) { *this_ = x->_this; z_internal_config_null(&x->_this); } +static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t* x) { *this_ = x->_this; z_internal_encoding_null(&x->_this); } +static inline void z_fifo_handler_query_take(z_owned_fifo_handler_query_t* this_, z_moved_fifo_handler_query_t* x) { *this_ = x->_this; z_internal_fifo_handler_query_null(&x->_this); } +static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_, z_moved_fifo_handler_reply_t* x) { *this_ = x->_this; z_internal_fifo_handler_reply_null(&x->_this); } +static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { *this_ = x->_this; z_internal_fifo_handler_sample_null(&x->_this); } +static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *this_ = x->_this; z_internal_hello_null(&x->_this); } +static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_internal_keyexpr_null(&x->_this); } +static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_internal_mutex_null(&x->_this); } +static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_internal_publisher_null(&x->_this); } +static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_internal_query_null(&x->_this); } +static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t* x) { *this_ = x->_this; z_internal_queryable_null(&x->_this); } +static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t* x) { *this_ = x->_this; z_internal_reply_null(&x->_this); } +static inline void z_reply_err_take(z_owned_reply_err_t* this_, z_moved_reply_err_t* x) { *this_ = x->_this; z_internal_reply_err_null(&x->_this); } +static inline void z_ring_handler_query_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t* x) { *this_ = x->_this; z_internal_ring_handler_query_null(&x->_this); } +static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_, z_moved_ring_handler_reply_t* x) { *this_ = x->_this; z_internal_ring_handler_reply_null(&x->_this); } +static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { *this_ = x->_this; z_internal_ring_handler_sample_null(&x->_this); } +static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t* x) { *this_ = x->_this; z_internal_sample_null(&x->_this); } +static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t* x) { *this_ = x->_this; z_internal_session_null(&x->_this); } +static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t* x) { *this_ = x->_this; z_internal_slice_null(&x->_this); } +static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { *this_ = x->_this; z_internal_string_array_null(&x->_this); } +static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t* x) { *this_ = x->_this; z_internal_string_null(&x->_this); } +static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { *this_ = x->_this; z_internal_subscriber_null(&x->_this); } +static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t* x) { *this_ = x->_this; z_internal_task_null(&x->_this); } +static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { *closure_ = x->_this; zc_internal_closure_log_null(&x->_this); } @@ -612,36 +612,36 @@ inline void z_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) }; -inline bool z_check(const z_owned_bytes_t& this_) { return z_bytes_check(&this_); }; -inline bool z_check(const z_owned_closure_hello_t& this_) { return z_closure_hello_check(&this_); }; -inline bool z_check(const z_owned_closure_query_t& this_) { return z_closure_query_check(&this_); }; -inline bool z_check(const z_owned_closure_reply_t& this_) { return z_closure_reply_check(&this_); }; -inline bool z_check(const z_owned_closure_sample_t& this_) { return z_closure_sample_check(&this_); }; -inline bool z_check(const z_owned_condvar_t& this_) { return z_condvar_check(&this_); }; -inline bool z_check(const z_owned_config_t& this_) { return z_config_check(&this_); }; -inline bool z_check(const z_owned_encoding_t& this_) { return z_encoding_check(&this_); }; -inline bool z_check(const z_owned_fifo_handler_query_t& this_) { return z_fifo_handler_query_check(&this_); }; -inline bool z_check(const z_owned_fifo_handler_reply_t& this_) { return z_fifo_handler_reply_check(&this_); }; -inline bool z_check(const z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_check(&this_); }; -inline bool z_check(const z_owned_hello_t& this_) { return z_hello_check(&this_); }; -inline bool z_check(const z_owned_keyexpr_t& this_) { return z_keyexpr_check(&this_); }; -inline bool z_check(const z_owned_mutex_t& this_) { return z_mutex_check(&this_); }; -inline bool z_check(const z_owned_publisher_t& this_) { return z_publisher_check(&this_); }; -inline bool z_check(const z_owned_query_t& query) { return z_query_check(&query); }; -inline bool z_check(const z_owned_queryable_t& this_) { return z_queryable_check(&this_); }; -inline bool z_check(const z_owned_reply_t& this_) { return z_reply_check(&this_); }; -inline bool z_check(const z_owned_reply_err_t& this_) { return z_reply_err_check(&this_); }; -inline bool z_check(const z_owned_ring_handler_query_t& this_) { return z_ring_handler_query_check(&this_); }; -inline bool z_check(const z_owned_ring_handler_reply_t& this_) { return z_ring_handler_reply_check(&this_); }; -inline bool z_check(const z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_check(&this_); }; -inline bool z_check(const z_owned_sample_t& this_) { return z_sample_check(&this_); }; -inline bool z_check(const z_owned_session_t& this_) { return z_session_check(&this_); }; -inline bool z_check(const z_owned_slice_t& this_) { return z_slice_check(&this_); }; -inline bool z_check(const z_owned_string_array_t& this_) { return z_string_array_check(&this_); }; -inline bool z_check(const z_owned_string_t& this_) { return z_string_check(&this_); }; -inline bool z_check(const z_owned_subscriber_t& this_) { return z_subscriber_check(&this_); }; -inline bool z_check(const z_owned_task_t& this_) { return z_task_check(&this_); }; -inline bool z_check(const zc_owned_closure_log_t& this_) { return zc_closure_log_check(&this_); }; +inline bool z_internal_check(const z_owned_bytes_t& this_) { return z_internal_bytes_check(&this_); }; +inline bool z_internal_check(const z_owned_closure_hello_t& this_) { return z_internal_closure_hello_check(&this_); }; +inline bool z_internal_check(const z_owned_closure_query_t& this_) { return z_internal_closure_query_check(&this_); }; +inline bool z_internal_check(const z_owned_closure_reply_t& this_) { return z_internal_closure_reply_check(&this_); }; +inline bool z_internal_check(const z_owned_closure_sample_t& this_) { return z_internal_closure_sample_check(&this_); }; +inline bool z_internal_check(const z_owned_condvar_t& this_) { return z_internal_condvar_check(&this_); }; +inline bool z_internal_check(const z_owned_config_t& this_) { return z_internal_config_check(&this_); }; +inline bool z_internal_check(const z_owned_encoding_t& this_) { return z_internal_encoding_check(&this_); }; +inline bool z_internal_check(const z_owned_fifo_handler_query_t& this_) { return z_internal_fifo_handler_query_check(&this_); }; +inline bool z_internal_check(const z_owned_fifo_handler_reply_t& this_) { return z_internal_fifo_handler_reply_check(&this_); }; +inline bool z_internal_check(const z_owned_fifo_handler_sample_t& this_) { return z_internal_fifo_handler_sample_check(&this_); }; +inline bool z_internal_check(const z_owned_hello_t& this_) { return z_internal_hello_check(&this_); }; +inline bool z_internal_check(const z_owned_keyexpr_t& this_) { return z_internal_keyexpr_check(&this_); }; +inline bool z_internal_check(const z_owned_mutex_t& this_) { return z_internal_mutex_check(&this_); }; +inline bool z_internal_check(const z_owned_publisher_t& this_) { return z_internal_publisher_check(&this_); }; +inline bool z_internal_check(const z_owned_query_t& query) { return z_internal_query_check(&query); }; +inline bool z_internal_check(const z_owned_queryable_t& this_) { return z_internal_queryable_check(&this_); }; +inline bool z_internal_check(const z_owned_reply_t& this_) { return z_internal_reply_check(&this_); }; +inline bool z_internal_check(const z_owned_reply_err_t& this_) { return z_internal_reply_err_check(&this_); }; +inline bool z_internal_check(const z_owned_ring_handler_query_t& this_) { return z_internal_ring_handler_query_check(&this_); }; +inline bool z_internal_check(const z_owned_ring_handler_reply_t& this_) { return z_internal_ring_handler_reply_check(&this_); }; +inline bool z_internal_check(const z_owned_ring_handler_sample_t& this_) { return z_internal_ring_handler_sample_check(&this_); }; +inline bool z_internal_check(const z_owned_sample_t& this_) { return z_internal_sample_check(&this_); }; +inline bool z_internal_check(const z_owned_session_t& this_) { return z_internal_session_check(&this_); }; +inline bool z_internal_check(const z_owned_slice_t& this_) { return z_internal_slice_check(&this_); }; +inline bool z_internal_check(const z_owned_string_array_t& this_) { return z_internal_string_array_check(&this_); }; +inline bool z_internal_check(const z_owned_string_t& this_) { return z_internal_string_check(&this_); }; +inline bool z_internal_check(const z_owned_subscriber_t& this_) { return z_internal_subscriber_check(&this_); }; +inline bool z_internal_check(const z_owned_task_t& this_) { return z_internal_task_check(&this_); }; +inline bool z_internal_check(const zc_owned_closure_log_t& this_) { return zc_internal_closure_log_check(&this_); }; inline void z_call(const z_loaned_closure_hello_t* closure, const z_loaned_hello_t* hello) { diff --git a/src/closures/hello_closure.rs b/src/closures/hello_closure.rs index 4183ded46..dcd4c19c8 100644 --- a/src/closures/hello_closure.rs +++ b/src/closures/hello_closure.rs @@ -83,7 +83,9 @@ impl Drop for z_owned_closure_hello_t { /// Constructs a closure in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_hello_null(this_: *mut MaybeUninit) { +pub unsafe extern "C" fn z_internal_closure_hello_null( + this_: *mut MaybeUninit, +) { (*this_).write(z_owned_closure_hello_t::default()); } /// Calls the closure. Calling an uninitialized closure is a no-op. @@ -129,7 +131,7 @@ impl From for z_owned_closure_hello_t { /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_closure_hello_check(this_: &z_owned_closure_hello_t) -> bool { +pub extern "C" fn z_internal_closure_hello_check(this_: &z_owned_closure_hello_t) -> bool { !this_.is_empty() } diff --git a/src/closures/log_closure.rs b/src/closures/log_closure.rs index e8e8fe2cb..894b0f6da 100644 --- a/src/closures/log_closure.rs +++ b/src/closures/log_closure.rs @@ -146,7 +146,9 @@ impl Drop for zc_owned_closure_log_t { /// Constructs a closure in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn zc_closure_log_null(this_: *mut MaybeUninit) { +pub unsafe extern "C" fn zc_internal_closure_log_null( + this_: *mut MaybeUninit, +) { (*this_).write(zc_owned_closure_log_t::default()); } /// Calls the closure. Calling an uninitialized closure is a no-op. @@ -172,7 +174,7 @@ pub extern "C" fn zc_closure_log_drop(closure_: &mut zc_moved_closure_log_t) { /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn zc_closure_log_check(this_: &zc_owned_closure_log_t) -> bool { +pub extern "C" fn zc_internal_closure_log_check(this_: &zc_owned_closure_log_t) -> bool { !this_.is_empty() } diff --git a/src/closures/matching_status_closure.rs b/src/closures/matching_status_closure.rs index 53dc6e722..0597651f1 100644 --- a/src/closures/matching_status_closure.rs +++ b/src/closures/matching_status_closure.rs @@ -82,7 +82,7 @@ impl Drop for zc_owned_closure_matching_status_t { /// Constructs a null value of 'zc_owned_closure_matching_status_t' type #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn zc_closure_matching_status_null( +pub unsafe extern "C" fn zc_internal_closure_matching_status_null( this: *mut MaybeUninit, ) { (*this).write(zc_owned_closure_matching_status_t::default()); @@ -90,7 +90,7 @@ pub unsafe extern "C" fn zc_closure_matching_status_null( /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn zc_closure_matching_status_check( +pub extern "C" fn zc_internal_closure_matching_status_check( this: &zc_owned_closure_matching_status_t, ) -> bool { !this.is_empty() diff --git a/src/closures/query_channel.rs b/src/closures/query_channel.rs index b9aadf9d3..cc1ff2547 100644 --- a/src/closures/query_channel.rs +++ b/src/closures/query_channel.rs @@ -41,13 +41,17 @@ pub extern "C" fn z_fifo_handler_query_drop(this_: &mut z_moved_fifo_handler_que /// Constructs a handler in gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_query_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_fifo_handler_query_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_query_check(this_: &z_owned_fifo_handler_query_t) -> bool { +pub extern "C" fn z_internal_fifo_handler_query_check( + this_: &z_owned_fifo_handler_query_t, +) -> bool { this_.as_rust_type_ref().is_some() } @@ -161,13 +165,17 @@ pub extern "C" fn z_ring_handler_query_drop(this_: &mut z_moved_ring_handler_que /// Constructs a handler in gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_query_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_ring_handler_query_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_query_check(this_: &z_owned_ring_handler_query_t) -> bool { +pub extern "C" fn z_internal_ring_handler_query_check( + this_: &z_owned_ring_handler_query_t, +) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/closures/query_closure.rs b/src/closures/query_closure.rs index 74969df78..8197774f3 100644 --- a/src/closures/query_closure.rs +++ b/src/closures/query_closure.rs @@ -83,13 +83,15 @@ impl Drop for z_owned_closure_query_t { /// Constructs a closure in its gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_query_null(this_: *mut MaybeUninit) { +pub unsafe extern "C" fn z_internal_closure_query_null( + this_: *mut MaybeUninit, +) { (*this_).write(z_owned_closure_query_t::default()); } /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_closure_query_check(this_: &z_owned_closure_query_t) -> bool { +pub extern "C" fn z_internal_closure_query_check(this_: &z_owned_closure_query_t) -> bool { !this_.is_empty() } diff --git a/src/closures/reply_closure.rs b/src/closures/reply_closure.rs index 051851bd9..a33692dd0 100644 --- a/src/closures/reply_closure.rs +++ b/src/closures/reply_closure.rs @@ -84,13 +84,15 @@ impl Drop for z_owned_closure_reply_t { /// Constructs a closure int its gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_reply_null(this_: *mut MaybeUninit) { +pub unsafe extern "C" fn z_internal_closure_reply_null( + this_: *mut MaybeUninit, +) { (*this_).write(z_owned_closure_reply_t::default()); } /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_closure_reply_check(this_: &z_owned_closure_reply_t) -> bool { +pub extern "C" fn z_internal_closure_reply_check(this_: &z_owned_closure_reply_t) -> bool { !this_.is_empty() } diff --git a/src/closures/response_channel.rs b/src/closures/response_channel.rs index 027146474..fc7092b17 100644 --- a/src/closures/response_channel.rs +++ b/src/closures/response_channel.rs @@ -41,13 +41,17 @@ pub extern "C" fn z_fifo_handler_reply_drop(this_: &mut z_moved_fifo_handler_rep /// Constructs a handler in gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_reply_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_fifo_handler_reply_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_reply_check(this_: &z_owned_fifo_handler_reply_t) -> bool { +pub extern "C" fn z_internal_fifo_handler_reply_check( + this_: &z_owned_fifo_handler_reply_t, +) -> bool { this_.as_rust_type_ref().is_some() } @@ -157,13 +161,17 @@ pub extern "C" fn z_ring_handler_reply_drop(this_: &mut z_moved_ring_handler_rep /// Constructs a handler in gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_reply_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_ring_handler_reply_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_reply_check(this_: &z_owned_ring_handler_reply_t) -> bool { +pub extern "C" fn z_internal_ring_handler_reply_check( + this_: &z_owned_ring_handler_reply_t, +) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/closures/sample_channel.rs b/src/closures/sample_channel.rs index 57f11f4a2..7daf956d6 100644 --- a/src/closures/sample_channel.rs +++ b/src/closures/sample_channel.rs @@ -41,7 +41,7 @@ pub extern "C" fn z_fifo_handler_sample_drop(this_: &mut z_moved_fifo_handler_sa /// Constructs a handler in gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_sample_null( +pub extern "C" fn z_internal_fifo_handler_sample_null( this: &mut MaybeUninit, ) { this.as_rust_type_mut_uninit().write(None); @@ -49,7 +49,9 @@ pub extern "C" fn z_fifo_handler_sample_null( /// Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_sample_check(this_: &z_owned_fifo_handler_sample_t) -> bool { +pub extern "C" fn z_internal_fifo_handler_sample_check( + this_: &z_owned_fifo_handler_sample_t, +) -> bool { this_.as_rust_type_ref().is_some() } @@ -163,7 +165,7 @@ pub extern "C" fn z_ring_handler_sample_drop(this_: &mut z_moved_ring_handler_sa /// Constructs a handler in gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_sample_null( +pub extern "C" fn z_internal_ring_handler_sample_null( this: &mut MaybeUninit, ) { this.as_rust_type_mut_uninit().write(None); @@ -171,7 +173,9 @@ pub extern "C" fn z_ring_handler_sample_null( /// Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_sample_check(this_: &z_owned_ring_handler_sample_t) -> bool { +pub extern "C" fn z_internal_ring_handler_sample_check( + this_: &z_owned_ring_handler_sample_t, +) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/closures/sample_closure.rs b/src/closures/sample_closure.rs index 5c208427a..d2574b764 100644 --- a/src/closures/sample_closure.rs +++ b/src/closures/sample_closure.rs @@ -84,13 +84,15 @@ impl Drop for z_owned_closure_sample_t { /// Constructs a closure in its gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_sample_null(this_: &mut MaybeUninit) { +pub unsafe extern "C" fn z_internal_closure_sample_null( + this_: &mut MaybeUninit, +) { this_.write(z_owned_closure_sample_t::default()); } /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_closure_sample_check(this_: &z_owned_closure_sample_t) -> bool { +pub extern "C" fn z_internal_closure_sample_check(this_: &z_owned_closure_sample_t) -> bool { !this_.is_empty() } diff --git a/src/closures/zenohid_closure.rs b/src/closures/zenohid_closure.rs index 84add94e1..6447515aa 100644 --- a/src/closures/zenohid_closure.rs +++ b/src/closures/zenohid_closure.rs @@ -84,14 +84,16 @@ impl Drop for z_owned_closure_zid_t { /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_zid_check(this_: &z_owned_closure_zid_t) -> bool { +pub unsafe extern "C" fn z_internal_closure_zid_check(this_: &z_owned_closure_zid_t) -> bool { !this_.is_empty() } /// Constructs a null closure. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_zid_null(this_: &mut MaybeUninit) { +pub unsafe extern "C" fn z_internal_closure_zid_null( + this_: &mut MaybeUninit, +) { this_.write(z_owned_closure_zid_t::default()); } /// Calls the closure. Calling an uninitialized closure is a no-op. diff --git a/src/collections.rs b/src/collections.rs index ffc43d529..5be462f6b 100644 --- a/src/collections.rs +++ b/src/collections.rs @@ -318,7 +318,7 @@ pub extern "C" fn z_slice_empty(this_: &mut MaybeUninit) { /// Constructs an empty `z_owned_slice_t`. #[no_mangle] -pub extern "C" fn z_slice_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_slice_null(this_: &mut MaybeUninit) { z_slice_empty(this_); } @@ -344,7 +344,7 @@ pub extern "C" fn z_slice_clone(dst: &mut MaybeUninit, this_: & /// @return ``true`` if slice is not empty, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_slice_check(this_: &z_owned_slice_t) -> bool { +pub extern "C" fn z_internal_slice_check(this_: &z_owned_slice_t) -> bool { !this_.as_rust_type_ref().is_empty() } @@ -538,13 +538,13 @@ pub unsafe extern "C" fn z_string_drop(this_: &mut z_moved_string_t) { /// @return ``true`` if `this_` is a valid string, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_string_check(this_: &z_owned_string_t) -> bool { +pub extern "C" fn z_internal_string_check(this_: &z_owned_string_t) -> bool { !this_.as_rust_type_ref().is_empty() } /// Constructs owned string in a gravestone state. #[no_mangle] -pub extern "C" fn z_string_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_string_null(this_: &mut MaybeUninit) { this_ .as_rust_type_mut_uninit() .write(CStringOwned::default()); @@ -745,13 +745,13 @@ pub extern "C" fn z_string_array_new(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_string_array_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// @return ``true`` if the string array is valid, ``false`` if it is in a gravestone state. #[no_mangle] -pub extern "C" fn z_string_array_check(this_: &z_owned_string_array_t) -> bool { +pub extern "C" fn z_internal_string_array_check(this_: &z_owned_string_array_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/commons.rs b/src/commons.rs index be52e2a88..db3aebbb7 100644 --- a/src/commons.rs +++ b/src/commons.rs @@ -188,7 +188,7 @@ pub extern "C" fn z_sample_congestion_control(this_: &z_loaned_sample_t) -> z_co /// Returns ``true`` if sample is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_sample_check(this_: &z_owned_sample_t) -> bool { +pub extern "C" fn z_internal_sample_check(this_: &z_owned_sample_t) -> bool { this_.as_rust_type_ref().is_some() } @@ -211,7 +211,7 @@ pub extern "C" fn z_sample_drop(this_: &mut z_moved_sample_t) { /// Constructs sample in its gravestone state. #[no_mangle] -pub extern "C" fn z_sample_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_sample_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } @@ -526,7 +526,7 @@ pub extern "C" fn z_source_info_sn(this_: &z_loaned_source_info_t) -> u64 { #[cfg(feature = "unstable")] /// Returns ``true`` if source info is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_source_info_check(this_: &z_owned_source_info_t) -> bool { +pub extern "C" fn z_internal_source_info_check(this_: &z_owned_source_info_t) -> bool { this_.as_rust_type_ref().source_id.is_some() || this_.as_rust_type_ref().source_sn.is_some() } @@ -547,6 +547,6 @@ pub extern "C" fn z_source_info_drop(this_: &mut z_moved_source_info_t) { #[cfg(feature = "unstable")] /// Constructs source info in its gravestone state. #[no_mangle] -pub extern "C" fn z_source_info_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_source_info_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(SourceInfo::default()); } diff --git a/src/config.rs b/src/config.rs index 93e740b1a..a4d5d4a60 100644 --- a/src/config.rs +++ b/src/config.rs @@ -19,7 +19,7 @@ use zenoh::config::{Config, Locator, ValidatedMap, WhatAmI}; use crate::{ result::{self, z_result_t, Z_OK}, transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, - z_owned_string_t, z_string_copy_from_substr, z_string_null, + z_internal_string_null, z_owned_string_t, z_string_copy_from_substr, }; #[no_mangle] @@ -100,7 +100,7 @@ pub extern "C" fn z_config_default( /// Constructs config in its gravestone state. #[no_mangle] -pub extern "C" fn z_config_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_config_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } @@ -137,7 +137,7 @@ pub unsafe extern "C" fn zc_config_get_from_substr( ) -> result::z_result_t { let config = this.as_rust_type_ref(); if key.is_null() { - z_string_null(out_value_string); + z_internal_string_null(out_value_string); return result::Z_EINVAL; } @@ -145,7 +145,7 @@ pub unsafe extern "C" fn zc_config_get_from_substr( Ok(s) => s, Err(e) => { tracing::error!("Config key is not a valid utf-8 string: {}", e); - z_string_null(out_value_string); + z_internal_string_null(out_value_string); return result::Z_EINVAL; } }; @@ -161,7 +161,7 @@ pub unsafe extern "C" fn zc_config_get_from_substr( } None => { tracing::error!("No value was found in the config for key: '{}'", key); - z_string_null(out_value_string); + z_internal_string_null(out_value_string); result::Z_EUNAVAILABLE } } @@ -230,7 +230,7 @@ pub extern "C" fn z_config_drop(this_: &mut z_moved_config_t) { /// Returns ``true`` if config is valid, ``false`` if it is in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_config_check(this_: &z_owned_config_t) -> bool { +pub extern "C" fn z_internal_config_check(this_: &z_owned_config_t) -> bool { this_.as_rust_type_ref().is_some() } @@ -245,7 +245,7 @@ pub unsafe extern "C" fn zc_config_from_str( ) -> result::z_result_t { let mut res = result::Z_OK; if s.is_null() { - z_config_null(this); + z_internal_config_null(this); res = result::Z_EINVAL; } else { let conf_str = CStr::from_ptr(s); @@ -281,7 +281,7 @@ pub unsafe extern "C" fn zc_config_to_string( } Err(e) => { tracing::error!("Config is not a valid json5: {}", e); - z_string_null(out_config_string); + z_internal_string_null(out_config_string); result::Z_EPARSE } } @@ -380,7 +380,7 @@ pub unsafe extern "C" fn z_config_client( { locators } else { - z_config_null(this); + z_internal_config_null(this); return res; }; this.as_rust_type_mut_uninit() diff --git a/src/encoding.rs b/src/encoding.rs index 0481ed55e..7b8102af7 100644 --- a/src/encoding.rs +++ b/src/encoding.rs @@ -138,7 +138,7 @@ pub extern "C" fn z_encoding_loan_default() -> &'static z_loaned_encoding_t { /// Constructs a default `z_owned_encoding_t`. #[no_mangle] -pub extern "C" fn z_encoding_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_encoding_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(Encoding::default()); } @@ -150,7 +150,7 @@ pub extern "C" fn z_encoding_drop(this_: &mut z_moved_encoding_t) { /// Returns ``true`` if encoding is in non-default state, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_encoding_check(this_: &'static z_owned_encoding_t) -> bool { +pub extern "C" fn z_internal_encoding_check(this_: &'static z_owned_encoding_t) -> bool { *this_.as_rust_type_ref() != Encoding::default() } diff --git a/src/get.rs b/src/get.rs index f5a976b14..140301b6c 100644 --- a/src/get.rs +++ b/src/get.rs @@ -76,7 +76,7 @@ decl_c_type!( /// Constructs an empty `z_owned_reply_err_t`. #[no_mangle] -pub extern "C" fn z_reply_err_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_reply_err_null(this_: &mut MaybeUninit) { this_ .as_rust_type_mut_uninit() .write(ReplyErrorNewtype::default()); @@ -85,7 +85,7 @@ pub extern "C" fn z_reply_err_null(this_: &mut MaybeUninit) /// Returns ``true`` if reply error is in non-default state, ``false`` otherwise. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_reply_err_check(this_: &'static z_owned_reply_err_t) -> bool { +pub extern "C" fn z_internal_reply_err_check(this_: &'static z_owned_reply_err_t) -> bool { !this_.as_rust_type_ref().payload().is_empty() } @@ -170,7 +170,7 @@ pub unsafe extern "C" fn z_reply_replier_id( /// Constructs the reply in its gravestone state. #[no_mangle] -pub extern "C" fn z_reply_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_reply_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// Constructs an owned shallow copy of reply in provided uninitialized memory location. @@ -319,7 +319,7 @@ pub extern "C" fn z_reply_drop(this_: &mut z_moved_reply_t) { /// Returns ``true`` if `reply` is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_reply_check(this_: &z_owned_reply_t) -> bool { +pub extern "C" fn z_internal_reply_check(this_: &z_owned_reply_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/keyexpr.rs b/src/keyexpr.rs index e9aa62ee1..81906d6f1 100644 --- a/src/keyexpr.rs +++ b/src/keyexpr.rs @@ -38,7 +38,7 @@ decl_c_type! { /// Constructs an owned key expression in a gravestone state. #[no_mangle] -pub extern "C" fn z_keyexpr_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_keyexpr_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } @@ -153,7 +153,7 @@ pub extern "C" fn z_keyexpr_drop(this_: &mut z_moved_keyexpr_t) { /// Returns ``true`` if `keyexpr` is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_keyexpr_check(this_: &z_owned_keyexpr_t) -> bool { +pub extern "C" fn z_internal_keyexpr_check(this_: &z_owned_keyexpr_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/liveliness.rs b/src/liveliness.rs index 9bf168ab6..c13f19f66 100644 --- a/src/liveliness.rs +++ b/src/liveliness.rs @@ -34,13 +34,15 @@ decl_c_type!( /// Constructs liveliness token in its gravestone state. #[no_mangle] -pub extern "C" fn zc_liveliness_token_null(this_: &mut MaybeUninit) { +pub extern "C" fn zc_internal_liveliness_token_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if liveliness token is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn zc_liveliness_token_check(this_: &zc_owned_liveliness_token_t) -> bool { +pub extern "C" fn zc_internal_liveliness_token_check(this_: &zc_owned_liveliness_token_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/payload.rs b/src/payload.rs index f1581b8a6..3a0e092f5 100644 --- a/src/payload.rs +++ b/src/payload.rs @@ -45,7 +45,7 @@ decl_c_type! { /// The gravestone value for `z_owned_bytes_t`. #[no_mangle] -extern "C" fn z_bytes_null(this: &mut MaybeUninit) { +extern "C" fn z_internal_bytes_null(this: &mut MaybeUninit) { this.as_rust_type_mut_uninit().write(ZBytes::default()); } @@ -64,7 +64,7 @@ extern "C" fn z_bytes_drop(this_: &mut z_moved_bytes_t) { /// Returns ``true`` if `this_` is in a valid state, ``false`` if it is in a gravestone state. #[no_mangle] -extern "C" fn z_bytes_check(this: &z_owned_bytes_t) -> bool { +extern "C" fn z_internal_bytes_check(this: &z_owned_bytes_t) -> bool { !this.as_rust_type_ref().is_empty() } diff --git a/src/platform/synchronization.rs b/src/platform/synchronization.rs index 871e94509..d01904133 100644 --- a/src/platform/synchronization.rs +++ b/src/platform/synchronization.rs @@ -36,13 +36,13 @@ pub extern "C" fn z_mutex_drop(this_: &mut z_moved_mutex_t) { /// Returns ``true`` if mutex is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_mutex_check(this_: &z_owned_mutex_t) -> bool { +pub extern "C" fn z_internal_mutex_check(this_: &z_owned_mutex_t) -> bool { this_.as_rust_type_ref().is_some() } /// Constructs mutex in a gravestone state. #[no_mangle] -pub extern "C" fn z_mutex_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_mutex_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } @@ -122,7 +122,7 @@ pub extern "C" fn z_condvar_init(this_: &mut MaybeUninit) { /// Constructs conditional variable in a gravestone state. #[no_mangle] -pub extern "C" fn z_condvar_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_condvar_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } @@ -134,7 +134,7 @@ pub extern "C" fn z_condvar_drop(this_: &mut z_moved_condvar_t) { /// Returns ``true`` if conditional variable is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_condvar_check(this_: &z_owned_condvar_t) -> bool { +pub extern "C" fn z_internal_condvar_check(this_: &z_owned_condvar_t) -> bool { this_.as_rust_type_ref().is_some() } @@ -207,7 +207,7 @@ pub struct z_task_attr_t(usize); /// Constructs task in a gravestone state. #[no_mangle] -pub extern "C" fn z_task_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_task_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } @@ -237,7 +237,7 @@ pub extern "C" fn z_task_drop(this_: &mut z_moved_task_t) { /// Returns ``true`` if task is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_task_check(this_: &z_owned_task_t) -> bool { +pub extern "C" fn z_internal_task_check(this_: &z_owned_task_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/publication_cache.rs b/src/publication_cache.rs index 5bd71991b..b76864187 100644 --- a/src/publication_cache.rs +++ b/src/publication_cache.rs @@ -118,14 +118,18 @@ pub extern "C" fn ze_declare_publication_cache( /// Constructs a publication cache in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn ze_publication_cache_null(this_: &mut MaybeUninit) { +pub extern "C" fn ze_internal_publication_cache_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if publication cache is valid, ``false`` otherwise. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn ze_publication_cache_check(this_: &ze_owned_publication_cache_t) -> bool { +pub extern "C" fn ze_internal_publication_cache_check( + this_: &ze_owned_publication_cache_t, +) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/publisher.rs b/src/publisher.rs index 22240e773..47970642f 100644 --- a/src/publisher.rs +++ b/src/publisher.rs @@ -125,14 +125,14 @@ pub extern "C" fn z_declare_publisher( /// Constructs a publisher in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_publisher_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_publisher_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if publisher is valid, ``false`` otherwise. #[allow(clippy::missing_safety_doc)] #[no_mangle] -pub extern "C" fn z_publisher_check(this_: &z_owned_publisher_t) -> bool { +pub extern "C" fn z_internal_publisher_check(this_: &z_owned_publisher_t) -> bool { this_.as_rust_type_ref().is_some() } @@ -298,14 +298,18 @@ decl_c_type!( /// Constructs an empty matching listener #[no_mangle] #[cfg(feature = "unstable")] -pub extern "C" fn zc_matching_listener_null(this_: &mut MaybeUninit) { +pub extern "C" fn zc_internal_matching_listener_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Checks the matching listener is for the gravestone state #[no_mangle] #[cfg(feature = "unstable")] -pub extern "C" fn zc_matching_listener_check(this_: &zc_owned_matching_listener_t) -> bool { +pub extern "C" fn zc_internal_matching_listener_check( + this_: &zc_owned_matching_listener_t, +) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/queryable.rs b/src/queryable.rs index 707f735a2..9ad70825c 100644 --- a/src/queryable.rs +++ b/src/queryable.rs @@ -40,7 +40,7 @@ decl_c_type!( /// Constructs a queryable in its gravestone value. #[no_mangle] -pub extern "C" fn z_queryable_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_queryable_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } @@ -63,12 +63,12 @@ decl_c_type!( /// Constructs query in its gravestone value. #[no_mangle] -pub extern "C" fn z_query_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_query_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// Returns `false` if `this` is in a gravestone state, `true` otherwise. #[no_mangle] -pub extern "C" fn z_query_check(query: &z_owned_query_t) -> bool { +pub extern "C" fn z_internal_query_check(query: &z_owned_query_t) -> bool { query.as_rust_type_ref().is_some() } /// Borrows the query. @@ -273,7 +273,7 @@ pub extern "C" fn z_queryable_drop(this_: &mut z_moved_queryable_t) { /// Returns ``true`` if queryable is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_queryable_check(this_: &z_owned_queryable_t) -> bool { +pub extern "C" fn z_internal_queryable_check(this_: &z_owned_queryable_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/querying_subscriber.rs b/src/querying_subscriber.rs index 2c64da470..2b76bd359 100644 --- a/src/querying_subscriber.rs +++ b/src/querying_subscriber.rs @@ -44,7 +44,7 @@ decl_c_type!( /// Constructs a querying subscriber in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn ze_querying_subscriber_null( +pub extern "C" fn ze_internal_querying_subscriber_null( this: &mut MaybeUninit, ) { this.as_rust_type_mut_uninit().write(None); @@ -231,7 +231,9 @@ pub extern "C" fn ze_querying_subscriber_drop(this_: &mut ze_moved_querying_subs /// Returns ``true`` if querying subscriber is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn ze_querying_subscriber_check(this_: &ze_owned_querying_subscriber_t) -> bool { +pub extern "C" fn ze_internal_querying_subscriber_check( + this_: &ze_owned_querying_subscriber_t, +) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/scouting.rs b/src/scouting.rs index d8cc48069..a5f524437 100644 --- a/src/scouting.rs +++ b/src/scouting.rs @@ -53,13 +53,13 @@ pub unsafe extern "C" fn z_hello_loan(this_: &z_owned_hello_t) -> &z_loaned_hell /// Returns ``true`` if `hello message` is valid, ``false`` if it is in a gravestone state. #[no_mangle] -pub extern "C" fn z_hello_check(this_: &z_owned_hello_t) -> bool { +pub extern "C" fn z_internal_hello_check(this_: &z_owned_hello_t) -> bool { this_.as_rust_type_ref().is_some() } /// Constructs hello message in a gravestone state. #[no_mangle] -pub extern "C" fn z_hello_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_hello_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } diff --git a/src/session.rs b/src/session.rs index 01c1547c9..e70af592a 100644 --- a/src/session.rs +++ b/src/session.rs @@ -43,7 +43,7 @@ pub unsafe extern "C" fn z_session_loan(this_: &z_owned_session_t) -> &z_loaned_ /// Constructs a Zenoh session in its gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_session_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_session_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } @@ -117,7 +117,7 @@ pub extern "C" fn z_open_with_custom_shm_clients( /// Returns ``true`` if `session` is valid, ``false`` otherwise. #[allow(clippy::missing_safety_doc)] #[no_mangle] -pub extern "C" fn z_session_check(this_: &z_owned_session_t) -> bool { +pub extern "C" fn z_internal_session_check(this_: &z_owned_session_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/shm/buffer/zshm.rs b/src/shm/buffer/zshm.rs index 1b29e0be7..1b401854c 100644 --- a/src/shm/buffer/zshm.rs +++ b/src/shm/buffer/zshm.rs @@ -41,13 +41,13 @@ pub extern "C" fn z_shm_from_mut( /// Constructs ZShm slice in its gravestone value. #[no_mangle] -pub extern "C" fn z_shm_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_shm_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_shm_check(this_: &z_owned_shm_t) -> bool { +pub extern "C" fn z_internal_shm_check(this_: &z_owned_shm_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/shm/buffer/zshmmut.rs b/src/shm/buffer/zshmmut.rs index 67e46e1cc..f901ad607 100644 --- a/src/shm/buffer/zshmmut.rs +++ b/src/shm/buffer/zshmmut.rs @@ -44,13 +44,13 @@ pub extern "C" fn z_shm_mut_try_from_immut( /// Constructs ZShmMut slice in its gravestone value. #[no_mangle] -pub extern "C" fn z_shm_mut_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_shm_mut_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_shm_mut_check(this_: &z_owned_shm_mut_t) -> bool { +pub extern "C" fn z_internal_shm_mut_check(this_: &z_owned_shm_mut_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/shm/client/shm_client.rs b/src/shm/client/shm_client.rs index fa41152e8..2446ddab2 100644 --- a/src/shm/client/shm_client.rs +++ b/src/shm/client/shm_client.rs @@ -80,13 +80,13 @@ pub extern "C" fn z_shm_client_new( /// Constructs SHM client in its gravestone value. #[no_mangle] -pub extern "C" fn z_shm_client_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_shm_client_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_shm_client_check(this_: &z_owned_shm_client_t) -> bool { +pub extern "C" fn z_internal_shm_client_check(this_: &z_owned_shm_client_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/shm/client_storage/mod.rs b/src/shm/client_storage/mod.rs index 173a5fcce..b4efd99bd 100644 --- a/src/shm/client_storage/mod.rs +++ b/src/shm/client_storage/mod.rs @@ -39,13 +39,15 @@ pub extern "C" fn zc_shm_client_list_new(this_: &mut MaybeUninit) { +pub extern "C" fn zc_internal_shm_client_list_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn zc_shm_client_list_check(this_: &zc_owned_shm_client_list_t) -> bool { +pub extern "C" fn zc_internal_shm_client_list_check(this_: &zc_owned_shm_client_list_t) -> bool { this_.as_rust_type_ref().is_some() } @@ -150,13 +152,17 @@ pub extern "C" fn z_shm_client_storage_clone( /// Constructs SHM Client Storage in its gravestone value. #[no_mangle] -pub extern "C" fn z_shm_client_storage_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_shm_client_storage_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_shm_client_storage_check(this_: &z_owned_shm_client_storage_t) -> bool { +pub extern "C" fn z_internal_shm_client_storage_check( + this_: &z_owned_shm_client_storage_t, +) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/shm/provider/alloc_layout.rs b/src/shm/provider/alloc_layout.rs index 8af9b32d1..d18a1c864 100644 --- a/src/shm/provider/alloc_layout.rs +++ b/src/shm/provider/alloc_layout.rs @@ -63,13 +63,13 @@ pub extern "C" fn z_alloc_layout_new( /// Constructs Alloc Layout in its gravestone value. #[no_mangle] -pub extern "C" fn z_alloc_layout_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_alloc_layout_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_alloc_layout_check(this_: &z_owned_alloc_layout_t) -> bool { +pub extern "C" fn z_internal_alloc_layout_check(this_: &z_owned_alloc_layout_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/shm/provider/shm_provider.rs b/src/shm/provider/shm_provider.rs index 2ef046c49..d93ddae1a 100644 --- a/src/shm/provider/shm_provider.rs +++ b/src/shm/provider/shm_provider.rs @@ -92,13 +92,13 @@ pub extern "C" fn z_shm_provider_threadsafe_new( /// Constructs SHM Provider in its gravestone value. #[no_mangle] -pub extern "C" fn z_shm_provider_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_shm_provider_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_shm_provider_check(this_: &z_owned_shm_provider_t) -> bool { +pub extern "C" fn z_internal_shm_provider_check(this_: &z_owned_shm_provider_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/shm/provider/types.rs b/src/shm/provider/types.rs index 8eedd5c23..ae0b63c4f 100644 --- a/src/shm/provider/types.rs +++ b/src/shm/provider/types.rs @@ -25,7 +25,7 @@ use zenoh::{ use super::chunk::z_allocated_chunk_t; use crate::{ result::{z_result_t, Z_EINVAL, Z_OK}, - shm::buffer::zshmmut::z_shm_mut_null, + shm::buffer::zshmmut::z_internal_shm_mut_null, transmute::{IntoCType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_loaned_chunk_alloc_result_t, z_loaned_memory_layout_t, z_moved_chunk_alloc_result_t, z_moved_memory_layout_t, z_owned_chunk_alloc_result_t, z_owned_memory_layout_t, @@ -145,13 +145,13 @@ fn create_memory_layout( /// Constructs Memory Layout in its gravestone value. #[no_mangle] -pub extern "C" fn z_memory_layout_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_memory_layout_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_memory_layout_check(this_: &z_owned_memory_layout_t) -> bool { +pub extern "C" fn z_internal_memory_layout_check(this_: &z_owned_memory_layout_t) -> bool { this_.as_rust_type_ref().is_some() } @@ -217,13 +217,17 @@ pub extern "C" fn z_chunk_alloc_result_new_error( /// Constructs Chunk Alloc Result in its gravestone value. #[no_mangle] -pub extern "C" fn z_chunk_alloc_result_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_chunk_alloc_result_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_chunk_alloc_result_check(this_: &z_owned_chunk_alloc_result_t) -> bool { +pub extern "C" fn z_internal_chunk_alloc_result_check( + this_: &z_owned_chunk_alloc_result_t, +) -> bool { this_.as_rust_type_ref().is_some() } @@ -264,7 +268,7 @@ impl From for z_buf_alloc_result_t { } } Err(error) => { - z_shm_mut_null(&mut buf); + z_internal_shm_mut_null(&mut buf); Self { // SAFETY: this is safe because buf is gravestone-initialized above buf: unsafe { buf.assume_init() }, @@ -298,7 +302,7 @@ impl From for z_buf_layout_alloc_result_t { } } Err(error) => { - z_shm_mut_null(&mut buf); + z_internal_shm_mut_null(&mut buf); match error { zenoh::shm::ZLayoutAllocError::Alloc(alloc) => { Self { diff --git a/src/subscriber.rs b/src/subscriber.rs index 6bd43eb44..636424843 100644 --- a/src/subscriber.rs +++ b/src/subscriber.rs @@ -66,7 +66,7 @@ decl_c_type!( /// Constructs a subscriber in a gravestone state. #[no_mangle] -pub extern "C" fn z_subscriber_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_subscriber_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } @@ -174,6 +174,6 @@ pub extern "C" fn z_subscriber_drop(this_: &mut z_moved_subscriber_t) { /// Returns ``true`` if subscriber is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_subscriber_check(this_: &z_owned_subscriber_t) -> bool { +pub extern "C" fn z_internal_subscriber_check(this_: &z_owned_subscriber_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/tests/z_api_alignment_test.c b/tests/z_api_alignment_test.c index c235a13ef..dee3aaac3 100644 --- a/tests/z_api_alignment_test.c +++ b/tests/z_api_alignment_test.c @@ -163,7 +163,7 @@ int main(int argc, char **argv) { z_owned_config_t _ret_config; z_config_default(&_ret_config); - assert(z_check(_ret_config)); + assert(z_internal_check(_ret_config)); z_drop(z_move(_ret_config)); #ifdef ZENOH_PICO _ret_int8 = zp_config_insert(z_loan(_ret_config), Z_CONFIG_PEER_KEY, z_string_make(argv[1])); @@ -176,7 +176,7 @@ int main(int argc, char **argv) { #ifdef ZENOH_PICO z_owned_scouting_config_t _ret_sconfig; z_scouting_config_default(&_ret_sconfig); - assert(z_check(_ret_sconfig)); + assert(z_internal_check(_ret_sconfig)); _ret_int8 = zp_scouting_config_insert(z_loan(_ret_sconfig), Z_CONFIG_SCOUTING_TIMEOUT_KEY, z_string_make(SCOUTING_TIMEOUT)); assert(_ret_int8 == 0); @@ -199,7 +199,7 @@ int main(int argc, char **argv) { z_owned_session_t s1; assert(0 == z_open(&s1, z_move(_ret_config))); - assert(z_check(s1)); + assert(z_internal_check(s1)); #ifdef UNSTABLE z_id_t _ret_zid = z_info_zid(z_loan(s1)); @@ -244,7 +244,7 @@ int main(int argc, char **argv) { z_owned_session_t s2; assert(0 == z_open(&s2, z_move(_ret_config))); - assert(z_check(s2)); + assert(z_internal_check(s2)); #ifdef UNSTABLE _ret_zid = z_info_zid(z_loan(s2)); @@ -272,7 +272,7 @@ int main(int argc, char **argv) { z_view_keyexpr_from_str(&ke, keyexpr_str); z_owned_subscriber_t _ret_sub; z_declare_subscriber(&_ret_sub, z_loan(s2), z_loan(ke), z_move(_ret_closure_sample), &_ret_sub_opt); - assert(z_check(_ret_sub)); + assert(z_internal_check(_ret_sub)); z_sleep_s(SLEEP); @@ -282,7 +282,7 @@ int main(int argc, char **argv) { z_view_keyexpr_from_str(&s1_key, s1_res); z_owned_keyexpr_t _ret_expr; z_declare_keyexpr(&_ret_expr, z_loan(s1), z_loan(s1_key)); - assert(z_check(_ret_expr)); + assert(z_internal_check(_ret_expr)); z_put_options_t _ret_put_opt; z_put_options_default(&_ret_put_opt); _ret_put_opt.congestion_control = Z_CONGESTION_CONTROL_BLOCK; @@ -306,7 +306,7 @@ int main(int argc, char **argv) { _ret_int8 = z_undeclare_keyexpr(z_move(_ret_expr), z_loan(s1)); assert(_ret_int8 == 0); - assert(!z_check(_ret_expr)); + assert(!z_internal_check(_ret_expr)); _ret_int8 = z_undeclare_subscriber(z_move(_ret_sub)); assert(_ret_int8 == 0); @@ -319,7 +319,7 @@ int main(int argc, char **argv) { z_queryable_options_default(&_ret_qle_opt); z_owned_queryable_t qle; z_declare_queryable(&qle, z_loan(s1), z_loan(s1_key), z_move(_ret_closure_query), &_ret_qle_opt); - assert(z_check(qle)); + assert(z_internal_check(qle)); z_sleep_s(SLEEP); diff --git a/tests/z_api_double_drop_test.c b/tests/z_api_double_drop_test.c index 089aff593..9fa82c40c 100644 --- a/tests/z_api_double_drop_test.c +++ b/tests/z_api_double_drop_test.c @@ -25,14 +25,14 @@ void test_session() { z_owned_config_t config; z_config_default(&config); - assert(z_check(config)); + assert(z_internal_check(config)); z_owned_session_t session; z_open(&session, z_move(config)); - assert(z_check(session)); + assert(z_internal_check(session)); z_close(z_move(session)); - assert(!z_check(session)); + assert(!z_internal_check(session)); z_close(z_move(session)); - assert(!z_check(session)); + assert(!z_internal_check(session)); } void test_publisher() { @@ -46,11 +46,11 @@ void test_publisher() { z_owned_publisher_t pub; z_declare_publisher(&pub, z_loan(s), z_loan(keyexpr), NULL); - assert(z_check(pub)); + assert(z_internal_check(pub)); z_undeclare_publisher(z_move(pub)); - assert(!z_check(pub)); + assert(!z_internal_check(pub)); z_undeclare_publisher(z_move(pub)); - assert(!z_check(pub)); + assert(!z_internal_check(pub)); z_close(z_move(s)); } @@ -58,21 +58,21 @@ void test_keyexpr() { z_owned_keyexpr_t keyexpr; z_keyexpr_from_str(&keyexpr, URL); - assert(z_check(keyexpr)); + assert(z_internal_check(keyexpr)); z_drop(z_move(keyexpr)); - assert(!z_check(keyexpr)); + assert(!z_internal_check(keyexpr)); z_drop(z_move(keyexpr)); - assert(!z_check(keyexpr)); + assert(!z_internal_check(keyexpr)); } void test_config() { z_owned_config_t config; z_config_default(&config); - assert(z_check(config)); + assert(z_internal_check(config)); z_drop(z_move(config)); - assert(!z_check(config)); + assert(!z_internal_check(config)); z_drop(z_move(config)); - assert(!z_check(config)); + assert(!z_internal_check(config)); } void data_handler(const z_loaned_sample_t *sample, void *arg) {} @@ -89,11 +89,11 @@ void test_subscriber() { z_view_keyexpr_from_str(&keyexpr, URL); z_owned_subscriber_t sub; z_declare_subscriber(&sub, z_loan(s), z_loan(keyexpr), z_move(callback), NULL); - assert(z_check(sub)); + assert(z_internal_check(sub)); z_undeclare_subscriber(z_move(sub)); - assert(!z_check(sub)); + assert(!z_internal_check(sub)); z_undeclare_subscriber(z_move(sub)); - assert(!z_check(sub)); + assert(!z_internal_check(sub)); z_close(z_move(s)); } @@ -111,11 +111,11 @@ void test_queryable() { z_view_keyexpr_from_str(&keyexpr, URL); z_owned_queryable_t queryable; z_declare_queryable(&queryable, z_loan(s), z_loan(keyexpr), z_move(callback), NULL); - assert(z_check(queryable)); + assert(z_internal_check(queryable)); z_undeclare_queryable(z_move(queryable)); - assert(!z_check(queryable)); + assert(!z_internal_check(queryable)); z_undeclare_queryable(z_move(queryable)); - assert(!z_check(queryable)); + assert(!z_internal_check(queryable)); z_close(z_move(s)); } diff --git a/tests/z_api_drop_options.c b/tests/z_api_drop_options.c index 845c79d45..b8ce3bd9d 100644 --- a/tests/z_api_drop_options.c +++ b/tests/z_api_drop_options.c @@ -40,8 +40,8 @@ void put() { opts.attachment = z_move(attachment); z_bytes_serialize_from_int32(&payload, 16); z_put(z_loan(s), z_loan(ke), z_move(payload), &opts); - assert(!z_check(payload)); - assert(!z_check(attachment)); + assert(!z_internal_check(payload)); + assert(!z_internal_check(attachment)); z_close(z_move(s)); } @@ -68,8 +68,8 @@ void get() { z_closure(&closure, cb, drop, NULL); z_get(z_loan(s), z_loan(ke), "", z_move(closure), &opts); - assert(!z_check(payload)); - assert(!z_check(attachment)); + assert(!z_internal_check(payload)); + assert(!z_internal_check(attachment)); z_close(z_move(s)); } diff --git a/tests/z_api_encoding_test.c b/tests/z_api_encoding_test.c index e2091f291..3630899b2 100644 --- a/tests/z_api_encoding_test.c +++ b/tests/z_api_encoding_test.c @@ -10,15 +10,15 @@ void test_null_encoding(void) { z_owned_encoding_t e; - z_encoding_null(&e); - assert(!z_encoding_check(&e)); + z_internal_encoding_null(&e); + assert(!z_internal_encoding_check(&e)); z_encoding_drop(z_move(e)); } void test_encoding_without_id(void) { z_owned_encoding_t e1; z_encoding_from_str(&e1, "my_encoding"); - assert(z_encoding_check(&e1)); + assert(z_internal_encoding_check(&e1)); z_owned_string_t s; z_encoding_to_string(z_encoding_loan(&e1), &s); assert(strncmp("zenoh/bytes;my_encoding", z_string_data(z_string_loan(&s)), z_string_len(z_string_loan(&s))) == 0); @@ -27,7 +27,7 @@ void test_encoding_without_id(void) { z_owned_encoding_t e2; z_encoding_from_substr(&e2, "my_encoding", 4); - assert(z_encoding_check(&e2)); + assert(z_internal_encoding_check(&e2)); z_encoding_to_string(z_encoding_loan(&e2), &s); assert(strncmp("zenoh/bytes;my_e", z_string_data(z_string_loan(&s)), z_string_len(z_string_loan(&s))) == 0); @@ -38,7 +38,7 @@ void test_encoding_without_id(void) { void test_encoding_with_id(void) { z_owned_encoding_t e1; z_encoding_from_str(&e1, "zenoh/string;utf8"); - assert(z_encoding_check(&e1)); + assert(z_internal_encoding_check(&e1)); z_owned_string_t s; z_encoding_to_string(z_encoding_loan(&e1), &s); assert(strncmp("zenoh/string;utf8", z_string_data(z_string_loan(&s)), z_string_len(z_string_loan(&s))) == 0); @@ -47,7 +47,7 @@ void test_encoding_with_id(void) { z_owned_encoding_t e2; z_encoding_from_substr(&e2, "zenoh/string;utf8", 15); - assert(z_encoding_check(&e2)); + assert(z_internal_encoding_check(&e2)); z_encoding_to_string(z_encoding_loan(&e2), &s); assert(strncmp("zenoh/string;utf8", z_string_data(z_string_loan(&s)), z_string_len(z_string_loan(&s))) == 0); @@ -56,7 +56,7 @@ void test_encoding_with_id(void) { z_owned_encoding_t e3; z_encoding_from_str(&e3, "custom_id;custom_schema"); - assert(z_encoding_check(&e3)); + assert(z_internal_encoding_check(&e3)); z_encoding_to_string(z_encoding_loan(&e3), &s); assert(strncmp("zenoh/bytes;custom_id;custom_schema", z_string_data(z_string_loan(&s)), @@ -66,7 +66,7 @@ void test_encoding_with_id(void) { z_owned_encoding_t e4; z_encoding_from_substr(&e4, "custom_id;custom_schema", 16); - assert(z_encoding_check(&e4)); + assert(z_internal_encoding_check(&e4)); z_encoding_to_string(z_encoding_loan(&e4), &s); assert(strncmp("zenoh/bytes;custom_id;custom", z_string_data(z_string_loan(&s)), z_string_len(z_string_loan(&s))) == @@ -77,7 +77,7 @@ void test_encoding_with_id(void) { void test_with_schema(void) { z_owned_encoding_t e; - z_encoding_null(&e); + z_internal_encoding_null(&e); z_encoding_set_schema_from_str(z_encoding_loan_mut(&e), "my_schema"); z_owned_string_t s; diff --git a/tests/z_api_keyexpr_drop_test.c b/tests/z_api_keyexpr_drop_test.c index 1623ec110..a24eb68ee 100644 --- a/tests/z_api_keyexpr_drop_test.c +++ b/tests/z_api_keyexpr_drop_test.c @@ -25,7 +25,7 @@ void test_publisher() { z_config_default(&config); z_owned_session_t s; z_open(&s, z_move(config)); - assert(z_check(s)); + assert(z_internal_check(s)); char keyexpr[256]; strncpy(keyexpr, "foo/bar", 256); z_view_keyexpr_t ke; diff --git a/tests/z_api_keyexpr_test.c b/tests/z_api_keyexpr_test.c index bc47f0390..f6f61004e 100644 --- a/tests/z_api_keyexpr_test.c +++ b/tests/z_api_keyexpr_test.c @@ -92,9 +92,9 @@ void undeclare() { z_view_keyexpr_from_str(&view_ke, "test/thr"); z_owned_keyexpr_t ke; z_declare_keyexpr(&ke, z_loan(s), z_loan(view_ke)); - assert(z_keyexpr_check(&ke)); + assert(z_internal_keyexpr_check(&ke)); z_undeclare_keyexpr(z_move(ke), z_loan(s)); - assert(!z_keyexpr_check(&ke)); + assert(!z_internal_keyexpr_check(&ke)); } #if defined(UNSTABLE) diff --git a/tests/z_api_null_drop_test.c b/tests/z_api_null_drop_test.c index 0090c7a22..97cbe23eb 100644 --- a/tests/z_api_null_drop_test.c +++ b/tests/z_api_null_drop_test.c @@ -30,19 +30,19 @@ // set v1 to null // move v to v1 // make sure that v is null now -#define TEST(name) \ - { \ - z_owned_##name##_t v; \ - memset(&v, -1, sizeof(v)); \ - z_null(&v); \ - assert(!z_check(v)); \ - z_drop(z_move(v)); \ - z_drop(z_move(v)); \ - z_owned_##name##_t v1; \ - z_null(&v1); \ - memset(&v, -1, sizeof(v)); \ - z_take(&v1, z_move(v)); \ - assert(!z_check(v)); \ +#define TEST(name) \ + { \ + z_owned_##name##_t v; \ + memset(&v, -1, sizeof(v)); \ + z_internal_null(&v); \ + assert(!z_internal_check(v)); \ + z_drop(z_move(v)); \ + z_drop(z_move(v)); \ + z_owned_##name##_t v1; \ + z_internal_null(&v1); \ + memset(&v, -1, sizeof(v)); \ + z_take(&v1, z_move(v)); \ + assert(!z_internal_check(v)); \ } int main(void) { diff --git a/tests/z_api_unitinialized_check.c b/tests/z_api_unitinialized_check.c index c27b14078..8ffa75117 100644 --- a/tests/z_api_unitinialized_check.c +++ b/tests/z_api_unitinialized_check.c @@ -24,9 +24,9 @@ int main(int argc, char **argv) { z_owned_keyexpr_t owned_keyexpr; assert(z_keyexpr_from_str(&owned_keyexpr, NULL) == Z_EINVAL); - assert(!z_check(owned_keyexpr)); + assert(!z_internal_check(owned_keyexpr)); assert(z_keyexpr_from_str_autocanonize(&owned_keyexpr, NULL) == Z_EINVAL); - assert(!z_check(owned_keyexpr)); + assert(!z_internal_check(owned_keyexpr)); assert(z_keyexpr_canonize_null_terminated(NULL) == Z_EINVAL);