From adf74a0daf5645f1e6f4509d9cd78d85d78280a9 Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Mon, 19 Aug 2024 17:13:39 +0200 Subject: [PATCH] added underscore to _z_null and _z_check --- build.rs | 16 +- include/zenoh_commons.h | 1002 +++++++++++++++--------------- include/zenoh_macros.h | 244 ++++---- src/closures/hello_closure.rs | 4 +- src/closures/log_closure.rs | 4 +- src/closures/query_channel.rs | 8 +- src/closures/query_closure.rs | 4 +- src/closures/reply_closure.rs | 4 +- src/closures/response_channel.rs | 8 +- src/closures/sample_channel.rs | 8 +- src/closures/sample_closure.rs | 4 +- src/closures/zenohid_closure.rs | 4 +- 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/payload.rs | 4 +- src/platform/synchronization.rs | 12 +- src/publisher.rs | 4 +- src/queryable.rs | 8 +- 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 | 4 +- src/shm/provider/alloc_layout.rs | 4 +- src/shm/provider/shm_provider.rs | 4 +- src/shm/provider/types.rs | 8 +- src/subscriber.rs | 4 +- 32 files changed, 718 insertions(+), 718 deletions(-) diff --git a/build.rs b/build.rs index 98f558a70..715f2c0a4 100644 --- a/build.rs +++ b/build.rs @@ -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" (_\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 (_\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, @@ -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_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_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_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_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..e5d3f5918 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -266,97 +266,6 @@ typedef enum zc_reply_keyexpr_t { ZC_REPLY_KEYEXPR_MATCHING_QUERY = 1, } zc_reply_keyexpr_t; #endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_buf_alloc_result_t { - z_owned_shm_mut_t buf; - enum z_alloc_error_t error; -} z_buf_alloc_result_t; -#endif -typedef int8_t z_result_t; -/** - * An AllocAlignment. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_alloc_alignment_t { - uint8_t pow; -} z_alloc_alignment_t; -#endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_threadsafe_context_data_t { - void *ptr; -} zc_threadsafe_context_data_t; -#endif -/** - * A tread-safe droppable context. - * Contexts are idiomatically used in C together with callback interfaces to deliver associated state - * information to each callback. - * - * This is a thread-safe context - the associated callbacks may be executed concurrently with the same - * zc_context_t instance. In other words, all the callbacks associated with this context data MUST be - * thread-safe. - * - * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted.The - * delete_fn is guaranteed to be executed only once at some point of time after the last associated - * callback call returns. - * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't - * be executed. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_threadsafe_context_t { - struct zc_threadsafe_context_data_t context; - void (*delete_fn)(void*); -} zc_threadsafe_context_t; -#endif -typedef struct z_moved_bytes_t { - struct z_owned_bytes_t _this; -} z_moved_bytes_t; -typedef struct z_moved_slice_t { - struct z_owned_slice_t _this; -} z_moved_slice_t; -typedef struct z_moved_string_t { - struct z_owned_string_t _this; -} z_moved_string_t; -/** - * Unique segment identifier - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef uint32_t z_segment_id_t; -#endif -/** - * Chunk id within it's segment - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef uint32_t z_chunk_id_t; -#endif -/** - * A ChunkDescriptor - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_chunk_descriptor_t { - z_segment_id_t segment; - z_chunk_id_t chunk; - size_t len; -} z_chunk_descriptor_t; -#endif -/** - * An AllocatedChunk - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_allocated_chunk_t { - struct z_chunk_descriptor_t descriptpr; - void *data; -} z_allocated_chunk_t; -#endif -/** - * Monotonic clock - */ -typedef struct z_clock_t { - uint64_t t; - const void *t_base; -} z_clock_t; -typedef struct z_moved_session_t { - struct z_owned_session_t _this; -} z_moved_session_t; /** * A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: * @@ -382,12 +291,6 @@ typedef struct z_owned_closure_hello_t { */ void (*drop)(void *context); } z_owned_closure_hello_t; -/** - * Moved closure. - */ -typedef struct z_moved_closure_hello_t { - struct z_owned_closure_hello_t _this; -} z_moved_closure_hello_t; /** * A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: * @@ -412,12 +315,6 @@ typedef struct z_owned_closure_query_t { */ void (*drop)(void *context); } z_owned_closure_query_t; -/** - * Moved closure. - */ -typedef struct z_moved_closure_query_t { - struct z_owned_closure_query_t _this; -} z_moved_closure_query_t; /** * A structure that contains all the elements for stateful, memory-leak-free callbacks. * @@ -442,12 +339,6 @@ typedef struct z_owned_closure_reply_t { */ void (*drop)(void *context); } z_owned_closure_reply_t; -/** - * Moved closure. - */ -typedef struct z_moved_closure_reply_t { - struct z_owned_closure_reply_t _this; -} z_moved_closure_reply_t; /** * A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks. * @@ -472,12 +363,6 @@ typedef struct z_owned_closure_sample_t { */ void (*drop)(void *context); } z_owned_closure_sample_t; -/** - * Moved closure. - */ -typedef struct z_moved_closure_sample_t { - struct z_owned_closure_sample_t _this; -} z_moved_closure_sample_t; /** * A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: * @@ -504,6 +389,145 @@ typedef struct z_owned_closure_zid_t { void (*drop)(void *context); } z_owned_closure_zid_t; #endif +/** + * A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: + * + * Closures are not guaranteed not to be called concurrently. + * + * It is guaranteed that: + * - `call` will never be called once `drop` has started. + * - `drop` will only be called **once**, and **after every** `call` has ended. + * - The two previous guarantees imply that `call` and `drop` are never called concurrently. + */ +typedef struct zc_owned_closure_log_t { + /** + * An optional pointer to a closure state. + */ + void *context; + /** + * A closure body. + */ + void (*call)(enum zc_log_severity_t severity, const struct z_loaned_string_t *msg, void *context); + /** + * An optional drop function that will be called when the closure is dropped. + */ + void (*drop)(void *context); +} zc_owned_closure_log_t; +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_buf_alloc_result_t { + z_owned_shm_mut_t buf; + enum z_alloc_error_t error; +} z_buf_alloc_result_t; +#endif +typedef int8_t z_result_t; +/** + * An AllocAlignment. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_alloc_alignment_t { + uint8_t pow; +} z_alloc_alignment_t; +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_threadsafe_context_data_t { + void *ptr; +} zc_threadsafe_context_data_t; +#endif +/** + * A tread-safe droppable context. + * Contexts are idiomatically used in C together with callback interfaces to deliver associated state + * information to each callback. + * + * This is a thread-safe context - the associated callbacks may be executed concurrently with the same + * zc_context_t instance. In other words, all the callbacks associated with this context data MUST be + * thread-safe. + * + * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted.The + * delete_fn is guaranteed to be executed only once at some point of time after the last associated + * callback call returns. + * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't + * be executed. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_threadsafe_context_t { + struct zc_threadsafe_context_data_t context; + void (*delete_fn)(void*); +} zc_threadsafe_context_t; +#endif +typedef struct z_moved_bytes_t { + struct z_owned_bytes_t _this; +} z_moved_bytes_t; +typedef struct z_moved_slice_t { + struct z_owned_slice_t _this; +} z_moved_slice_t; +typedef struct z_moved_string_t { + struct z_owned_string_t _this; +} z_moved_string_t; +/** + * Unique segment identifier + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef uint32_t z_segment_id_t; +#endif +/** + * Chunk id within it's segment + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef uint32_t z_chunk_id_t; +#endif +/** + * A ChunkDescriptor + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_chunk_descriptor_t { + z_segment_id_t segment; + z_chunk_id_t chunk; + size_t len; +} z_chunk_descriptor_t; +#endif +/** + * An AllocatedChunk + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_allocated_chunk_t { + struct z_chunk_descriptor_t descriptpr; + void *data; +} z_allocated_chunk_t; +#endif +/** + * Monotonic clock + */ +typedef struct z_clock_t { + uint64_t t; + const void *t_base; +} z_clock_t; +typedef struct z_moved_session_t { + struct z_owned_session_t _this; +} z_moved_session_t; +/** + * Moved closure. + */ +typedef struct z_moved_closure_hello_t { + struct z_owned_closure_hello_t _this; +} z_moved_closure_hello_t; +/** + * Moved closure. + */ +typedef struct z_moved_closure_query_t { + struct z_owned_closure_query_t _this; +} z_moved_closure_query_t; +/** + * Moved closure. + */ +typedef struct z_moved_closure_reply_t { + struct z_owned_closure_reply_t _this; +} z_moved_closure_reply_t; +/** + * Moved closure. + */ +typedef struct z_moved_closure_sample_t { + struct z_owned_closure_sample_t _this; +} z_moved_closure_sample_t; /** * Moved closure. */ @@ -967,30 +991,6 @@ typedef struct z_task_attr_t { typedef struct z_time_t { uint64_t t; } z_time_t; -/** - * A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: - * - * Closures are not guaranteed not to be called concurrently. - * - * It is guaranteed that: - * - `call` will never be called once `drop` has started. - * - `drop` will only be called **once**, and **after every** `call` has ended. - * - The two previous guarantees imply that `call` and `drop` are never called concurrently. - */ -typedef struct zc_owned_closure_log_t { - /** - * An optional pointer to a closure state. - */ - void *context; - /** - * A closure body. - */ - void (*call)(enum zc_log_severity_t severity, const struct z_loaned_string_t *msg, void *context); - /** - * An optional drop function that will be called when the closure is dropped. - */ - void (*drop)(void *context); -} zc_owned_closure_log_t; /** * Moved closure. */ @@ -1160,6 +1160,366 @@ ZENOHC_API extern const char *Z_CONFIG_SCOUTING_DELAY_KEY; ZENOHC_API extern const char *Z_CONFIG_ADD_TIMESTAMP_KEY; ZENOHC_API extern const char *Z_CONFIG_SHARED_MEMORY_KEY; ZENOHC_API extern const unsigned int Z_SHM_POSIX_PROTOCOL_ID; +/** + * 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 +/** + * 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 +/** + * 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_); +/** + * The gravestone value for `z_owned_bytes_t`. + */ +ZENOHC_API void _z_bytes_null(struct z_owned_bytes_t *this_); +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool _z_chunk_alloc_result_check(const z_owned_chunk_alloc_result_t *this_); +#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 +/** + * 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_); +/** + * Constructs a closure in a gravestone state. + */ +ZENOHC_API void _z_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_closure_query_check(const struct z_owned_closure_query_t *this_); +/** + * Constructs a closure in its gravestone state. + */ +ZENOHC_API void _z_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_closure_reply_check(const struct z_owned_closure_reply_t *this_); +/** + * Constructs a closure int its gravestone state. + */ +ZENOHC_API void _z_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_closure_sample_check(const struct z_owned_closure_sample_t *this_); +/** + * Constructs a closure in its gravestone state. + */ +ZENOHC_API void _z_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_closure_zid_check(const struct z_owned_closure_zid_t *this_); +#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_); +/** + * Constructs conditional variable in a gravestone state. + */ +ZENOHC_API void _z_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_config_check(const struct z_owned_config_t *this_); +/** + * Constructs config in its gravestone state. + */ +ZENOHC_API void _z_config_null(struct z_owned_config_t *this_); +/** + * 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 a default `z_owned_encoding_t`. + */ +ZENOHC_API void _z_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_fifo_handler_query_check(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 ``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_); +/** + * Constructs a handler in gravestone state. + */ +ZENOHC_API void _z_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_fifo_handler_sample_check(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 ``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_); +/** + * Constructs hello message in a gravestone state. + */ +ZENOHC_API void _z_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_keyexpr_check(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 ``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 +/** + * 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_); +/** + * Constructs mutex in a gravestone state. + */ +ZENOHC_API void _z_mutex_null(struct z_owned_mutex_t *this_); +/** + * Returns ``true`` if publisher is valid, ``false`` otherwise. + */ +ZENOHC_API bool _z_publisher_check(const 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_); +/** + * 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 query in its gravestone value. + */ +ZENOHC_API void _z_query_null(struct z_owned_query_t *this_); +/** + * Returns ``true`` if queryable is valid, ``false`` otherwise. + */ +ZENOHC_API bool _z_queryable_check(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_); +/** + * Returns ``true`` if `reply` is valid, ``false`` otherwise. + */ +ZENOHC_API bool _z_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_reply_err_check(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_); +/** + * Constructs the reply in its gravestone state. + */ +ZENOHC_API void _z_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_ring_handler_query_check(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 ``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_); +/** + * Constructs a handler in gravestone state. + */ +ZENOHC_API void _z_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_ring_handler_sample_check(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 ``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 sample in its gravestone state. + */ +ZENOHC_API void _z_sample_null(struct z_owned_sample_t *this_); +/** + * Returns ``true`` if `session` is valid, ``false`` otherwise. + */ +ZENOHC_API bool _z_session_check(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 +/** + * 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 +/** + * 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 +/** + * 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 +/** + * 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 +/** + * 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 +/** + * 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 +/** + * 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 +/** + * @return ``true`` if slice is not empty, ``false`` otherwise. + */ +ZENOHC_API bool _z_slice_check(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 +/** + * Constructs source info in its gravestone state. + */ +#if defined(UNSTABLE) +ZENOHC_API void _z_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_string_array_check(const 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_); +/** + * @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 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_); +/** + * Constructs a subscriber in a gravestone state. + */ +ZENOHC_API void _z_subscriber_null(struct z_owned_subscriber_t *this_); +/** + * Returns ``true`` if task is valid, ``false`` otherwise. + */ +ZENOHC_API bool _z_task_check(const struct z_owned_task_t *this_); +/** + * Constructs task in a gravestone state. + */ +ZENOHC_API void _z_task_null(struct z_owned_task_t *this_); +/** + * 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_); +/** + * Constructs a closure in a gravestone state. + */ +ZENOHC_API void _zc_closure_log_null(struct zc_owned_closure_log_t *this_); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc(struct z_buf_alloc_result_t *out_result, @@ -1185,12 +1545,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 +1567,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 +1575,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 +1831,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 +1979,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 */ @@ -1671,14 +2005,8 @@ void z_chunk_alloc_result_new_error(z_owned_chunk_alloc_result_t *this_, */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_chunk_alloc_result_new_ok(z_owned_chunk_alloc_result_t *this_, - 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_); +z_result_t z_chunk_alloc_result_new_ok(z_owned_chunk_alloc_result_t *this_, + struct z_allocated_chunk_t allocated_chunk); #endif /** * Get number of milliseconds passed since creation of `time`. @@ -1710,10 +2038,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 +2047,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 +2062,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 +2078,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 +2093,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 +2101,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 +2115,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 +2131,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 +2146,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 +2178,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 +2418,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 +2482,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 +2787,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 +2796,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 +2813,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 +2822,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 +2838,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 +2847,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 +2886,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 +2902,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. */ @@ -2746,10 +2974,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 +3068,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 +3078,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 +3109,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 +3127,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 +3175,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 +3211,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 +3261,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. * @@ -3133,10 +3321,6 @@ 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_); /** * Gets query value selector. */ @@ -3222,20 +3406,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 +3439,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 +3453,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 +3467,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 +3481,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 +3515,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 +3524,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 +3540,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 +3549,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 +3565,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 +3574,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 +3597,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 +3633,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 +3671,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 +3687,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 +3702,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 +3732,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 +3774,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 +3810,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 +3864,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 +3899,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 +3933,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 +3986,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 +4013,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 +4053,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 +4070,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 +4128,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 +4142,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 +4171,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 +4396,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 +4405,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. */ diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index 6e92ea128..38b8847ad 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -150,38 +150,38 @@ 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_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_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 \ )(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); } @@ -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_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_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 \ )(&this_) #define z_call(closure, hello) \ @@ -456,36 +456,36 @@ 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_); }; +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); } @@ -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_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 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..2b8a2c2a6 100644 --- a/src/closures/hello_closure.rs +++ b/src/closures/hello_closure.rs @@ -83,7 +83,7 @@ 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_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 +129,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_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..ac9859108 100644 --- a/src/closures/log_closure.rs +++ b/src/closures/log_closure.rs @@ -146,7 +146,7 @@ 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_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 +172,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_closure_log_check(this_: &zc_owned_closure_log_t) -> bool { !this_.is_empty() } diff --git a/src/closures/query_channel.rs b/src/closures/query_channel.rs index b9aadf9d3..f98f92246 100644 --- a/src/closures/query_channel.rs +++ b/src/closures/query_channel.rs @@ -41,13 +41,13 @@ 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_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_fifo_handler_query_check(this_: &z_owned_fifo_handler_query_t) -> bool { this_.as_rust_type_ref().is_some() } @@ -161,13 +161,13 @@ 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_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_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..56a178a8a 100644 --- a/src/closures/query_closure.rs +++ b/src/closures/query_closure.rs @@ -83,13 +83,13 @@ 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_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_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..8446e3f84 100644 --- a/src/closures/reply_closure.rs +++ b/src/closures/reply_closure.rs @@ -84,13 +84,13 @@ 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_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_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..02402384e 100644 --- a/src/closures/response_channel.rs +++ b/src/closures/response_channel.rs @@ -41,13 +41,13 @@ 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_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_fifo_handler_reply_check(this_: &z_owned_fifo_handler_reply_t) -> bool { this_.as_rust_type_ref().is_some() } @@ -157,13 +157,13 @@ 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_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_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..9ebfea16f 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_fifo_handler_sample_null( this: &mut MaybeUninit, ) { this.as_rust_type_mut_uninit().write(None); @@ -49,7 +49,7 @@ 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_fifo_handler_sample_check(this_: &z_owned_fifo_handler_sample_t) -> bool { this_.as_rust_type_ref().is_some() } @@ -163,7 +163,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_ring_handler_sample_null( this: &mut MaybeUninit, ) { this.as_rust_type_mut_uninit().write(None); @@ -171,7 +171,7 @@ 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_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..3b2ee8453 100644 --- a/src/closures/sample_closure.rs +++ b/src/closures/sample_closure.rs @@ -84,13 +84,13 @@ 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_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_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..3cf27afd0 100644 --- a/src/closures/zenohid_closure.rs +++ b/src/closures/zenohid_closure.rs @@ -84,14 +84,14 @@ 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_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_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..4b14abf75 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_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_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_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_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_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_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..5bf79c317 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_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_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_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_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..10f102d51 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_owned_string_t, z_string_copy_from_substr, _z_string_null, }; #[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_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_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_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_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_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_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_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_config_null(this); return res; }; this.as_rust_type_mut_uninit() diff --git a/src/encoding.rs b/src/encoding.rs index 0481ed55e..0a78adf29 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_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_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..b1f4fff6e 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_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_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_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_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..a8fb8c08a 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_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_keyexpr_check(this_: &z_owned_keyexpr_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/payload.rs b/src/payload.rs index f1581b8a6..6294d6a33 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_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_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..2c1882454 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_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_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_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_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_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_task_check(this_: &z_owned_task_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/publisher.rs b/src/publisher.rs index 22240e773..72509e95f 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_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_publisher_check(this_: &z_owned_publisher_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/queryable.rs b/src/queryable.rs index 707f735a2..3456009f4 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_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_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_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_queryable_check(this_: &z_owned_queryable_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/scouting.rs b/src/scouting.rs index d8cc48069..bb213c3bf 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_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_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..d0873b027 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_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_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..4c0b6a677 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_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_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..69bbd0c63 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_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_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..27e2341e3 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_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_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..a26140dff 100644 --- a/src/shm/client_storage/mod.rs +++ b/src/shm/client_storage/mod.rs @@ -150,13 +150,13 @@ 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_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_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..7b4ee6e78 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_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_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..1160cbe8d 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_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_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..580d18c7f 100644 --- a/src/shm/provider/types.rs +++ b/src/shm/provider/types.rs @@ -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_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_memory_layout_check(this_: &z_owned_memory_layout_t) -> bool { this_.as_rust_type_ref().is_some() } @@ -217,13 +217,13 @@ 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_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_chunk_alloc_result_check(this_: &z_owned_chunk_alloc_result_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/subscriber.rs b/src/subscriber.rs index 6bd43eb44..96dac1d72 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_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_subscriber_check(this_: &z_owned_subscriber_t) -> bool { this_.as_rust_type_ref().is_some() }