From e305a9e4752d9efe4172b9f1be5cb69529521b8a Mon Sep 17 00:00:00 2001 From: DenisBiryukov91 <155981813+DenisBiryukov91@users.noreply.github.com> Date: Fri, 4 Oct 2024 18:12:08 +0200 Subject: [PATCH] make z_close take session by mutable reference (#739) --- docs/api.rst | 2 + docs/examples.rst | 10 +- examples/z_delete.c | 2 +- examples/z_get.c | 2 +- examples/z_get_liveliness.c | 2 +- examples/z_get_shm.c | 2 +- examples/z_info.c | 2 +- examples/z_liveliness.c | 2 +- examples/z_non_blocking_get.c | 2 +- examples/z_ping.c | 2 +- examples/z_ping_shm.c | 2 +- examples/z_pong.c | 2 +- examples/z_pub.c | 2 +- examples/z_pub_attachment.c | 2 +- examples/z_pub_cache.c | 2 +- examples/z_pub_shm.c | 2 +- examples/z_pub_shm_thr.c | 2 +- examples/z_pub_thr.c | 2 +- examples/z_pull.c | 2 +- examples/z_put.c | 2 +- examples/z_query_sub.c | 2 +- examples/z_queryable.c | 2 +- examples/z_queryable_shm.c | 2 +- examples/z_queryable_with_channels.c | 2 +- examples/z_sub.c | 2 +- examples/z_sub_attachment.c | 2 +- examples/z_sub_liveliness.c | 2 +- examples/z_sub_shm.c | 2 +- examples/z_sub_thr.c | 2 +- include/zenoh_commons.h | 628 ++++++++++++++++-------- include/zenoh_macros.h | 352 +------------ src/session.rs | 34 +- tests/z_api_alignment_test.c | 6 +- tests/z_api_double_drop_test.c | 10 +- tests/z_api_drop_options.c | 4 +- tests/z_api_keyexpr_drop_test.c | 4 +- tests/z_int_pub_cache_query_sub_test.c | 4 +- tests/z_int_pub_sub_attachment_test.c | 4 +- tests/z_int_pub_sub_test.c | 4 +- tests/z_int_queryable_attachment_test.c | 4 +- tests/z_int_queryable_test.c | 4 +- tests/z_leak_pub_sub_test.c | 4 +- tests/z_leak_queryable_get_test.c | 4 +- 43 files changed, 516 insertions(+), 616 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 79770679a..6576e9edc 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -510,8 +510,10 @@ Functions ^^^^^^^^^ .. doxygenfunction:: z_open .. doxygenfunction:: z_close +.. doxygenfunction:: z_session_is_closed .. doxygenfunction:: z_session_loan +.. doxygenfunction:: z_session_loan_mut .. doxygenfunction:: z_session_drop .. doxygenfunction:: z_info_zid diff --git a/docs/examples.rst b/docs/examples.rst index 296424e86..ae9bf5ddb 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -40,7 +40,7 @@ Publish z_put(z_loan(s), z_loan(key_expr), z_move(payload), NULL); - z_close(z_move(s)); + z_drop(z_move(s)); return 0; } @@ -83,7 +83,7 @@ Subscribe z_owned_subscriber_t sub; if (z_declare_subscriber(&sub, z_loan(s), z_loan(key_expr) z_move(callback), NULL) != 0) { printf("Unable to create Zenoh subscriber.\n"); - z_close(z_move(s)); + z_drop(z_move(s)); exit(-1); } @@ -93,7 +93,7 @@ Subscribe } z_undeclare_subscriber(z_move(sub)); - z_close(z_move(s)); + z_drop(z_move(s)); return 0; } @@ -140,7 +140,7 @@ Query z_drop(reply); z_drop(channel); - z_close(z_move(s)); + z_drop(z_move(s)); return 0; } @@ -206,6 +206,6 @@ Queryable } z_undeclare_queryable(z_move(qable)); - z_close(z_move(s)); + z_drop(z_move(s)); return 0; } \ No newline at end of file diff --git a/examples/z_delete.c b/examples/z_delete.c index 9626342a8..0a21202fb 100644 --- a/examples/z_delete.c +++ b/examples/z_delete.c @@ -45,7 +45,7 @@ int main(int argc, char** argv) { printf("Delete failed...\n"); } - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/examples/z_get.c b/examples/z_get.c index be363338f..ba43ab71a 100644 --- a/examples/z_get.c +++ b/examples/z_get.c @@ -82,7 +82,7 @@ int main(int argc, char** argv) { } z_drop(z_move(handler)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/examples/z_get_liveliness.c b/examples/z_get_liveliness.c index bd3f72ed9..fcb1d5b1d 100644 --- a/examples/z_get_liveliness.c +++ b/examples/z_get_liveliness.c @@ -62,7 +62,7 @@ int main(int argc, char** argv) { z_drop(z_move(reply)); z_drop(z_move(handler)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/examples/z_get_shm.c b/examples/z_get_shm.c index a68419527..4cb71167b 100644 --- a/examples/z_get_shm.c +++ b/examples/z_get_shm.c @@ -122,7 +122,7 @@ int main(int argc, char** argv) { } z_drop(z_move(handler)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); z_drop(z_move(shm)); z_drop(z_move(provider)); diff --git a/examples/z_info.c b/examples/z_info.c index d9eba928f..5896e1d13 100644 --- a/examples/z_info.c +++ b/examples/z_info.c @@ -54,7 +54,7 @@ int main(int argc, char** argv) { z_closure(&callback2, print_zid, NULL, NULL); z_info_peers_zid(z_loan(s), z_move(callback2)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); } void print_help() { diff --git a/examples/z_liveliness.c b/examples/z_liveliness.c index f72a60910..affd242d5 100644 --- a/examples/z_liveliness.c +++ b/examples/z_liveliness.c @@ -60,7 +60,7 @@ int main(int argc, char** argv) { printf("Undeclaring liveliness token...\n"); z_drop(z_move(token)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/examples/z_non_blocking_get.c b/examples/z_non_blocking_get.c index 54cf29f35..338989ee1 100644 --- a/examples/z_non_blocking_get.c +++ b/examples/z_non_blocking_get.c @@ -74,7 +74,7 @@ int main(int argc, char** argv) { } z_drop(z_move(reply)); z_drop(z_move(handler)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/examples/z_ping.c b/examples/z_ping.c index b0a041b0f..ceca9d885 100644 --- a/examples/z_ping.c +++ b/examples/z_ping.c @@ -93,7 +93,7 @@ int main(int argc, char** argv) { z_undeclare_subscriber(z_move(sub)); z_undeclare_publisher(z_move(pub)); z_drop(z_move(mutex)); - z_close(z_move(session), NULL); + z_drop(z_move(session)); } void print_help() { diff --git a/examples/z_ping_shm.c b/examples/z_ping_shm.c index 25df11c8d..6afd9e84c 100644 --- a/examples/z_ping_shm.c +++ b/examples/z_ping_shm.c @@ -136,7 +136,7 @@ int main(int argc, char** argv) { z_undeclare_subscriber(z_move(sub)); z_undeclare_publisher(z_move(pub)); z_drop(z_move(mutex)); - z_close(z_move(session), NULL); + z_drop(z_move(session)); z_drop(z_move(shm)); z_drop(z_move(provider)); diff --git a/examples/z_pong.c b/examples/z_pong.c index 1c3137f0f..d0b18fa88 100644 --- a/examples/z_pong.c +++ b/examples/z_pong.c @@ -44,7 +44,7 @@ int main(int argc, char** argv) { z_sleep_s(1); } z_undeclare_subscriber(z_move(sub)); - z_close(z_move(session), NULL); + z_drop(z_move(session)); } void print_help() { diff --git a/examples/z_pub.c b/examples/z_pub.c index cbde8ecbb..fd0d3be2a 100644 --- a/examples/z_pub.c +++ b/examples/z_pub.c @@ -94,7 +94,7 @@ int main(int argc, char** argv) { #endif z_undeclare_publisher(z_move(pub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/examples/z_pub_attachment.c b/examples/z_pub_attachment.c index 6be1aca25..a8324bdab 100644 --- a/examples/z_pub_attachment.c +++ b/examples/z_pub_attachment.c @@ -90,7 +90,7 @@ int main(int argc, char** argv) { z_undeclare_publisher(z_move(pub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/examples/z_pub_cache.c b/examples/z_pub_cache.c index 64ee8211f..f7a9da84e 100644 --- a/examples/z_pub_cache.c +++ b/examples/z_pub_cache.c @@ -74,7 +74,7 @@ int main(int argc, char** argv) { } ze_undeclare_publication_cache(z_move(pub_cache)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/examples/z_pub_shm.c b/examples/z_pub_shm.c index 59093e419..c0fef86ab 100644 --- a/examples/z_pub_shm.c +++ b/examples/z_pub_shm.c @@ -116,7 +116,7 @@ int main(int argc, char** argv) { #endif z_undeclare_publisher(z_move(pub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); z_drop(z_move(provider)); z_drop(z_move(layout)); diff --git a/examples/z_pub_shm_thr.c b/examples/z_pub_shm_thr.c index 84f4ce5e4..b88435a3d 100644 --- a/examples/z_pub_shm_thr.c +++ b/examples/z_pub_shm_thr.c @@ -89,7 +89,7 @@ int main(int argc, char **argv) { } z_undeclare_publisher(z_move(pub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); z_drop(z_move(shm)); z_drop(z_move(provider)); diff --git a/examples/z_pub_thr.c b/examples/z_pub_thr.c index 4e8afc899..456212990 100644 --- a/examples/z_pub_thr.c +++ b/examples/z_pub_thr.c @@ -63,7 +63,7 @@ int main(int argc, char** argv) { } z_undeclare_publisher(z_move(pub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); } void print_help() { diff --git a/examples/z_pull.c b/examples/z_pull.c index 21639e57e..82bf80f05 100644 --- a/examples/z_pull.c +++ b/examples/z_pull.c @@ -81,7 +81,7 @@ int main(int argc, char** argv) { } } z_undeclare_subscriber(z_move(sub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/examples/z_put.c b/examples/z_put.c index 2e822d0ac..5581900d9 100644 --- a/examples/z_put.c +++ b/examples/z_put.c @@ -63,7 +63,7 @@ int main(int argc, char** argv) { printf("Put failed...\n"); } - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/examples/z_query_sub.c b/examples/z_query_sub.c index 26e81b583..3dfc61c07 100644 --- a/examples/z_query_sub.c +++ b/examples/z_query_sub.c @@ -70,7 +70,7 @@ int main(int argc, char** argv) { } ze_undeclare_querying_subscriber(z_move(sub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/examples/z_queryable.c b/examples/z_queryable.c index 0e437c599..cc912d4ef 100644 --- a/examples/z_queryable.c +++ b/examples/z_queryable.c @@ -97,7 +97,7 @@ int main(int argc, char **argv) { } z_undeclare_queryable(z_move(qable)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/examples/z_queryable_shm.c b/examples/z_queryable_shm.c index e575a97ec..a86fb5bd9 100644 --- a/examples/z_queryable_shm.c +++ b/examples/z_queryable_shm.c @@ -134,7 +134,7 @@ int main(int argc, char **argv) { } z_undeclare_queryable(z_move(qable)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); z_drop(z_move(layout)); z_drop(z_move(provider)); return 0; diff --git a/examples/z_queryable_with_channels.c b/examples/z_queryable_with_channels.c index 730c34660..b55f5cd54 100644 --- a/examples/z_queryable_with_channels.c +++ b/examples/z_queryable_with_channels.c @@ -92,7 +92,7 @@ int main(int argc, char** argv) { z_undeclare_queryable(z_move(qable)); z_drop(z_move(handler)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/examples/z_sub.c b/examples/z_sub.c index a5ed1ed3c..158af6d0d 100644 --- a/examples/z_sub.c +++ b/examples/z_sub.c @@ -81,7 +81,7 @@ int main(int argc, char **argv) { } z_undeclare_subscriber(z_move(sub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/examples/z_sub_attachment.c b/examples/z_sub_attachment.c index 2720e6eae..b5c7fbed2 100644 --- a/examples/z_sub_attachment.c +++ b/examples/z_sub_attachment.c @@ -85,7 +85,7 @@ int main(int argc, char** argv) { } z_undeclare_subscriber(z_move(sub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/examples/z_sub_liveliness.c b/examples/z_sub_liveliness.c index 08067dd3e..9653e731f 100644 --- a/examples/z_sub_liveliness.c +++ b/examples/z_sub_liveliness.c @@ -71,7 +71,7 @@ int main(int argc, char** argv) { } z_undeclare_subscriber(z_move(sub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/examples/z_sub_shm.c b/examples/z_sub_shm.c index e2f709434..507bf3412 100644 --- a/examples/z_sub_shm.c +++ b/examples/z_sub_shm.c @@ -102,7 +102,7 @@ int main(int argc, char **argv) { } z_undeclare_subscriber(z_move(sub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/examples/z_sub_thr.c b/examples/z_sub_thr.c index 826ae7609..68ec6e59e 100644 --- a/examples/z_sub_thr.c +++ b/examples/z_sub_thr.c @@ -108,7 +108,7 @@ int main(int argc, char **argv) { z_undeclare_subscriber(z_move(sub)); z_undeclare_keyexpr(z_move(declared_ke), z_loan(s)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 76c2bb1ab..d76689510 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -16,6 +16,32 @@ #define ALIGN(n) #define ZENOHC_API #endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Allocation errors + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef enum z_alloc_error_t { +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * Defragmentation needed. + */ + Z_ALLOC_ERROR_NEED_DEFRAGMENT, +#endif +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * The provider is out of memory. + */ + Z_ALLOC_ERROR_OUT_OF_MEMORY, +#endif +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * Other error. + */ + Z_ALLOC_ERROR_OTHER, +#endif +} z_alloc_error_t; +#endif typedef enum z_congestion_control_t { /** * Messages are not dropped in case of congestion. @@ -77,6 +103,26 @@ typedef enum z_keyexpr_intersection_level_t { Z_KEYEXPR_INTERSECTION_LEVEL_EQUALS = 3, } z_keyexpr_intersection_level_t; #endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Layouting errors + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef enum z_layout_error_t { +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * Layout arguments are incorrect. + */ + Z_LAYOUT_ERROR_INCORRECT_LAYOUT_ARGS, +#endif +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * Layout incompatible with provider. + */ + Z_LAYOUT_ERROR_PROVIDER_INCOMPATIBLE_LAYOUT, +#endif +} z_layout_error_t; +#endif /** * The priority of zenoh messages. */ @@ -169,6 +215,52 @@ typedef enum z_whatami_t { Z_WHATAMI_PEER = 2, Z_WHATAMI_CLIENT = 4, } z_whatami_t; +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Status of SHM buffer allocation operation. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef enum zc_buf_alloc_status_t { +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * Allocation ok + */ + ZC_BUF_ALLOC_STATUS_OK = 0, +#endif +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * Allocation error + */ + ZC_BUF_ALLOC_STATUS_ALLOC_ERROR = 1, +#endif +} zc_buf_alloc_status_t; +#endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Status of SHM buffer layouting + allocation operation. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef enum zc_buf_layout_alloc_status_t { +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * Allocation ok + */ + ZC_BUF_LAYOUT_ALLOC_STATUS_OK = 0, +#endif +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * Allocation error + */ + ZC_BUF_LAYOUT_ALLOC_STATUS_ALLOC_ERROR = 1, +#endif +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) + /** + * Layouting error + */ + ZC_BUF_LAYOUT_ALLOC_STATUS_LAYOUT_ERROR = 2, +#endif +} zc_buf_layout_alloc_status_t; +#endif /** * The locality of samples to be received by subscribers or targeted by publishers. */ @@ -237,19 +329,56 @@ typedef enum zc_reply_keyexpr_t { ZC_REPLY_KEYEXPR_MATCHING_QUERY = 1, } zc_reply_keyexpr_t; #endif -typedef struct z_moved_alloc_layout_t { - struct z_owned_alloc_layout_t _this; -} z_moved_alloc_layout_t; +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief A result of SHM buffer allocation operation. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct z_buf_alloc_result_t { + enum zc_buf_alloc_status_t status; + z_owned_shm_mut_t buf; + enum z_alloc_error_t error; +} z_buf_alloc_result_t; +#endif typedef int8_t z_result_t; +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief An AllocAlignment. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct z_alloc_alignment_t { + uint8_t pow; +} z_alloc_alignment_t; +#endif +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct zc_threadsafe_context_data_t { + void *ptr; +} zc_threadsafe_context_data_t; +#endif +/** + * A tread-safe droppable context. + * Contexts are idiomatically used in C together with callback interfaces to deliver associated state + * information to each callback. + * + * This is a thread-safe context - the associated callbacks may be executed concurrently with the same + * zc_context_t instance. In other words, all the callbacks associated with this context data MUST be + * thread-safe. + * + * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted.The + * delete_fn is guaranteed to be executed only once at some point of time after the last associated + * callback call returns. + * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't + * be executed. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct zc_threadsafe_context_t { + struct zc_threadsafe_context_data_t context; + void (*delete_fn)(void*); +} zc_threadsafe_context_t; +#endif typedef struct z_moved_bytes_t { struct z_owned_bytes_t _this; } z_moved_bytes_t; -typedef struct z_moved_shm_t { - struct z_owned_shm_t _this; -} z_moved_shm_t; -typedef struct z_moved_shm_mut_t { - struct z_owned_shm_mut_t _this; -} z_moved_shm_mut_t; typedef struct z_moved_slice_t { struct z_owned_slice_t _this; } z_moved_slice_t; @@ -265,9 +394,41 @@ typedef struct ALIGN(8) z_bytes_slice_iterator_t { typedef struct z_moved_bytes_writer_t { struct z_owned_bytes_writer_t _this; } z_moved_bytes_writer_t; -typedef struct z_moved_chunk_alloc_result_t { - struct z_owned_chunk_alloc_result_t _this; -} z_moved_chunk_alloc_result_t; +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Unique segment identifier. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef uint32_t z_segment_id_t; +#endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Chunk id within it's segment. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef uint32_t z_chunk_id_t; +#endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief A ChunkDescriptor. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct z_chunk_descriptor_t { + z_segment_id_t segment; + z_chunk_id_t chunk; + size_t len; +} z_chunk_descriptor_t; +#endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief An AllocatedChunk. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct z_allocated_chunk_t { + struct z_chunk_descriptor_t descriptpr; + void *data; +} z_allocated_chunk_t; +#endif /** * Monotonic clock */ @@ -275,9 +436,6 @@ 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; /** * Options passed to the `z_close()` function. */ @@ -425,7 +583,7 @@ typedef struct z_owned_closure_zid_t { /** * A callback function. */ - void (*call)(const struct z_id_t *z_id, void *context); + void (*call)(const z_id_t *z_id, void *context); /** * An optional function that will be called upon closure drop. */ @@ -557,9 +715,6 @@ typedef struct z_moved_fifo_handler_sample_t { typedef struct z_query_consolidation_t { enum z_consolidation_mode_t mode; } z_query_consolidation_t; -typedef struct z_moved_source_info_t { - struct z_owned_source_info_t _this; -} z_moved_source_info_t; /** * Options passed to the `z_get()` function. */ @@ -614,7 +769,7 @@ typedef struct z_get_options_t { * * The source info for the query. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * An optional attachment to attach to the query. @@ -631,9 +786,6 @@ typedef struct z_moved_hello_t { typedef struct z_moved_keyexpr_t { struct z_owned_keyexpr_t _this; } z_moved_keyexpr_t; -typedef struct z_moved_memory_layout_t { - struct z_owned_memory_layout_t _this; -} z_moved_memory_layout_t; typedef struct z_moved_mutex_t { struct z_owned_mutex_t _this; } z_moved_mutex_t; @@ -674,7 +826,7 @@ typedef struct z_publisher_put_options_t { * * The source info for the publication. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to attach to the publication. @@ -727,7 +879,7 @@ typedef struct z_put_options_t { * * The source info for the message. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to this message. @@ -768,7 +920,7 @@ typedef struct z_query_reply_options_t { * * The source info for the reply. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to this reply. @@ -802,7 +954,7 @@ typedef struct z_query_reply_del_options_t { * * The source info for the reply. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to this reply. @@ -853,15 +1005,49 @@ typedef struct z_scout_options_t { */ enum z_what_t what; } z_scout_options_t; -typedef struct z_moved_shm_client_t { - struct z_owned_shm_client_t _this; -} z_moved_shm_client_t; -typedef struct z_moved_shm_client_storage_t { - struct z_owned_shm_client_storage_t _this; -} z_moved_shm_client_storage_t; -typedef struct z_moved_shm_provider_t { - struct z_owned_shm_provider_t _this; -} z_moved_shm_provider_t; +typedef struct z_moved_session_t { + struct z_owned_session_t _this; +} z_moved_session_t; +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Callbacks for ShmSegment. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct zc_shm_segment_callbacks_t { + uint8_t *(*map_fn)(z_chunk_id_t chunk_id, void *context); +} zc_shm_segment_callbacks_t; +#endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief An ShmSegment. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct z_shm_segment_t { + struct zc_threadsafe_context_t context; + struct zc_shm_segment_callbacks_t callbacks; +} z_shm_segment_t; +#endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Callback for ShmClient. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct zc_shm_client_callbacks_t { + bool (*attach_fn)(struct z_shm_segment_t *out_segment, z_segment_id_t segment_id, void *context); +} zc_shm_client_callbacks_t; +#endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief A result of SHM buffer layouting + allocation operation. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct z_buf_layout_alloc_result_t { + enum zc_buf_layout_alloc_status_t status; + z_owned_shm_mut_t buf; + enum z_alloc_error_t alloc_error; + enum z_layout_error_t layout_error; +} z_buf_layout_alloc_result_t; +#endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Unique protocol identifier. @@ -871,6 +1057,47 @@ typedef struct z_moved_shm_provider_t { #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) typedef uint32_t z_protocol_id_t; #endif +/** + * A non-tread-safe droppable context. + * Contexts are idiomatically used in C together with callback interfaces to deliver associated state + * information to each callback. + * + * This is a non-thread-safe context - zenoh-c guarantees that associated callbacks that share the same + * zc_context_t instance will never be executed concurrently. In other words, all the callbacks associated + * with this context data are not required to be thread-safe. + * + * NOTE: Remember that the same callback interfaces associated with different zc_context_t instances can + * still be executed concurrently. The exact behavior depends on user's application, but we strongly + * discourage our users from pinning to some specific behavior unless they _really_ understand what they + * are doing. + * + * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted. The + * delete_fn is guaranteed to be executed only once at some point of time after the last associated + * callback call returns. + * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't + * be executed. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct zc_context_t { + void *context; + void (*delete_fn)(void*); +} zc_context_t; +#endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Callbacks for ShmProviderBackend. + */ +#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) +typedef struct zc_shm_provider_backend_callbacks_t { + void (*alloc_fn)(z_owned_chunk_alloc_result_t *out_result, + const z_loaned_memory_layout_t *layout, + void *context); + void (*free_fn)(const struct z_chunk_descriptor_t *chunk, void *context); + size_t (*defragment_fn)(void *context); + size_t (*available_fn)(void *context); + void (*layout_for_fn)(z_owned_memory_layout_t *layout, void *context); +} zc_shm_provider_backend_callbacks_t; +#endif typedef struct z_moved_string_array_t { struct z_owned_string_array_t _this; } z_moved_string_array_t; @@ -958,6 +1185,15 @@ typedef struct zc_owned_closure_matching_status_t { void (*drop)(void *context); } zc_owned_closure_matching_status_t; #endif +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief Loaned closure. + */ +#if defined(Z_FEATURE_UNSTABLE_API) +typedef struct zc_loaned_closure_matching_status_t { + size_t _0[3]; +} zc_loaned_closure_matching_status_t; +#endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Moved closure. @@ -994,15 +1230,6 @@ typedef struct zc_liveliness_get_options_t { uint32_t timeout_ms; } zc_liveliness_get_options_t; #endif -typedef struct zc_moved_liveliness_token_t { - struct zc_owned_liveliness_token_t _this; -} zc_moved_liveliness_token_t; -typedef struct zc_moved_matching_listener_t { - struct zc_owned_matching_listener_t _this; -} zc_moved_matching_listener_t; -typedef struct zc_moved_shm_client_list_t { - struct zc_owned_shm_client_list_t _this; -} zc_moved_shm_client_list_t; /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Options passed to the `ze_declare_publication_cache()` function. @@ -1071,19 +1298,6 @@ typedef struct ze_querying_subscriber_options_t { uint64_t query_timeout_ms; } ze_querying_subscriber_options_t; #endif -typedef struct ze_moved_publication_cache_t { - struct ze_owned_publication_cache_t _this; -} ze_moved_publication_cache_t; -/** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief A loaned Zenoh publication cache. - */ -typedef struct ALIGN(8) ze_loaned_publication_cache_t { - uint8_t _0[96]; -} ze_loaned_publication_cache_t; -typedef struct ze_moved_querying_subscriber_t { - struct ze_owned_querying_subscriber_t _this; -} ze_moved_querying_subscriber_t; typedef struct ze_moved_serializer_t { struct ze_owned_serializer_t _this; } ze_moved_serializer_t; @@ -1106,40 +1320,39 @@ ZENOHC_API extern const unsigned int Z_SHM_POSIX_PROTOCOL_ID; #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_alloc_layout_alloc(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_alloc_layout_alloc_gc(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag_blocking(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag_dealloc(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif /** * Deletes Alloc Layout */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -ZENOHC_API void z_alloc_layout_drop(struct z_moved_alloc_layout_t *this_); +ZENOHC_API void z_alloc_layout_drop(z_moved_alloc_layout_t *this_); #endif /** * Borrows Alloc Layout */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -ZENOHC_API -const struct z_loaned_alloc_layout_t *z_alloc_layout_loan(const struct z_owned_alloc_layout_t *this_); +ZENOHC_API const z_loaned_alloc_layout_t *z_alloc_layout_loan(const z_owned_alloc_layout_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1147,15 +1360,15 @@ const struct z_loaned_alloc_layout_t *z_alloc_layout_loan(const struct z_owned_a */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t z_alloc_layout_new(struct z_owned_alloc_layout_t *this_, - const struct z_loaned_shm_provider_t *provider, +z_result_t z_alloc_layout_new(z_owned_alloc_layout_t *this_, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_alloc_layout_threadsafe_alloc_gc_defrag_async(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout, + const z_loaned_alloc_layout_t *layout, struct zc_threadsafe_context_t result_context, void (*result_callback)(void*, struct z_buf_alloc_result_t*)); @@ -1225,7 +1438,7 @@ z_result_t z_bytes_from_buf(struct z_owned_bytes_t *this_, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_bytes_from_shm(struct z_owned_bytes_t *this_, - struct z_moved_shm_t *shm); + z_moved_shm_t *shm); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1234,7 +1447,7 @@ z_result_t z_bytes_from_shm(struct z_owned_bytes_t *this_, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_bytes_from_shm_mut(struct z_owned_bytes_t *this_, - struct z_moved_shm_mut_t *shm); + z_moved_shm_mut_t *shm); #endif /** * Converts a slice into `z_owned_bytes_t`. @@ -1361,7 +1574,7 @@ bool z_bytes_slice_iterator_next(struct z_bytes_slice_iterator_t *this_, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_bytes_to_loaned_shm(const struct z_loaned_bytes_t *this_, - const struct z_loaned_shm_t **dst); + const z_loaned_shm_t **dst); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1373,7 +1586,7 @@ z_result_t z_bytes_to_loaned_shm(const struct z_loaned_bytes_t *this_, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_bytes_to_mut_loaned_shm(struct z_loaned_bytes_t *this_, - struct z_loaned_shm_t **dst); + z_loaned_shm_t **dst); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1385,7 +1598,7 @@ z_result_t z_bytes_to_mut_loaned_shm(struct z_loaned_bytes_t *this_, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_bytes_to_owned_shm(const struct z_loaned_bytes_t *this_, - struct z_owned_shm_t *dst); + z_owned_shm_t *dst); #endif /** * Converts data into an owned slice. @@ -1458,7 +1671,7 @@ z_result_t z_bytes_writer_write_all(struct z_loaned_bytes_writer_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_chunk_alloc_result_drop(struct z_moved_chunk_alloc_result_t *this_); +void z_chunk_alloc_result_drop(z_moved_chunk_alloc_result_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1466,7 +1679,7 @@ void z_chunk_alloc_result_drop(struct z_moved_chunk_alloc_result_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const struct z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const struct z_owned_chunk_alloc_result_t *this_); +const z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const z_owned_chunk_alloc_result_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1474,7 +1687,7 @@ const struct z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const stru */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_chunk_alloc_result_new_error(struct z_owned_chunk_alloc_result_t *this_, +void z_chunk_alloc_result_new_error(z_owned_chunk_alloc_result_t *this_, enum z_alloc_error_t alloc_error); #endif /** @@ -1483,7 +1696,7 @@ void z_chunk_alloc_result_new_error(struct z_owned_chunk_alloc_result_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t z_chunk_alloc_result_new_ok(struct z_owned_chunk_alloc_result_t *this_, +z_result_t z_chunk_alloc_result_new_ok(z_owned_chunk_alloc_result_t *this_, struct z_allocated_chunk_t allocated_chunk); #endif /** @@ -1503,12 +1716,12 @@ ZENOHC_API uint64_t z_clock_elapsed_us(const struct z_clock_t *time); */ ZENOHC_API struct z_clock_t z_clock_now(void); /** - * Closes and drops a zenoh session. This also drops all the closure callbacks remaining from dropped (but not undeclared subscribers). + * Closes zenoh session. This also drops all the closure callbacks remaining from dropped, but not undeclared subscribers. * - * @return 0 in case of success, a negative value if an error occured while closing the session. + * @return `0` in case of success, a negative value if an error occured while closing the session. */ ZENOHC_API -z_result_t z_close(struct z_moved_session_t *session, +z_result_t z_close(struct z_loaned_session_t *session, const struct z_close_options_t *_options); /** * Constructs the default value for `z_close_options_t`. @@ -1633,7 +1846,7 @@ const struct z_loaned_closure_sample_t *z_closure_sample_loan(const struct z_own #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API void z_closure_zid(struct z_owned_closure_zid_t *this_, - void (*call)(const struct z_id_t *z_id, void *context), + void (*call)(const z_id_t *z_id, void *context), void (*drop)(void *context), void *context); #endif @@ -1644,7 +1857,7 @@ void z_closure_zid(struct z_owned_closure_zid_t *this_, #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API void z_closure_zid_call(const struct z_loaned_closure_zid_t *closure, - const struct z_id_t *z_id); + const z_id_t *z_id); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2297,7 +2510,7 @@ ZENOHC_API const struct z_loaned_encoding_t *z_encoding_zenoh_uint8(void); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -uint32_t z_entity_global_id_eid(const struct z_entity_global_id_t *this_); +uint32_t z_entity_global_id_eid(const z_entity_global_id_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2305,7 +2518,7 @@ uint32_t z_entity_global_id_eid(const struct z_entity_global_id_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -struct z_id_t z_entity_global_id_zid(const struct z_entity_global_id_t *this_); +z_id_t z_entity_global_id_zid(const z_entity_global_id_t *this_); #endif /** * Constructs send and recieve ends of the fifo channel @@ -2457,7 +2670,7 @@ ZENOHC_API enum z_whatami_t z_hello_whatami(const struct z_loaned_hello_t *this_ */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -struct z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); +z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2465,7 +2678,7 @@ struct z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void z_id_to_string(const struct z_id_t *zid, +void z_id_to_string(const z_id_t *zid, struct z_owned_string_t *dst); #endif /** @@ -2506,19 +2719,19 @@ z_result_t z_info_routers_zid(const struct z_loaned_session_t *session, */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -struct z_id_t z_info_zid(const struct z_loaned_session_t *session); +z_id_t z_info_zid(const struct z_loaned_session_t *session); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -ZENOHC_API bool z_internal_alloc_layout_check(const struct z_owned_alloc_layout_t *this_); +ZENOHC_API bool z_internal_alloc_layout_check(const z_owned_alloc_layout_t *this_); #endif /** * Constructs Alloc Layout in its gravestone value. */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -ZENOHC_API void z_internal_alloc_layout_null(struct z_owned_alloc_layout_t *this_); +ZENOHC_API void z_internal_alloc_layout_null(z_owned_alloc_layout_t *this_); #endif /** * Returns ``true`` if `this_` is in a valid state, ``false`` if it is in a gravestone state. @@ -2542,7 +2755,7 @@ ZENOHC_API void z_internal_bytes_writer_null(struct z_owned_bytes_writer_t *this */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_chunk_alloc_result_check(const struct z_owned_chunk_alloc_result_t *this_); +bool z_internal_chunk_alloc_result_check(const z_owned_chunk_alloc_result_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2550,7 +2763,7 @@ bool z_internal_chunk_alloc_result_check(const struct z_owned_chunk_alloc_result */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_chunk_alloc_result_null(struct z_owned_chunk_alloc_result_t *this_); +void z_internal_chunk_alloc_result_null(z_owned_chunk_alloc_result_t *this_); #endif /** * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. @@ -2673,7 +2886,7 @@ ZENOHC_API void z_internal_keyexpr_null(struct z_owned_keyexpr_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_memory_layout_check(const struct z_owned_memory_layout_t *this_); +bool z_internal_memory_layout_check(const z_owned_memory_layout_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2681,7 +2894,7 @@ bool z_internal_memory_layout_check(const struct z_owned_memory_layout_t *this_) */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_memory_layout_null(struct z_owned_memory_layout_t *this_); +void z_internal_memory_layout_null(z_owned_memory_layout_t *this_); #endif /** * Returns ``true`` if mutex is valid, ``false`` otherwise. @@ -2780,7 +2993,7 @@ ZENOHC_API void z_internal_session_null(struct z_owned_session_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_shm_check(const struct z_owned_shm_t *this_); +bool z_internal_shm_check(const z_owned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2788,7 +3001,7 @@ bool z_internal_shm_check(const struct z_owned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_shm_client_check(const struct z_owned_shm_client_t *this_); +bool z_internal_shm_client_check(const z_owned_shm_client_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2796,7 +3009,7 @@ bool z_internal_shm_client_check(const struct z_owned_shm_client_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_shm_client_null(struct z_owned_shm_client_t *this_); +void z_internal_shm_client_null(z_owned_shm_client_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2804,7 +3017,7 @@ void z_internal_shm_client_null(struct z_owned_shm_client_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_shm_client_storage_check(const struct z_owned_shm_client_storage_t *this_); +bool z_internal_shm_client_storage_check(const z_owned_shm_client_storage_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2812,7 +3025,7 @@ bool z_internal_shm_client_storage_check(const struct z_owned_shm_client_storage */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_shm_client_storage_null(struct z_owned_shm_client_storage_t *this_); +void z_internal_shm_client_storage_null(z_owned_shm_client_storage_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2820,7 +3033,7 @@ void z_internal_shm_client_storage_null(struct z_owned_shm_client_storage_t *thi */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_shm_mut_check(const struct z_owned_shm_mut_t *this_); +bool z_internal_shm_mut_check(const z_owned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2828,7 +3041,7 @@ bool z_internal_shm_mut_check(const struct z_owned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_shm_mut_null(struct z_owned_shm_mut_t *this_); +void z_internal_shm_mut_null(z_owned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2836,7 +3049,7 @@ void z_internal_shm_mut_null(struct z_owned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_shm_null(struct z_owned_shm_t *this_); +void z_internal_shm_null(z_owned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2844,7 +3057,7 @@ void z_internal_shm_null(struct z_owned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_shm_provider_check(const struct z_owned_shm_provider_t *this_); +bool z_internal_shm_provider_check(const z_owned_shm_provider_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2852,7 +3065,7 @@ bool z_internal_shm_provider_check(const struct z_owned_shm_provider_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_shm_provider_null(struct z_owned_shm_provider_t *this_); +void z_internal_shm_provider_null(z_owned_shm_provider_t *this_); #endif /** * @return ``true`` if slice is not empty, ``false`` otherwise. @@ -2868,7 +3081,7 @@ ZENOHC_API void z_internal_slice_null(struct z_owned_slice_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -bool z_internal_source_info_check(const struct z_owned_source_info_t *this_); +bool z_internal_source_info_check(const z_owned_source_info_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2876,7 +3089,7 @@ bool z_internal_source_info_check(const struct z_owned_source_info_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void z_internal_source_info_null(struct z_owned_source_info_t *this_); +void z_internal_source_info_null(z_owned_source_info_t *this_); #endif /** * @return ``true`` if the string array is valid, ``false`` if it is in a gravestone state. @@ -3053,7 +3266,7 @@ enum z_keyexpr_intersection_level_t z_keyexpr_relation_to(const struct z_loaned_ */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_memory_layout_drop(struct z_moved_memory_layout_t *this_); +void z_memory_layout_drop(z_moved_memory_layout_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3061,7 +3274,7 @@ void z_memory_layout_drop(struct z_moved_memory_layout_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_memory_layout_get_data(const struct z_loaned_memory_layout_t *this_, +void z_memory_layout_get_data(const z_loaned_memory_layout_t *this_, size_t *out_size, struct z_alloc_alignment_t *out_alignment); #endif @@ -3071,7 +3284,7 @@ void z_memory_layout_get_data(const struct z_loaned_memory_layout_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const struct z_loaned_memory_layout_t *z_memory_layout_loan(const struct z_owned_memory_layout_t *this_); +const z_loaned_memory_layout_t *z_memory_layout_loan(const z_owned_memory_layout_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3079,7 +3292,7 @@ const struct z_loaned_memory_layout_t *z_memory_layout_loan(const struct z_owned */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t z_memory_layout_new(struct z_owned_memory_layout_t *this_, +z_result_t z_memory_layout_new(z_owned_memory_layout_t *this_, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -3135,7 +3348,7 @@ ZENOHC_API void z_open_options_default(struct z_open_options_t *this_); ZENOHC_API z_result_t z_open_with_custom_shm_clients(struct z_owned_session_t *this_, struct z_moved_config_t *config, - const struct z_loaned_shm_client_storage_t *shm_clients); + const z_loaned_shm_client_storage_t *shm_clients); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3143,7 +3356,7 @@ z_result_t z_open_with_custom_shm_clients(struct z_owned_session_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_posix_shm_client_new(struct z_owned_shm_client_t *this_); +void z_posix_shm_client_new(z_owned_shm_client_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3151,8 +3364,8 @@ void z_posix_shm_client_new(struct z_owned_shm_client_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t z_posix_shm_provider_new(struct z_owned_shm_provider_t *this_, - const struct z_loaned_memory_layout_t *layout); +z_result_t z_posix_shm_provider_new(z_owned_shm_provider_t *this_, + const z_loaned_memory_layout_t *layout); #endif /** * Returns the default value of #z_priority_t. @@ -3180,7 +3393,7 @@ ZENOHC_API void z_publisher_drop(struct z_moved_publisher_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -struct z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); +z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); #endif /** * Returns the key expression of the publisher. @@ -3403,7 +3616,7 @@ void z_queryable_drop(struct z_moved_queryable_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -struct z_entity_global_id_t z_queryable_id(const struct z_loaned_queryable_t *queryable); +z_entity_global_id_t z_queryable_id(const struct z_loaned_queryable_t *queryable); #endif ZENOHC_API const struct z_loaned_queryable_t *z_queryable_loan(const struct z_owned_queryable_t *this_); @@ -3436,7 +3649,7 @@ ZENOHC_API uint8_t z_random_u8(void); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_ref_shm_client_storage_global(struct z_owned_shm_client_storage_t *this_); +void z_ref_shm_client_storage_global(z_owned_shm_client_storage_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3508,7 +3721,7 @@ ZENOHC_API const struct z_loaned_sample_t *z_reply_ok(const struct z_loaned_repl #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API bool z_reply_replier_id(const struct z_loaned_reply_t *this_, - struct z_id_t *out_id); + z_id_t *out_id); #endif /** * Constructs send and recieve ends of the ring channel @@ -3671,7 +3884,7 @@ enum z_reliability_t z_sample_reliability(const struct z_loaned_sample_t *this_) */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const struct z_loaned_source_info_t *z_sample_source_info(const struct z_loaned_sample_t *this_); +const z_loaned_source_info_t *z_sample_source_info(const struct z_loaned_sample_t *this_); #endif /** * Returns the sample timestamp. @@ -3697,20 +3910,27 @@ z_result_t z_scout(struct z_moved_config_t *config, */ ZENOHC_API void z_scout_options_default(struct z_scout_options_t *this_); /** - * Frees memory and invalidates the session. + * Closes and invalidates the session. */ ZENOHC_API void z_session_drop(struct z_moved_session_t *this_); +/** + * Checks if zenoh session is closed. + * + * @return `true` if session is closed, `false` otherwise. + */ +ZENOHC_API bool z_session_is_closed(const struct z_loaned_session_t *session); /** * Borrows session. */ ZENOHC_API const struct z_loaned_session_t *z_session_loan(const struct z_owned_session_t *this_); +ZENOHC_API struct z_loaned_session_t *z_session_loan_mut(struct z_owned_session_t *this_); /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Deletes SHM Client. */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_client_drop(struct z_moved_shm_client_t *this_); +void z_shm_client_drop(z_moved_shm_client_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3718,7 +3938,7 @@ void z_shm_client_drop(struct z_moved_shm_client_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_client_new(struct z_owned_shm_client_t *this_, +void z_shm_client_new(z_owned_shm_client_t *this_, struct zc_threadsafe_context_t context, struct zc_shm_client_callbacks_t callbacks); #endif @@ -3728,8 +3948,8 @@ void z_shm_client_new(struct z_owned_shm_client_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_client_storage_clone(struct z_owned_shm_client_storage_t *this_, - const struct z_loaned_shm_client_storage_t *from); +void z_shm_client_storage_clone(z_owned_shm_client_storage_t *this_, + const z_loaned_shm_client_storage_t *from); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3737,7 +3957,7 @@ void z_shm_client_storage_clone(struct z_owned_shm_client_storage_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_client_storage_drop(struct z_moved_shm_client_storage_t *this_); +void z_shm_client_storage_drop(z_moved_shm_client_storage_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3745,15 +3965,15 @@ void z_shm_client_storage_drop(struct z_moved_shm_client_storage_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const struct z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const struct z_owned_shm_client_storage_t *this_); +const z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const z_owned_shm_client_storage_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t z_shm_client_storage_new(struct z_owned_shm_client_storage_t *this_, - const struct zc_loaned_shm_client_list_t *clients, +z_result_t z_shm_client_storage_new(z_owned_shm_client_storage_t *this_, + const zc_loaned_shm_client_list_t *clients, bool add_default_client_set); #endif /** @@ -3761,7 +3981,7 @@ z_result_t z_shm_client_storage_new(struct z_owned_shm_client_storage_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_client_storage_new_default(struct z_owned_shm_client_storage_t *this_); +void z_shm_client_storage_new_default(z_owned_shm_client_storage_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3769,8 +3989,8 @@ void z_shm_client_storage_new_default(struct z_owned_shm_client_storage_t *this_ */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_clone(struct z_owned_shm_t *out, - const struct z_loaned_shm_t *this_); +void z_shm_clone(z_owned_shm_t *out, + const z_loaned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3778,7 +3998,7 @@ void z_shm_clone(struct z_owned_shm_t *out, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const unsigned char *z_shm_data(const struct z_loaned_shm_t *this_); +const unsigned char *z_shm_data(const z_loaned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3786,7 +4006,7 @@ const unsigned char *z_shm_data(const struct z_loaned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_drop(struct z_moved_shm_t *this_); +void z_shm_drop(z_moved_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3794,8 +4014,8 @@ void z_shm_drop(struct z_moved_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_from_mut(struct z_owned_shm_t *this_, - struct z_moved_shm_mut_t *that); +void z_shm_from_mut(z_owned_shm_t *this_, + z_moved_shm_mut_t *that); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3803,7 +4023,7 @@ void z_shm_from_mut(struct z_owned_shm_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -size_t z_shm_len(const struct z_loaned_shm_t *this_); +size_t z_shm_len(const z_loaned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3811,13 +4031,13 @@ size_t z_shm_len(const struct z_loaned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const struct z_loaned_shm_t *z_shm_loan(const struct z_owned_shm_t *this_); +const z_loaned_shm_t *z_shm_loan(const z_owned_shm_t *this_); #endif /** * @brief Mutably borrows ZShm slice. */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -ZENOHC_API struct z_loaned_shm_t *z_shm_loan_mut(struct z_owned_shm_t *this_); +ZENOHC_API z_loaned_shm_t *z_shm_loan_mut(z_owned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3825,7 +4045,7 @@ ZENOHC_API struct z_loaned_shm_t *z_shm_loan_mut(struct z_owned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const unsigned char *z_shm_mut_data(const struct z_loaned_shm_mut_t *this_); +const unsigned char *z_shm_mut_data(const z_loaned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3833,7 +4053,7 @@ const unsigned char *z_shm_mut_data(const struct z_loaned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -unsigned char *z_shm_mut_data_mut(struct z_loaned_shm_mut_t *this_); +unsigned char *z_shm_mut_data_mut(z_loaned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3841,7 +4061,7 @@ unsigned char *z_shm_mut_data_mut(struct z_loaned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_mut_drop(struct z_moved_shm_mut_t *this_); +void z_shm_mut_drop(z_moved_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3849,7 +4069,7 @@ void z_shm_mut_drop(struct z_moved_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -size_t z_shm_mut_len(const struct z_loaned_shm_mut_t *this_); +size_t z_shm_mut_len(const z_loaned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3857,7 +4077,7 @@ size_t z_shm_mut_len(const struct z_loaned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const struct z_loaned_shm_mut_t *z_shm_mut_loan(const struct z_owned_shm_mut_t *this_); +const z_loaned_shm_mut_t *z_shm_mut_loan(const z_owned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3865,7 +4085,7 @@ const struct z_loaned_shm_mut_t *z_shm_mut_loan(const struct z_owned_shm_mut_t * */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -struct z_loaned_shm_mut_t *z_shm_mut_loan_mut(struct z_owned_shm_mut_t *this_); +z_loaned_shm_mut_t *z_shm_mut_loan_mut(z_owned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3879,9 +4099,9 @@ struct z_loaned_shm_mut_t *z_shm_mut_loan_mut(struct z_owned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t z_shm_mut_try_from_immut(struct z_owned_shm_mut_t *this_, - struct z_moved_shm_t *that, - struct z_owned_shm_t *immut); +z_result_t z_shm_mut_try_from_immut(z_owned_shm_mut_t *this_, + z_moved_shm_t *that, + z_owned_shm_t *immut); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3889,7 +4109,7 @@ z_result_t z_shm_mut_try_from_immut(struct z_owned_shm_mut_t *this_, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_shm_provider_alloc(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -3899,7 +4119,7 @@ void z_shm_provider_alloc(struct z_buf_layout_alloc_result_t *out_result, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_shm_provider_alloc_gc(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -3909,7 +4129,7 @@ void z_shm_provider_alloc_gc(struct z_buf_layout_alloc_result_t *out_result, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_shm_provider_alloc_gc_defrag(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -3919,7 +4139,7 @@ void z_shm_provider_alloc_gc_defrag(struct z_buf_layout_alloc_result_t *out_resu #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment, struct zc_threadsafe_context_t result_context, @@ -3932,7 +4152,7 @@ z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_shm_provider_alloc_gc_defrag_blocking(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -3942,7 +4162,7 @@ void z_shm_provider_alloc_gc_defrag_blocking(struct z_buf_layout_alloc_result_t #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API void z_shm_provider_alloc_gc_defrag_dealloc(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -3951,14 +4171,14 @@ void z_shm_provider_alloc_gc_defrag_dealloc(struct z_buf_layout_alloc_result_t * */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -size_t z_shm_provider_available(const struct z_loaned_shm_provider_t *provider); +size_t z_shm_provider_available(const z_loaned_shm_provider_t *provider); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -size_t z_shm_provider_defragment(const struct z_loaned_shm_provider_t *provider); +size_t z_shm_provider_defragment(const z_loaned_shm_provider_t *provider); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3966,14 +4186,14 @@ size_t z_shm_provider_defragment(const struct z_loaned_shm_provider_t *provider) */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_provider_drop(struct z_moved_shm_provider_t *this_); +void z_shm_provider_drop(z_moved_shm_provider_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -size_t z_shm_provider_garbage_collect(const struct z_loaned_shm_provider_t *provider); +size_t z_shm_provider_garbage_collect(const z_loaned_shm_provider_t *provider); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3981,15 +4201,15 @@ size_t z_shm_provider_garbage_collect(const struct z_loaned_shm_provider_t *prov */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const struct z_loaned_shm_provider_t *z_shm_provider_loan(const struct z_owned_shm_provider_t *this_); +const z_loaned_shm_provider_t *z_shm_provider_loan(const z_owned_shm_provider_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t z_shm_provider_map(struct z_owned_shm_mut_t *out_result, - const struct z_loaned_shm_provider_t *provider, +z_result_t z_shm_provider_map(z_owned_shm_mut_t *out_result, + const z_loaned_shm_provider_t *provider, struct z_allocated_chunk_t allocated_chunk, size_t len); #endif @@ -3999,7 +4219,7 @@ z_result_t z_shm_provider_map(struct z_owned_shm_mut_t *out_result, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_provider_new(struct z_owned_shm_provider_t *this_, +void z_shm_provider_new(z_owned_shm_provider_t *this_, z_protocol_id_t id, struct zc_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); @@ -4010,7 +4230,7 @@ void z_shm_provider_new(struct z_owned_shm_provider_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_provider_threadsafe_new(struct z_owned_shm_provider_t *this_, +void z_shm_provider_threadsafe_new(z_owned_shm_provider_t *this_, z_protocol_id_t id, struct zc_threadsafe_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); @@ -4021,7 +4241,7 @@ void z_shm_provider_threadsafe_new(struct z_owned_shm_provider_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -struct z_loaned_shm_mut_t *z_shm_try_mut(struct z_owned_shm_t *this_); +z_loaned_shm_mut_t *z_shm_try_mut(z_owned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4029,7 +4249,7 @@ struct z_loaned_shm_mut_t *z_shm_try_mut(struct z_owned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -struct z_loaned_shm_mut_t *z_shm_try_reloan_mut(struct z_loaned_shm_t *this_); +z_loaned_shm_mut_t *z_shm_try_reloan_mut(z_loaned_shm_t *this_); #endif /** * Puts current thread to sleep for specified amount of milliseconds. @@ -4102,7 +4322,7 @@ ZENOHC_API const struct z_loaned_slice_t *z_slice_loan(const struct z_owned_slic */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void z_source_info_drop(struct z_moved_source_info_t *this_); +void z_source_info_drop(z_moved_source_info_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4110,7 +4330,7 @@ void z_source_info_drop(struct z_moved_source_info_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -struct z_entity_global_id_t z_source_info_id(const struct z_loaned_source_info_t *this_); +z_entity_global_id_t z_source_info_id(const z_loaned_source_info_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4118,7 +4338,7 @@ struct z_entity_global_id_t z_source_info_id(const struct z_loaned_source_info_t */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const struct z_loaned_source_info_t *z_source_info_loan(const struct z_owned_source_info_t *this_); +const z_loaned_source_info_t *z_source_info_loan(const z_owned_source_info_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4126,8 +4346,8 @@ const struct z_loaned_source_info_t *z_source_info_loan(const struct z_owned_sou */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t z_source_info_new(struct z_owned_source_info_t *this_, - const struct z_entity_global_id_t *source_id, +z_result_t z_source_info_new(z_owned_source_info_t *this_, + const z_entity_global_id_t *source_id, uint32_t source_sn); #endif /** @@ -4136,7 +4356,7 @@ z_result_t z_source_info_new(struct z_owned_source_info_t *this_, */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -uint32_t z_source_info_sn(const struct z_loaned_source_info_t *this_); +uint32_t z_source_info_sn(const z_loaned_source_info_t *this_); #endif /** * Constructs an owned copy of a string array. @@ -4330,7 +4550,7 @@ const char *z_time_now_as_str(const char *buf, */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -struct z_id_t z_timestamp_id(const struct z_timestamp_t *this_); +z_id_t z_timestamp_id(const struct z_timestamp_t *this_); #endif /** * Create uhlc timestamp from session id. @@ -4723,7 +4943,7 @@ void zc_internal_closure_matching_status_null(struct zc_owned_closure_matching_s */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -bool zc_internal_liveliness_token_check(const struct zc_owned_liveliness_token_t *this_); +bool zc_internal_liveliness_token_check(const zc_owned_liveliness_token_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4731,7 +4951,7 @@ bool zc_internal_liveliness_token_check(const struct zc_owned_liveliness_token_t */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void zc_internal_liveliness_token_null(struct zc_owned_liveliness_token_t *this_); +void zc_internal_liveliness_token_null(zc_owned_liveliness_token_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4739,7 +4959,7 @@ void zc_internal_liveliness_token_null(struct zc_owned_liveliness_token_t *this_ */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -bool zc_internal_matching_listener_check(const struct zc_owned_matching_listener_t *this_); +bool zc_internal_matching_listener_check(const zc_owned_matching_listener_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4747,7 +4967,7 @@ bool zc_internal_matching_listener_check(const struct zc_owned_matching_listener */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void zc_internal_matching_listener_null(struct zc_owned_matching_listener_t *this_); +void zc_internal_matching_listener_null(zc_owned_matching_listener_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4755,7 +4975,7 @@ void zc_internal_matching_listener_null(struct zc_owned_matching_listener_t *thi */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool zc_internal_shm_client_list_check(const struct zc_owned_shm_client_list_t *this_); +bool zc_internal_shm_client_list_check(const zc_owned_shm_client_list_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4763,7 +4983,7 @@ bool zc_internal_shm_client_list_check(const struct zc_owned_shm_client_list_t * */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void zc_internal_shm_client_list_null(struct zc_owned_shm_client_list_t *this_); +void zc_internal_shm_client_list_null(zc_owned_shm_client_list_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4807,7 +5027,7 @@ z_result_t zc_liveliness_declare_subscriber(struct z_owned_subscriber_t *this_, */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t zc_liveliness_declare_token(struct zc_owned_liveliness_token_t *this_, +z_result_t zc_liveliness_declare_token(zc_owned_liveliness_token_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, const struct zc_liveliness_declaration_options_t *_options); @@ -4850,7 +5070,7 @@ void zc_liveliness_subscriber_options_default(struct zc_liveliness_subscriber_op */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void zc_liveliness_token_drop(struct zc_moved_liveliness_token_t *this_); +void zc_liveliness_token_drop(zc_moved_liveliness_token_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4858,7 +5078,7 @@ void zc_liveliness_token_drop(struct zc_moved_liveliness_token_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const struct zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const struct zc_owned_liveliness_token_t *this_); +const zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const zc_owned_liveliness_token_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4866,7 +5086,7 @@ const struct zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const struct */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t zc_liveliness_undeclare_token(struct zc_moved_liveliness_token_t *this_); +z_result_t zc_liveliness_undeclare_token(zc_moved_liveliness_token_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4899,7 +5119,7 @@ z_result_t zc_publisher_get_matching_status(const struct z_loaned_publisher_t *t */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t zc_publisher_matching_listener_declare(struct zc_owned_matching_listener_t *this_, +z_result_t zc_publisher_matching_listener_declare(zc_owned_matching_listener_t *this_, const struct z_loaned_publisher_t *publisher, struct zc_moved_closure_matching_status_t *callback); #endif @@ -4909,7 +5129,7 @@ z_result_t zc_publisher_matching_listener_declare(struct zc_owned_matching_liste */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void zc_publisher_matching_listener_drop(struct zc_moved_matching_listener_t *this_); +void zc_publisher_matching_listener_drop(zc_moved_matching_listener_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4919,7 +5139,7 @@ void zc_publisher_matching_listener_drop(struct zc_moved_matching_listener_t *th */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t zc_publisher_matching_listener_undeclare(struct zc_moved_matching_listener_t *this_); +z_result_t zc_publisher_matching_listener_undeclare(zc_moved_matching_listener_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4934,9 +5154,9 @@ enum zc_reply_keyexpr_t zc_reply_keyexpr_default(void); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t zc_shm_client_list_add_client(struct zc_loaned_shm_client_list_t *this_, +z_result_t zc_shm_client_list_add_client(zc_loaned_shm_client_list_t *this_, z_protocol_id_t id, - struct z_moved_shm_client_t *client); + z_moved_shm_client_t *client); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4944,7 +5164,7 @@ z_result_t zc_shm_client_list_add_client(struct zc_loaned_shm_client_list_t *thi */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void zc_shm_client_list_drop(struct zc_moved_shm_client_list_t *this_); +void zc_shm_client_list_drop(zc_moved_shm_client_list_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4952,7 +5172,7 @@ void zc_shm_client_list_drop(struct zc_moved_shm_client_list_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const struct zc_owned_shm_client_list_t *this_); +const zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const zc_owned_shm_client_list_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4960,7 +5180,7 @@ const struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const struct z */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(struct zc_owned_shm_client_list_t *this_); +zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(zc_owned_shm_client_list_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4968,7 +5188,7 @@ struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(struct zc_owned_ */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void zc_shm_client_list_new(struct zc_owned_shm_client_list_t *this_); +void zc_shm_client_list_new(zc_owned_shm_client_list_t *this_); #endif /** * Stops all Zenoh tasks and drops all related static variables. @@ -5000,7 +5220,7 @@ void zc_try_init_log_from_env(void); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t ze_declare_publication_cache(struct ze_owned_publication_cache_t *this_, +z_result_t ze_declare_publication_cache(ze_owned_publication_cache_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, struct ze_publication_cache_options_t *options); @@ -5019,7 +5239,7 @@ z_result_t ze_declare_publication_cache(struct ze_owned_publication_cache_t *thi */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t ze_declare_querying_subscriber(struct ze_owned_querying_subscriber_t *this_, +z_result_t ze_declare_querying_subscriber(ze_owned_querying_subscriber_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, struct z_moved_closure_sample_t *callback, @@ -5194,7 +5414,7 @@ ZENOHC_API bool ze_deserializer_is_done(const struct ze_deserializer_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -bool ze_internal_publication_cache_check(const struct ze_owned_publication_cache_t *this_); +bool ze_internal_publication_cache_check(const ze_owned_publication_cache_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5202,7 +5422,7 @@ bool ze_internal_publication_cache_check(const struct ze_owned_publication_cache */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void ze_internal_publication_cache_null(struct ze_owned_publication_cache_t *this_); +void ze_internal_publication_cache_null(ze_owned_publication_cache_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5210,13 +5430,13 @@ void ze_internal_publication_cache_null(struct ze_owned_publication_cache_t *thi */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -bool ze_internal_querying_subscriber_check(const struct ze_owned_querying_subscriber_t *this_); +bool ze_internal_querying_subscriber_check(const ze_owned_querying_subscriber_t *this_); #endif /** * Constructs a querying subscriber in a gravestone state. */ #if defined(Z_FEATURE_UNSTABLE_API) -ZENOHC_API void ze_internal_querying_subscriber_null(struct ze_owned_querying_subscriber_t *this_); +ZENOHC_API void ze_internal_querying_subscriber_null(ze_owned_querying_subscriber_t *this_); #endif /** * @brief Returns ``true`` if `this_` is in a valid state, ``false`` if it is in a gravestone state. @@ -5232,7 +5452,7 @@ ZENOHC_API void ze_internal_serializer_null(struct ze_owned_serializer_t *this_) */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void ze_publication_cache_drop(struct ze_moved_publication_cache_t *this_); +void ze_publication_cache_drop(ze_moved_publication_cache_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5240,7 +5460,7 @@ void ze_publication_cache_drop(struct ze_moved_publication_cache_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const struct z_loaned_keyexpr_t *ze_publication_cache_keyexpr(const struct ze_loaned_publication_cache_t *this_); +const struct z_loaned_keyexpr_t *ze_publication_cache_keyexpr(const ze_loaned_publication_cache_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5248,7 +5468,7 @@ const struct z_loaned_keyexpr_t *ze_publication_cache_keyexpr(const struct ze_lo */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const struct ze_loaned_publication_cache_t *ze_publication_cache_loan(const struct ze_owned_publication_cache_t *this_); +const ze_loaned_publication_cache_t *ze_publication_cache_loan(const ze_owned_publication_cache_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5265,7 +5485,7 @@ void ze_publication_cache_options_default(struct ze_publication_cache_options_t */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_t *this_); +void ze_querying_subscriber_drop(ze_moved_querying_subscriber_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5275,7 +5495,7 @@ void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t ze_querying_subscriber_get(const struct ze_loaned_querying_subscriber_t *this_, +z_result_t ze_querying_subscriber_get(const ze_loaned_querying_subscriber_t *this_, const struct z_loaned_keyexpr_t *selector, struct z_get_options_t *options); #endif @@ -5285,7 +5505,7 @@ z_result_t ze_querying_subscriber_get(const struct ze_loaned_querying_subscriber */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const struct ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const struct ze_owned_querying_subscriber_t *this_); +const ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const ze_owned_querying_subscriber_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5472,7 +5692,7 @@ ZENOHC_API void ze_serializer_serialize_uint8(struct ze_loaned_serializer_t *thi */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t ze_undeclare_publication_cache(struct ze_moved_publication_cache_t *this_); +z_result_t ze_undeclare_publication_cache(ze_moved_publication_cache_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5482,5 +5702,5 @@ z_result_t ze_undeclare_publication_cache(struct ze_moved_publication_cache_t *t */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t ze_undeclare_querying_subscriber(struct ze_moved_querying_subscriber_t *this_); +z_result_t ze_undeclare_querying_subscriber(ze_moved_querying_subscriber_t *this_); #endif diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index 8af1d062b..0782ee0a6 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -4,15 +4,12 @@ #ifndef __cplusplus -static inline z_moved_alloc_layout_t* z_alloc_layout_move(z_owned_alloc_layout_t* x) { return (z_moved_alloc_layout_t*)(x); } static inline z_moved_bytes_t* z_bytes_move(z_owned_bytes_t* x) { return (z_moved_bytes_t*)(x); } static inline z_moved_bytes_writer_t* z_bytes_writer_move(z_owned_bytes_writer_t* x) { return (z_moved_bytes_writer_t*)(x); } -static inline z_moved_chunk_alloc_result_t* z_chunk_alloc_result_move(z_owned_chunk_alloc_result_t* x) { return (z_moved_chunk_alloc_result_t*)(x); } static inline z_moved_closure_hello_t* z_closure_hello_move(z_owned_closure_hello_t* x) { return (z_moved_closure_hello_t*)(x); } static inline z_moved_closure_query_t* z_closure_query_move(z_owned_closure_query_t* x) { return (z_moved_closure_query_t*)(x); } static inline z_moved_closure_reply_t* z_closure_reply_move(z_owned_closure_reply_t* x) { return (z_moved_closure_reply_t*)(x); } static inline z_moved_closure_sample_t* z_closure_sample_move(z_owned_closure_sample_t* x) { return (z_moved_closure_sample_t*)(x); } -static inline z_moved_closure_zid_t* z_closure_zid_move(z_owned_closure_zid_t* x) { return (z_moved_closure_zid_t*)(x); } static inline z_moved_condvar_t* z_condvar_move(z_owned_condvar_t* x) { return (z_moved_condvar_t*)(x); } static inline z_moved_config_t* z_config_move(z_owned_config_t* x) { return (z_moved_config_t*)(x); } static inline z_moved_encoding_t* z_encoding_move(z_owned_encoding_t* x) { return (z_moved_encoding_t*)(x); } @@ -21,7 +18,6 @@ static inline z_moved_fifo_handler_reply_t* z_fifo_handler_reply_move(z_owned_fi static inline z_moved_fifo_handler_sample_t* z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return (z_moved_fifo_handler_sample_t*)(x); } static inline z_moved_hello_t* z_hello_move(z_owned_hello_t* x) { return (z_moved_hello_t*)(x); } static inline z_moved_keyexpr_t* z_keyexpr_move(z_owned_keyexpr_t* x) { return (z_moved_keyexpr_t*)(x); } -static inline z_moved_memory_layout_t* z_memory_layout_move(z_owned_memory_layout_t* x) { return (z_moved_memory_layout_t*)(x); } static inline z_moved_mutex_t* z_mutex_move(z_owned_mutex_t* x) { return (z_moved_mutex_t*)(x); } static inline z_moved_publisher_t* z_publisher_move(z_owned_publisher_t* x) { return (z_moved_publisher_t*)(x); } static inline z_moved_query_t* z_query_move(z_owned_query_t* x) { return (z_moved_query_t*)(x); } @@ -33,38 +29,23 @@ static inline z_moved_ring_handler_reply_t* z_ring_handler_reply_move(z_owned_ri static inline z_moved_ring_handler_sample_t* z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return (z_moved_ring_handler_sample_t*)(x); } static inline z_moved_sample_t* z_sample_move(z_owned_sample_t* x) { return (z_moved_sample_t*)(x); } static inline z_moved_session_t* z_session_move(z_owned_session_t* x) { return (z_moved_session_t*)(x); } -static inline z_moved_shm_client_t* z_shm_client_move(z_owned_shm_client_t* x) { return (z_moved_shm_client_t*)(x); } -static inline z_moved_shm_client_storage_t* z_shm_client_storage_move(z_owned_shm_client_storage_t* x) { return (z_moved_shm_client_storage_t*)(x); } -static inline z_moved_shm_t* z_shm_move(z_owned_shm_t* x) { return (z_moved_shm_t*)(x); } -static inline z_moved_shm_mut_t* z_shm_mut_move(z_owned_shm_mut_t* x) { return (z_moved_shm_mut_t*)(x); } -static inline z_moved_shm_provider_t* z_shm_provider_move(z_owned_shm_provider_t* x) { return (z_moved_shm_provider_t*)(x); } static inline z_moved_slice_t* z_slice_move(z_owned_slice_t* x) { return (z_moved_slice_t*)(x); } -static inline z_moved_source_info_t* z_source_info_move(z_owned_source_info_t* x) { return (z_moved_source_info_t*)(x); } static inline z_moved_string_array_t* z_string_array_move(z_owned_string_array_t* x) { return (z_moved_string_array_t*)(x); } static inline z_moved_string_t* z_string_move(z_owned_string_t* x) { return (z_moved_string_t*)(x); } static inline z_moved_subscriber_t* z_subscriber_move(z_owned_subscriber_t* x) { return (z_moved_subscriber_t*)(x); } static inline z_moved_task_t* z_task_move(z_owned_task_t* x) { return (z_moved_task_t*)(x); } static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t* x) { return (zc_moved_closure_log_t*)(x); } -static inline zc_moved_closure_matching_status_t* zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return (zc_moved_closure_matching_status_t*)(x); } -static inline zc_moved_liveliness_token_t* zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return (zc_moved_liveliness_token_t*)(x); } -static inline zc_moved_matching_listener_t* zc_publisher_matching_listener_move(zc_owned_matching_listener_t* x) { return (zc_moved_matching_listener_t*)(x); } -static inline zc_moved_shm_client_list_t* zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return (zc_moved_shm_client_list_t*)(x); } -static inline ze_moved_publication_cache_t* ze_publication_cache_move(ze_owned_publication_cache_t* x) { return (ze_moved_publication_cache_t*)(x); } -static inline ze_moved_querying_subscriber_t* ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return (ze_moved_querying_subscriber_t*)(x); } static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x) { return (ze_moved_serializer_t*)(x); } #define z_loan(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t : z_alloc_layout_loan, \ z_owned_bytes_t : z_bytes_loan, \ z_owned_bytes_writer_t : z_bytes_writer_loan, \ - z_owned_chunk_alloc_result_t : z_chunk_alloc_result_loan, \ z_owned_closure_hello_t : z_closure_hello_loan, \ z_owned_closure_query_t : z_closure_query_loan, \ z_owned_closure_reply_t : z_closure_reply_loan, \ z_owned_closure_sample_t : z_closure_sample_loan, \ - z_owned_closure_zid_t : z_closure_zid_loan, \ z_owned_condvar_t : z_condvar_loan, \ z_owned_config_t : z_config_loan, \ z_owned_encoding_t : z_encoding_loan, \ @@ -73,7 +54,6 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_fifo_handler_sample_t : z_fifo_handler_sample_loan, \ z_owned_hello_t : z_hello_loan, \ z_owned_keyexpr_t : z_keyexpr_loan, \ - z_owned_memory_layout_t : z_memory_layout_loan, \ z_owned_publisher_t : z_publisher_loan, \ z_owned_query_t : z_query_loan, \ z_owned_queryable_t : z_queryable_loan, \ @@ -84,12 +64,7 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_ring_handler_sample_t : z_ring_handler_sample_loan, \ z_owned_sample_t : z_sample_loan, \ z_owned_session_t : z_session_loan, \ - z_owned_shm_client_storage_t : z_shm_client_storage_loan, \ - z_owned_shm_t : z_shm_loan, \ - z_owned_shm_mut_t : z_shm_mut_loan, \ - z_owned_shm_provider_t : z_shm_provider_loan, \ z_owned_slice_t : z_slice_loan, \ - z_owned_source_info_t : z_source_info_loan, \ z_owned_string_array_t : z_string_array_loan, \ z_owned_string_t : z_string_loan, \ z_owned_subscriber_t : z_subscriber_loan, \ @@ -97,11 +72,6 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_view_slice_t : z_view_slice_loan, \ z_view_string_t : z_view_string_loan, \ zc_owned_closure_log_t : zc_closure_log_loan, \ - zc_owned_closure_matching_status_t : zc_closure_matching_status_loan, \ - zc_owned_liveliness_token_t : zc_liveliness_token_loan, \ - zc_owned_shm_client_list_t : zc_shm_client_list_loan, \ - ze_owned_publication_cache_t : ze_publication_cache_loan, \ - ze_owned_querying_subscriber_t : ze_querying_subscriber_loan, \ ze_owned_serializer_t : ze_serializer_loan \ )(&this_) @@ -114,24 +84,19 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_encoding_t : z_encoding_loan_mut, \ z_owned_mutex_t : z_mutex_loan_mut, \ z_owned_publisher_t : z_publisher_loan_mut, \ - z_owned_shm_t : z_shm_loan_mut, \ - z_owned_shm_mut_t : z_shm_mut_loan_mut, \ + z_owned_session_t : z_session_loan_mut, \ z_owned_string_array_t : z_string_array_loan_mut, \ - zc_owned_shm_client_list_t : zc_shm_client_list_loan_mut, \ ze_owned_serializer_t : ze_serializer_loan_mut \ )(&this_) #define z_drop(this_) \ _Generic((this_), \ - z_moved_alloc_layout_t* : z_alloc_layout_drop, \ z_moved_bytes_t* : z_bytes_drop, \ z_moved_bytes_writer_t* : z_bytes_writer_drop, \ - z_moved_chunk_alloc_result_t* : z_chunk_alloc_result_drop, \ z_moved_closure_hello_t* : z_closure_hello_drop, \ z_moved_closure_query_t* : z_closure_query_drop, \ z_moved_closure_reply_t* : z_closure_reply_drop, \ z_moved_closure_sample_t* : z_closure_sample_drop, \ - z_moved_closure_zid_t* : z_closure_zid_drop, \ z_moved_condvar_t* : z_condvar_drop, \ z_moved_config_t* : z_config_drop, \ z_moved_encoding_t* : z_encoding_drop, \ @@ -140,7 +105,6 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_moved_fifo_handler_sample_t* : z_fifo_handler_sample_drop, \ z_moved_hello_t* : z_hello_drop, \ z_moved_keyexpr_t* : z_keyexpr_drop, \ - z_moved_memory_layout_t* : z_memory_layout_drop, \ z_moved_mutex_t* : z_mutex_drop, \ z_moved_publisher_t* : z_publisher_drop, \ z_moved_query_t* : z_query_drop, \ @@ -152,38 +116,23 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_moved_ring_handler_sample_t* : z_ring_handler_sample_drop, \ z_moved_sample_t* : z_sample_drop, \ z_moved_session_t* : z_session_drop, \ - z_moved_shm_client_t* : z_shm_client_drop, \ - z_moved_shm_client_storage_t* : z_shm_client_storage_drop, \ - z_moved_shm_t* : z_shm_drop, \ - z_moved_shm_mut_t* : z_shm_mut_drop, \ - z_moved_shm_provider_t* : z_shm_provider_drop, \ z_moved_slice_t* : z_slice_drop, \ - z_moved_source_info_t* : z_source_info_drop, \ z_moved_string_array_t* : z_string_array_drop, \ z_moved_string_t* : z_string_drop, \ z_moved_subscriber_t* : z_subscriber_drop, \ z_moved_task_t* : z_task_drop, \ zc_moved_closure_log_t* : zc_closure_log_drop, \ - zc_moved_closure_matching_status_t* : zc_closure_matching_status_drop, \ - zc_moved_liveliness_token_t* : zc_liveliness_token_drop, \ - zc_moved_matching_listener_t* : zc_publisher_matching_listener_drop, \ - zc_moved_shm_client_list_t* : zc_shm_client_list_drop, \ - ze_moved_publication_cache_t* : ze_publication_cache_drop, \ - ze_moved_querying_subscriber_t* : ze_querying_subscriber_drop, \ ze_moved_serializer_t* : ze_serializer_drop \ )(this_) #define z_move(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t : z_alloc_layout_move, \ z_owned_bytes_t : z_bytes_move, \ z_owned_bytes_writer_t : z_bytes_writer_move, \ - z_owned_chunk_alloc_result_t : z_chunk_alloc_result_move, \ z_owned_closure_hello_t : z_closure_hello_move, \ z_owned_closure_query_t : z_closure_query_move, \ z_owned_closure_reply_t : z_closure_reply_move, \ z_owned_closure_sample_t : z_closure_sample_move, \ - z_owned_closure_zid_t : z_closure_zid_move, \ z_owned_condvar_t : z_condvar_move, \ z_owned_config_t : z_config_move, \ z_owned_encoding_t : z_encoding_move, \ @@ -192,7 +141,6 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_fifo_handler_sample_t : z_fifo_handler_sample_move, \ z_owned_hello_t : z_hello_move, \ z_owned_keyexpr_t : z_keyexpr_move, \ - z_owned_memory_layout_t : z_memory_layout_move, \ z_owned_mutex_t : z_mutex_move, \ z_owned_publisher_t : z_publisher_move, \ z_owned_query_t : z_query_move, \ @@ -204,38 +152,23 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_ring_handler_sample_t : z_ring_handler_sample_move, \ z_owned_sample_t : z_sample_move, \ z_owned_session_t : z_session_move, \ - z_owned_shm_client_t : z_shm_client_move, \ - z_owned_shm_client_storage_t : z_shm_client_storage_move, \ - z_owned_shm_t : z_shm_move, \ - z_owned_shm_mut_t : z_shm_mut_move, \ - z_owned_shm_provider_t : z_shm_provider_move, \ z_owned_slice_t : z_slice_move, \ - z_owned_source_info_t : z_source_info_move, \ z_owned_string_array_t : z_string_array_move, \ z_owned_string_t : z_string_move, \ z_owned_subscriber_t : z_subscriber_move, \ z_owned_task_t : z_task_move, \ zc_owned_closure_log_t : zc_closure_log_move, \ - zc_owned_closure_matching_status_t : zc_closure_matching_status_move, \ - zc_owned_liveliness_token_t : zc_liveliness_token_move, \ - zc_owned_matching_listener_t : zc_publisher_matching_listener_move, \ - zc_owned_shm_client_list_t : zc_shm_client_list_move, \ - ze_owned_publication_cache_t : ze_publication_cache_move, \ - ze_owned_querying_subscriber_t : ze_querying_subscriber_move, \ ze_owned_serializer_t : ze_serializer_move \ )(&this_) #define z_internal_null(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t* : z_internal_alloc_layout_null, \ z_owned_bytes_t* : z_internal_bytes_null, \ z_owned_bytes_writer_t* : z_internal_bytes_writer_null, \ - z_owned_chunk_alloc_result_t* : z_internal_chunk_alloc_result_null, \ z_owned_closure_hello_t* : z_internal_closure_hello_null, \ z_owned_closure_query_t* : z_internal_closure_query_null, \ z_owned_closure_reply_t* : z_internal_closure_reply_null, \ z_owned_closure_sample_t* : z_internal_closure_sample_null, \ - z_owned_closure_zid_t* : z_internal_closure_zid_null, \ z_owned_condvar_t* : z_internal_condvar_null, \ z_owned_config_t* : z_internal_config_null, \ z_owned_encoding_t* : z_internal_encoding_null, \ @@ -244,7 +177,6 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_fifo_handler_sample_t* : z_internal_fifo_handler_sample_null, \ z_owned_hello_t* : z_internal_hello_null, \ z_owned_keyexpr_t* : z_internal_keyexpr_null, \ - z_owned_memory_layout_t* : z_internal_memory_layout_null, \ z_owned_mutex_t* : z_internal_mutex_null, \ z_owned_publisher_t* : z_internal_publisher_null, \ z_owned_query_t* : z_internal_query_null, \ @@ -256,36 +188,21 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_ring_handler_sample_t* : z_internal_ring_handler_sample_null, \ z_owned_sample_t* : z_internal_sample_null, \ z_owned_session_t* : z_internal_session_null, \ - z_owned_shm_client_t* : z_internal_shm_client_null, \ - z_owned_shm_client_storage_t* : z_internal_shm_client_storage_null, \ - z_owned_shm_mut_t* : z_internal_shm_mut_null, \ - z_owned_shm_t* : z_internal_shm_null, \ - z_owned_shm_provider_t* : z_internal_shm_provider_null, \ z_owned_slice_t* : z_internal_slice_null, \ - z_owned_source_info_t* : z_internal_source_info_null, \ z_owned_string_array_t* : z_internal_string_array_null, \ z_owned_string_t* : z_internal_string_null, \ z_owned_subscriber_t* : z_internal_subscriber_null, \ z_owned_task_t* : z_internal_task_null, \ zc_owned_closure_log_t* : zc_internal_closure_log_null, \ - zc_owned_closure_matching_status_t* : zc_internal_closure_matching_status_null, \ - zc_owned_liveliness_token_t* : zc_internal_liveliness_token_null, \ - zc_owned_matching_listener_t* : zc_internal_matching_listener_null, \ - zc_owned_shm_client_list_t* : zc_internal_shm_client_list_null, \ - ze_owned_publication_cache_t* : ze_internal_publication_cache_null, \ - ze_owned_querying_subscriber_t* : ze_internal_querying_subscriber_null, \ ze_owned_serializer_t* : ze_internal_serializer_null \ )(this_) -static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t* x) { *this_ = x->_this; z_internal_alloc_layout_null(&x->_this); } static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { *this_ = x->_this; z_internal_bytes_null(&x->_this); } static inline void z_bytes_writer_take(z_owned_bytes_writer_t* this_, z_moved_bytes_writer_t* x) { *this_ = x->_this; z_internal_bytes_writer_null(&x->_this); } -static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t* x) { *this_ = x->_this; z_internal_chunk_alloc_result_null(&x->_this); } static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { *this_ = x->_this; z_internal_closure_hello_null(&x->_this); } static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { *closure_ = x->_this; z_internal_closure_query_null(&x->_this); } static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { *closure_ = x->_this; z_internal_closure_reply_null(&x->_this); } static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { *closure_ = x->_this; z_internal_closure_sample_null(&x->_this); } -static inline void z_closure_zid_take(z_owned_closure_zid_t* closure_, z_moved_closure_zid_t* x) { *closure_ = x->_this; z_internal_closure_zid_null(&x->_this); } static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { *this_ = x->_this; z_internal_condvar_null(&x->_this); } static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t* x) { *this_ = x->_this; z_internal_config_null(&x->_this); } static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t* x) { *this_ = x->_this; z_internal_encoding_null(&x->_this); } @@ -294,7 +211,6 @@ static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_ static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { *this_ = x->_this; z_internal_fifo_handler_sample_null(&x->_this); } static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *this_ = x->_this; z_internal_hello_null(&x->_this); } static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_internal_keyexpr_null(&x->_this); } -static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t* x) { *this_ = x->_this; z_internal_memory_layout_null(&x->_this); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_internal_mutex_null(&x->_this); } static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_internal_publisher_null(&x->_this); } static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_internal_query_null(&x->_this); } @@ -306,38 +222,23 @@ static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_ static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { *this_ = x->_this; z_internal_ring_handler_sample_null(&x->_this); } static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t* x) { *this_ = x->_this; z_internal_sample_null(&x->_this); } static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t* x) { *this_ = x->_this; z_internal_session_null(&x->_this); } -static inline void z_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t* x) { *this_ = x->_this; z_internal_shm_client_null(&x->_this); } -static inline void z_shm_client_storage_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t* x) { *this_ = x->_this; z_internal_shm_client_storage_null(&x->_this); } -static inline void z_shm_take(z_owned_shm_t* this_, z_moved_shm_t* x) { *this_ = x->_this; z_internal_shm_null(&x->_this); } -static inline void z_shm_mut_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t* x) { *this_ = x->_this; z_internal_shm_mut_null(&x->_this); } -static inline void z_shm_provider_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t* x) { *this_ = x->_this; z_internal_shm_provider_null(&x->_this); } static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t* x) { *this_ = x->_this; z_internal_slice_null(&x->_this); } -static inline void z_source_info_take(z_owned_source_info_t* this_, z_moved_source_info_t* x) { *this_ = x->_this; z_internal_source_info_null(&x->_this); } static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { *this_ = x->_this; z_internal_string_array_null(&x->_this); } static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t* x) { *this_ = x->_this; z_internal_string_null(&x->_this); } static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { *this_ = x->_this; z_internal_subscriber_null(&x->_this); } static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t* x) { *this_ = x->_this; z_internal_task_null(&x->_this); } static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { *closure_ = x->_this; zc_internal_closure_log_null(&x->_this); } -static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure_, zc_moved_closure_matching_status_t* x) { *closure_ = x->_this; zc_internal_closure_matching_status_null(&x->_this); } -static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t* x) { *this_ = x->_this; zc_internal_liveliness_token_null(&x->_this); } -static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t* x) { *this_ = x->_this; zc_internal_matching_listener_null(&x->_this); } -static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t* x) { *this_ = x->_this; zc_internal_shm_client_list_null(&x->_this); } -static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t* x) { *this_ = x->_this; ze_internal_publication_cache_null(&x->_this); } -static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t* x) { *this_ = x->_this; ze_internal_querying_subscriber_null(&x->_this); } static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_serializer_t* x) { *this_ = x->_this; ze_internal_serializer_null(&x->_this); } #define z_take(this_, x) \ _Generic((this_), \ - z_owned_alloc_layout_t* : z_alloc_layout_take, \ z_owned_bytes_t* : z_bytes_take, \ z_owned_bytes_writer_t* : z_bytes_writer_take, \ - z_owned_chunk_alloc_result_t* : z_chunk_alloc_result_take, \ z_owned_closure_hello_t* : z_closure_hello_take, \ z_owned_closure_query_t* : z_closure_query_take, \ z_owned_closure_reply_t* : z_closure_reply_take, \ z_owned_closure_sample_t* : z_closure_sample_take, \ - z_owned_closure_zid_t* : z_closure_zid_take, \ z_owned_condvar_t* : z_condvar_take, \ z_owned_config_t* : z_config_take, \ z_owned_encoding_t* : z_encoding_take, \ @@ -346,7 +247,6 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_take, \ z_owned_hello_t* : z_hello_take, \ z_owned_keyexpr_t* : z_keyexpr_take, \ - z_owned_memory_layout_t* : z_memory_layout_take, \ z_owned_mutex_t* : z_mutex_take, \ z_owned_publisher_t* : z_publisher_take, \ z_owned_query_t* : z_query_take, \ @@ -358,38 +258,23 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser z_owned_ring_handler_sample_t* : z_ring_handler_sample_take, \ z_owned_sample_t* : z_sample_take, \ z_owned_session_t* : z_session_take, \ - z_owned_shm_client_t* : z_shm_client_take, \ - z_owned_shm_client_storage_t* : z_shm_client_storage_take, \ - z_owned_shm_t* : z_shm_take, \ - z_owned_shm_mut_t* : z_shm_mut_take, \ - z_owned_shm_provider_t* : z_shm_provider_take, \ z_owned_slice_t* : z_slice_take, \ - z_owned_source_info_t* : z_source_info_take, \ z_owned_string_array_t* : z_string_array_take, \ z_owned_string_t* : z_string_take, \ z_owned_subscriber_t* : z_subscriber_take, \ z_owned_task_t* : z_task_take, \ zc_owned_closure_log_t* : zc_closure_log_take, \ - zc_owned_closure_matching_status_t* : zc_closure_matching_status_take, \ - zc_owned_liveliness_token_t* : zc_liveliness_token_take, \ - zc_owned_matching_listener_t* : zc_publisher_matching_listener_take, \ - zc_owned_shm_client_list_t* : zc_shm_client_list_take, \ - ze_owned_publication_cache_t* : ze_publication_cache_take, \ - ze_owned_querying_subscriber_t* : ze_querying_subscriber_take, \ ze_owned_serializer_t* : ze_serializer_take \ )(this_, x) #define z_internal_check(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t : z_internal_alloc_layout_check, \ z_owned_bytes_t : z_internal_bytes_check, \ z_owned_bytes_writer_t : z_internal_bytes_writer_check, \ - z_owned_chunk_alloc_result_t : z_internal_chunk_alloc_result_check, \ z_owned_closure_hello_t : z_internal_closure_hello_check, \ z_owned_closure_query_t : z_internal_closure_query_check, \ z_owned_closure_reply_t : z_internal_closure_reply_check, \ z_owned_closure_sample_t : z_internal_closure_sample_check, \ - z_owned_closure_zid_t : z_internal_closure_zid_check, \ z_owned_condvar_t : z_internal_condvar_check, \ z_owned_config_t : z_internal_config_check, \ z_owned_encoding_t : z_internal_encoding_check, \ @@ -398,7 +283,6 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser z_owned_fifo_handler_sample_t : z_internal_fifo_handler_sample_check, \ z_owned_hello_t : z_internal_hello_check, \ z_owned_keyexpr_t : z_internal_keyexpr_check, \ - z_owned_memory_layout_t : z_internal_memory_layout_check, \ z_owned_mutex_t : z_internal_mutex_check, \ z_owned_publisher_t : z_internal_publisher_check, \ z_owned_query_t : z_internal_query_check, \ @@ -410,24 +294,12 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser z_owned_ring_handler_sample_t : z_internal_ring_handler_sample_check, \ z_owned_sample_t : z_internal_sample_check, \ z_owned_session_t : z_internal_session_check, \ - z_owned_shm_t : z_internal_shm_check, \ - z_owned_shm_client_t : z_internal_shm_client_check, \ - z_owned_shm_client_storage_t : z_internal_shm_client_storage_check, \ - z_owned_shm_mut_t : z_internal_shm_mut_check, \ - z_owned_shm_provider_t : z_internal_shm_provider_check, \ z_owned_slice_t : z_internal_slice_check, \ - z_owned_source_info_t : z_internal_source_info_check, \ z_owned_string_array_t : z_internal_string_array_check, \ z_owned_string_t : z_internal_string_check, \ z_owned_subscriber_t : z_internal_subscriber_check, \ z_owned_task_t : z_internal_task_check, \ zc_owned_closure_log_t : zc_internal_closure_log_check, \ - zc_owned_closure_matching_status_t : zc_internal_closure_matching_status_check, \ - zc_owned_liveliness_token_t : zc_internal_liveliness_token_check, \ - zc_owned_matching_listener_t : zc_internal_matching_listener_check, \ - zc_owned_shm_client_list_t : zc_internal_shm_client_list_check, \ - ze_owned_publication_cache_t : ze_internal_publication_cache_check, \ - ze_owned_querying_subscriber_t : ze_internal_querying_subscriber_check, \ ze_owned_serializer_t : ze_internal_serializer_check \ )(&this_) @@ -436,9 +308,7 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser const z_loaned_closure_hello_t* : z_closure_hello_call, \ const z_loaned_closure_query_t* : z_closure_query_call, \ const z_loaned_closure_reply_t* : z_closure_reply_call, \ - const z_loaned_closure_sample_t* : z_closure_sample_call, \ - const z_loaned_closure_zid_t* : z_closure_zid_call, \ - const zc_loaned_closure_matching_status_t* : zc_closure_matching_status_call \ + const z_loaned_closure_sample_t* : z_closure_sample_call \ )(closure, hello) #define z_closure(this_, call, drop, context) \ @@ -447,9 +317,7 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser z_owned_closure_query_t* : z_closure_query, \ z_owned_closure_reply_t* : z_closure_reply, \ z_owned_closure_sample_t* : z_closure_sample, \ - z_owned_closure_zid_t* : z_closure_zid, \ - zc_owned_closure_log_t* : zc_closure_log, \ - zc_owned_closure_matching_status_t* : zc_closure_matching_status \ + zc_owned_closure_log_t* : zc_closure_log \ )(this_, call, drop, context) #define z_try_recv(this_, query) \ @@ -483,8 +351,6 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser z_owned_reply_t* : z_reply_clone, \ z_owned_reply_err_t* : z_reply_err_clone, \ z_owned_sample_t* : z_sample_clone, \ - z_owned_shm_client_storage_t* : z_shm_client_storage_clone, \ - z_owned_shm_t* : z_shm_clone, \ z_owned_slice_t* : z_slice_clone, \ z_owned_string_array_t* : z_string_array_clone, \ z_owned_string_t* : z_string_clone \ @@ -492,15 +358,12 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser #else // #ifndef __cplusplus -static inline z_moved_alloc_layout_t* z_alloc_layout_move(z_owned_alloc_layout_t* x) { return reinterpret_cast(x); } static inline z_moved_bytes_t* z_bytes_move(z_owned_bytes_t* x) { return reinterpret_cast(x); } static inline z_moved_bytes_writer_t* z_bytes_writer_move(z_owned_bytes_writer_t* x) { return reinterpret_cast(x); } -static inline z_moved_chunk_alloc_result_t* z_chunk_alloc_result_move(z_owned_chunk_alloc_result_t* x) { return reinterpret_cast(x); } static inline z_moved_closure_hello_t* z_closure_hello_move(z_owned_closure_hello_t* x) { return reinterpret_cast(x); } static inline z_moved_closure_query_t* z_closure_query_move(z_owned_closure_query_t* x) { return reinterpret_cast(x); } static inline z_moved_closure_reply_t* z_closure_reply_move(z_owned_closure_reply_t* x) { return reinterpret_cast(x); } static inline z_moved_closure_sample_t* z_closure_sample_move(z_owned_closure_sample_t* x) { return reinterpret_cast(x); } -static inline z_moved_closure_zid_t* z_closure_zid_move(z_owned_closure_zid_t* x) { return reinterpret_cast(x); } static inline z_moved_condvar_t* z_condvar_move(z_owned_condvar_t* x) { return reinterpret_cast(x); } static inline z_moved_config_t* z_config_move(z_owned_config_t* x) { return reinterpret_cast(x); } static inline z_moved_encoding_t* z_encoding_move(z_owned_encoding_t* x) { return reinterpret_cast(x); } @@ -509,7 +372,6 @@ static inline z_moved_fifo_handler_reply_t* z_fifo_handler_reply_move(z_owned_fi static inline z_moved_fifo_handler_sample_t* z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return reinterpret_cast(x); } static inline z_moved_hello_t* z_hello_move(z_owned_hello_t* x) { return reinterpret_cast(x); } static inline z_moved_keyexpr_t* z_keyexpr_move(z_owned_keyexpr_t* x) { return reinterpret_cast(x); } -static inline z_moved_memory_layout_t* z_memory_layout_move(z_owned_memory_layout_t* x) { return reinterpret_cast(x); } static inline z_moved_mutex_t* z_mutex_move(z_owned_mutex_t* x) { return reinterpret_cast(x); } static inline z_moved_publisher_t* z_publisher_move(z_owned_publisher_t* x) { return reinterpret_cast(x); } static inline z_moved_query_t* z_query_move(z_owned_query_t* x) { return reinterpret_cast(x); } @@ -521,37 +383,22 @@ static inline z_moved_ring_handler_reply_t* z_ring_handler_reply_move(z_owned_ri static inline z_moved_ring_handler_sample_t* z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return reinterpret_cast(x); } static inline z_moved_sample_t* z_sample_move(z_owned_sample_t* x) { return reinterpret_cast(x); } static inline z_moved_session_t* z_session_move(z_owned_session_t* x) { return reinterpret_cast(x); } -static inline z_moved_shm_client_t* z_shm_client_move(z_owned_shm_client_t* x) { return reinterpret_cast(x); } -static inline z_moved_shm_client_storage_t* z_shm_client_storage_move(z_owned_shm_client_storage_t* x) { return reinterpret_cast(x); } -static inline z_moved_shm_t* z_shm_move(z_owned_shm_t* x) { return reinterpret_cast(x); } -static inline z_moved_shm_mut_t* z_shm_mut_move(z_owned_shm_mut_t* x) { return reinterpret_cast(x); } -static inline z_moved_shm_provider_t* z_shm_provider_move(z_owned_shm_provider_t* x) { return reinterpret_cast(x); } static inline z_moved_slice_t* z_slice_move(z_owned_slice_t* x) { return reinterpret_cast(x); } -static inline z_moved_source_info_t* z_source_info_move(z_owned_source_info_t* x) { return reinterpret_cast(x); } static inline z_moved_string_array_t* z_string_array_move(z_owned_string_array_t* x) { return reinterpret_cast(x); } static inline z_moved_string_t* z_string_move(z_owned_string_t* x) { return reinterpret_cast(x); } static inline z_moved_subscriber_t* z_subscriber_move(z_owned_subscriber_t* x) { return reinterpret_cast(x); } static inline z_moved_task_t* z_task_move(z_owned_task_t* x) { return reinterpret_cast(x); } static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t* x) { return reinterpret_cast(x); } -static inline zc_moved_closure_matching_status_t* zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return reinterpret_cast(x); } -static inline zc_moved_liveliness_token_t* zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return reinterpret_cast(x); } -static inline zc_moved_matching_listener_t* zc_publisher_matching_listener_move(zc_owned_matching_listener_t* x) { return reinterpret_cast(x); } -static inline zc_moved_shm_client_list_t* zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return reinterpret_cast(x); } -static inline ze_moved_publication_cache_t* ze_publication_cache_move(ze_owned_publication_cache_t* x) { return reinterpret_cast(x); } -static inline ze_moved_querying_subscriber_t* ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return reinterpret_cast(x); } static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x) { return reinterpret_cast(x); } -inline const z_loaned_alloc_layout_t* z_loan(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_loan(&this_); }; inline const z_loaned_bytes_t* z_loan(const z_owned_bytes_t& this_) { return z_bytes_loan(&this_); }; inline const z_loaned_bytes_writer_t* z_loan(const z_owned_bytes_writer_t& this_) { return z_bytes_writer_loan(&this_); }; -inline const z_loaned_chunk_alloc_result_t* z_loan(const z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_loan(&this_); }; inline const z_loaned_closure_hello_t* z_loan(const z_owned_closure_hello_t& closure) { return z_closure_hello_loan(&closure); }; inline const z_loaned_closure_query_t* z_loan(const z_owned_closure_query_t& closure) { return z_closure_query_loan(&closure); }; inline const z_loaned_closure_reply_t* z_loan(const z_owned_closure_reply_t& closure) { return z_closure_reply_loan(&closure); }; inline const z_loaned_closure_sample_t* z_loan(const z_owned_closure_sample_t& closure) { return z_closure_sample_loan(&closure); }; -inline const z_loaned_closure_zid_t* z_loan(const z_owned_closure_zid_t& closure) { return z_closure_zid_loan(&closure); }; inline const z_loaned_condvar_t* z_loan(const z_owned_condvar_t& this_) { return z_condvar_loan(&this_); }; inline const z_loaned_config_t* z_loan(const z_owned_config_t& this_) { return z_config_loan(&this_); }; inline const z_loaned_encoding_t* z_loan(const z_owned_encoding_t& this_) { return z_encoding_loan(&this_); }; @@ -560,7 +407,6 @@ inline const z_loaned_fifo_handler_reply_t* z_loan(const z_owned_fifo_handler_re inline const z_loaned_fifo_handler_sample_t* z_loan(const z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_loan(&this_); }; inline const z_loaned_hello_t* z_loan(const z_owned_hello_t& this_) { return z_hello_loan(&this_); }; inline const z_loaned_keyexpr_t* z_loan(const z_owned_keyexpr_t& this_) { return z_keyexpr_loan(&this_); }; -inline const z_loaned_memory_layout_t* z_loan(const z_owned_memory_layout_t& this_) { return z_memory_layout_loan(&this_); }; inline const z_loaned_publisher_t* z_loan(const z_owned_publisher_t& this_) { return z_publisher_loan(&this_); }; inline const z_loaned_query_t* z_loan(const z_owned_query_t& this_) { return z_query_loan(&this_); }; inline const z_loaned_queryable_t* z_loan(const z_owned_queryable_t& this_) { return z_queryable_loan(&this_); }; @@ -571,12 +417,7 @@ inline const z_loaned_ring_handler_reply_t* z_loan(const z_owned_ring_handler_re inline const z_loaned_ring_handler_sample_t* z_loan(const z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_loan(&this_); }; inline const z_loaned_sample_t* z_loan(const z_owned_sample_t& this_) { return z_sample_loan(&this_); }; inline const z_loaned_session_t* z_loan(const z_owned_session_t& this_) { return z_session_loan(&this_); }; -inline const z_loaned_shm_client_storage_t* z_loan(const z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_loan(&this_); }; -inline const z_loaned_shm_t* z_loan(const z_owned_shm_t& this_) { return z_shm_loan(&this_); }; -inline const z_loaned_shm_mut_t* z_loan(const z_owned_shm_mut_t& this_) { return z_shm_mut_loan(&this_); }; -inline const z_loaned_shm_provider_t* z_loan(const z_owned_shm_provider_t& this_) { return z_shm_provider_loan(&this_); }; inline const z_loaned_slice_t* z_loan(const z_owned_slice_t& this_) { return z_slice_loan(&this_); }; -inline const z_loaned_source_info_t* z_loan(const z_owned_source_info_t& this_) { return z_source_info_loan(&this_); }; inline const z_loaned_string_array_t* z_loan(const z_owned_string_array_t& this_) { return z_string_array_loan(&this_); }; inline const z_loaned_string_t* z_loan(const z_owned_string_t& this_) { return z_string_loan(&this_); }; inline const z_loaned_subscriber_t* z_loan(const z_owned_subscriber_t& this_) { return z_subscriber_loan(&this_); }; @@ -584,11 +425,6 @@ inline const z_loaned_keyexpr_t* z_loan(const z_view_keyexpr_t& this_) { return inline const z_loaned_slice_t* z_loan(const z_view_slice_t& this_) { return z_view_slice_loan(&this_); }; inline const z_loaned_string_t* z_loan(const z_view_string_t& this_) { return z_view_string_loan(&this_); }; inline const zc_loaned_closure_log_t* z_loan(const zc_owned_closure_log_t& closure) { return zc_closure_log_loan(&closure); }; -inline const zc_loaned_closure_matching_status_t* z_loan(const zc_owned_closure_matching_status_t& closure) { return zc_closure_matching_status_loan(&closure); }; -inline const zc_loaned_liveliness_token_t* z_loan(const zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_loan(&this_); }; -inline const zc_loaned_shm_client_list_t* z_loan(const zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_loan(&this_); }; -inline const ze_loaned_publication_cache_t* z_loan(const ze_owned_publication_cache_t& this_) { return ze_publication_cache_loan(&this_); }; -inline const ze_loaned_querying_subscriber_t* z_loan(const ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_loan(&this_); }; inline const ze_loaned_serializer_t* z_loan(const ze_owned_serializer_t& this_) { return ze_serializer_loan(&this_); }; @@ -599,22 +435,17 @@ inline z_loaned_config_t* z_loan_mut(z_owned_config_t& this_) { return z_config_ inline z_loaned_encoding_t* z_loan_mut(z_owned_encoding_t& this_) { return z_encoding_loan_mut(&this_); }; inline z_loaned_mutex_t* z_loan_mut(z_owned_mutex_t& this_) { return z_mutex_loan_mut(&this_); }; inline z_loaned_publisher_t* z_loan_mut(z_owned_publisher_t& this_) { return z_publisher_loan_mut(&this_); }; -inline z_loaned_shm_t* z_loan_mut(z_owned_shm_t& this_) { return z_shm_loan_mut(&this_); }; -inline z_loaned_shm_mut_t* z_loan_mut(z_owned_shm_mut_t& this_) { return z_shm_mut_loan_mut(&this_); }; +inline z_loaned_session_t* z_loan_mut(z_owned_session_t& this_) { return z_session_loan_mut(&this_); }; inline z_loaned_string_array_t* z_loan_mut(z_owned_string_array_t& this_) { return z_string_array_loan_mut(&this_); }; -inline zc_loaned_shm_client_list_t* z_loan_mut(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_loan_mut(&this_); }; inline ze_loaned_serializer_t* z_loan_mut(ze_owned_serializer_t& this_) { return ze_serializer_loan_mut(&this_); }; -inline void z_drop(z_moved_alloc_layout_t* this_) { z_alloc_layout_drop(this_); }; inline void z_drop(z_moved_bytes_t* this_) { z_bytes_drop(this_); }; inline void z_drop(z_moved_bytes_writer_t* this_) { z_bytes_writer_drop(this_); }; -inline void z_drop(z_moved_chunk_alloc_result_t* this_) { z_chunk_alloc_result_drop(this_); }; inline void z_drop(z_moved_closure_hello_t* this_) { z_closure_hello_drop(this_); }; inline void z_drop(z_moved_closure_query_t* closure_) { z_closure_query_drop(closure_); }; inline void z_drop(z_moved_closure_reply_t* closure_) { z_closure_reply_drop(closure_); }; inline void z_drop(z_moved_closure_sample_t* closure_) { z_closure_sample_drop(closure_); }; -inline void z_drop(z_moved_closure_zid_t* closure_) { z_closure_zid_drop(closure_); }; inline void z_drop(z_moved_condvar_t* this_) { z_condvar_drop(this_); }; inline void z_drop(z_moved_config_t* this_) { z_config_drop(this_); }; inline void z_drop(z_moved_encoding_t* this_) { z_encoding_drop(this_); }; @@ -623,7 +454,6 @@ inline void z_drop(z_moved_fifo_handler_reply_t* this_) { z_fifo_handler_reply_d inline void z_drop(z_moved_fifo_handler_sample_t* this_) { z_fifo_handler_sample_drop(this_); }; inline void z_drop(z_moved_hello_t* this_) { z_hello_drop(this_); }; inline void z_drop(z_moved_keyexpr_t* this_) { z_keyexpr_drop(this_); }; -inline void z_drop(z_moved_memory_layout_t* this_) { z_memory_layout_drop(this_); }; inline void z_drop(z_moved_mutex_t* this_) { z_mutex_drop(this_); }; inline void z_drop(z_moved_publisher_t* this_) { z_publisher_drop(this_); }; inline void z_drop(z_moved_query_t* this_) { z_query_drop(this_); }; @@ -635,36 +465,21 @@ inline void z_drop(z_moved_ring_handler_reply_t* this_) { z_ring_handler_reply_d inline void z_drop(z_moved_ring_handler_sample_t* this_) { z_ring_handler_sample_drop(this_); }; inline void z_drop(z_moved_sample_t* this_) { z_sample_drop(this_); }; inline void z_drop(z_moved_session_t* this_) { z_session_drop(this_); }; -inline void z_drop(z_moved_shm_client_t* this_) { z_shm_client_drop(this_); }; -inline void z_drop(z_moved_shm_client_storage_t* this_) { z_shm_client_storage_drop(this_); }; -inline void z_drop(z_moved_shm_t* this_) { z_shm_drop(this_); }; -inline void z_drop(z_moved_shm_mut_t* this_) { z_shm_mut_drop(this_); }; -inline void z_drop(z_moved_shm_provider_t* this_) { z_shm_provider_drop(this_); }; inline void z_drop(z_moved_slice_t* this_) { z_slice_drop(this_); }; -inline void z_drop(z_moved_source_info_t* this_) { z_source_info_drop(this_); }; inline void z_drop(z_moved_string_array_t* this_) { z_string_array_drop(this_); }; inline void z_drop(z_moved_string_t* this_) { z_string_drop(this_); }; inline void z_drop(z_moved_subscriber_t* this_) { z_subscriber_drop(this_); }; inline void z_drop(z_moved_task_t* this_) { z_task_drop(this_); }; inline void z_drop(zc_moved_closure_log_t* closure_) { zc_closure_log_drop(closure_); }; -inline void z_drop(zc_moved_closure_matching_status_t* closure_) { zc_closure_matching_status_drop(closure_); }; -inline void z_drop(zc_moved_liveliness_token_t* this_) { zc_liveliness_token_drop(this_); }; -inline void z_drop(zc_moved_matching_listener_t* this_) { zc_publisher_matching_listener_drop(this_); }; -inline void z_drop(zc_moved_shm_client_list_t* this_) { zc_shm_client_list_drop(this_); }; -inline void z_drop(ze_moved_publication_cache_t* this_) { ze_publication_cache_drop(this_); }; -inline void z_drop(ze_moved_querying_subscriber_t* this_) { ze_querying_subscriber_drop(this_); }; inline void z_drop(ze_moved_serializer_t* this_) { ze_serializer_drop(this_); }; -inline z_moved_alloc_layout_t* z_move(z_owned_alloc_layout_t& this_) { return z_alloc_layout_move(&this_); }; inline z_moved_bytes_t* z_move(z_owned_bytes_t& this_) { return z_bytes_move(&this_); }; inline z_moved_bytes_writer_t* z_move(z_owned_bytes_writer_t& this_) { return z_bytes_writer_move(&this_); }; -inline z_moved_chunk_alloc_result_t* z_move(z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_move(&this_); }; inline z_moved_closure_hello_t* z_move(z_owned_closure_hello_t& this_) { return z_closure_hello_move(&this_); }; inline z_moved_closure_query_t* z_move(z_owned_closure_query_t& closure_) { return z_closure_query_move(&closure_); }; inline z_moved_closure_reply_t* z_move(z_owned_closure_reply_t& closure_) { return z_closure_reply_move(&closure_); }; inline z_moved_closure_sample_t* z_move(z_owned_closure_sample_t& closure_) { return z_closure_sample_move(&closure_); }; -inline z_moved_closure_zid_t* z_move(z_owned_closure_zid_t& closure_) { return z_closure_zid_move(&closure_); }; inline z_moved_condvar_t* z_move(z_owned_condvar_t& this_) { return z_condvar_move(&this_); }; inline z_moved_config_t* z_move(z_owned_config_t& this_) { return z_config_move(&this_); }; inline z_moved_encoding_t* z_move(z_owned_encoding_t& this_) { return z_encoding_move(&this_); }; @@ -673,7 +488,6 @@ inline z_moved_fifo_handler_reply_t* z_move(z_owned_fifo_handler_reply_t& this_) inline z_moved_fifo_handler_sample_t* z_move(z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_move(&this_); }; inline z_moved_hello_t* z_move(z_owned_hello_t& this_) { return z_hello_move(&this_); }; inline z_moved_keyexpr_t* z_move(z_owned_keyexpr_t& this_) { return z_keyexpr_move(&this_); }; -inline z_moved_memory_layout_t* z_move(z_owned_memory_layout_t& this_) { return z_memory_layout_move(&this_); }; inline z_moved_mutex_t* z_move(z_owned_mutex_t& this_) { return z_mutex_move(&this_); }; inline z_moved_publisher_t* z_move(z_owned_publisher_t& this_) { return z_publisher_move(&this_); }; inline z_moved_query_t* z_move(z_owned_query_t& this_) { return z_query_move(&this_); }; @@ -685,36 +499,21 @@ inline z_moved_ring_handler_reply_t* z_move(z_owned_ring_handler_reply_t& this_) inline z_moved_ring_handler_sample_t* z_move(z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_move(&this_); }; inline z_moved_sample_t* z_move(z_owned_sample_t& this_) { return z_sample_move(&this_); }; inline z_moved_session_t* z_move(z_owned_session_t& this_) { return z_session_move(&this_); }; -inline z_moved_shm_client_t* z_move(z_owned_shm_client_t& this_) { return z_shm_client_move(&this_); }; -inline z_moved_shm_client_storage_t* z_move(z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_move(&this_); }; -inline z_moved_shm_t* z_move(z_owned_shm_t& this_) { return z_shm_move(&this_); }; -inline z_moved_shm_mut_t* z_move(z_owned_shm_mut_t& this_) { return z_shm_mut_move(&this_); }; -inline z_moved_shm_provider_t* z_move(z_owned_shm_provider_t& this_) { return z_shm_provider_move(&this_); }; inline z_moved_slice_t* z_move(z_owned_slice_t& this_) { return z_slice_move(&this_); }; -inline z_moved_source_info_t* z_move(z_owned_source_info_t& this_) { return z_source_info_move(&this_); }; inline z_moved_string_array_t* z_move(z_owned_string_array_t& this_) { return z_string_array_move(&this_); }; inline z_moved_string_t* z_move(z_owned_string_t& this_) { return z_string_move(&this_); }; inline z_moved_subscriber_t* z_move(z_owned_subscriber_t& this_) { return z_subscriber_move(&this_); }; inline z_moved_task_t* z_move(z_owned_task_t& this_) { return z_task_move(&this_); }; inline zc_moved_closure_log_t* z_move(zc_owned_closure_log_t& closure_) { return zc_closure_log_move(&closure_); }; -inline zc_moved_closure_matching_status_t* z_move(zc_owned_closure_matching_status_t& closure_) { return zc_closure_matching_status_move(&closure_); }; -inline zc_moved_liveliness_token_t* z_move(zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_move(&this_); }; -inline zc_moved_matching_listener_t* z_move(zc_owned_matching_listener_t& this_) { return zc_publisher_matching_listener_move(&this_); }; -inline zc_moved_shm_client_list_t* z_move(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_move(&this_); }; -inline ze_moved_publication_cache_t* z_move(ze_owned_publication_cache_t& this_) { return ze_publication_cache_move(&this_); }; -inline ze_moved_querying_subscriber_t* z_move(ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_move(&this_); }; inline ze_moved_serializer_t* z_move(ze_owned_serializer_t& this_) { return ze_serializer_move(&this_); }; -inline void z_internal_null(z_owned_alloc_layout_t* this_) { z_internal_alloc_layout_null(this_); }; inline void z_internal_null(z_owned_bytes_t* this_) { z_internal_bytes_null(this_); }; inline void z_internal_null(z_owned_bytes_writer_t* this_) { z_internal_bytes_writer_null(this_); }; -inline void z_internal_null(z_owned_chunk_alloc_result_t* this_) { z_internal_chunk_alloc_result_null(this_); }; inline void z_internal_null(z_owned_closure_hello_t* this_) { z_internal_closure_hello_null(this_); }; inline void z_internal_null(z_owned_closure_query_t* this_) { z_internal_closure_query_null(this_); }; inline void z_internal_null(z_owned_closure_reply_t* this_) { z_internal_closure_reply_null(this_); }; inline void z_internal_null(z_owned_closure_sample_t* this_) { z_internal_closure_sample_null(this_); }; -inline void z_internal_null(z_owned_closure_zid_t* this_) { z_internal_closure_zid_null(this_); }; inline void z_internal_null(z_owned_condvar_t* this_) { z_internal_condvar_null(this_); }; inline void z_internal_null(z_owned_config_t* this_) { z_internal_config_null(this_); }; inline void z_internal_null(z_owned_encoding_t* this_) { z_internal_encoding_null(this_); }; @@ -723,7 +522,6 @@ inline void z_internal_null(z_owned_fifo_handler_reply_t* this_) { z_internal_fi inline void z_internal_null(z_owned_fifo_handler_sample_t* this_) { z_internal_fifo_handler_sample_null(this_); }; inline void z_internal_null(z_owned_hello_t* this_) { z_internal_hello_null(this_); }; inline void z_internal_null(z_owned_keyexpr_t* this_) { z_internal_keyexpr_null(this_); }; -inline void z_internal_null(z_owned_memory_layout_t* this_) { z_internal_memory_layout_null(this_); }; inline void z_internal_null(z_owned_mutex_t* this_) { z_internal_mutex_null(this_); }; inline void z_internal_null(z_owned_publisher_t* this_) { z_internal_publisher_null(this_); }; inline void z_internal_null(z_owned_query_t* this_) { z_internal_query_null(this_); }; @@ -735,35 +533,20 @@ inline void z_internal_null(z_owned_ring_handler_reply_t* this_) { z_internal_ri inline void z_internal_null(z_owned_ring_handler_sample_t* this_) { z_internal_ring_handler_sample_null(this_); }; inline void z_internal_null(z_owned_sample_t* this_) { z_internal_sample_null(this_); }; inline void z_internal_null(z_owned_session_t* this_) { z_internal_session_null(this_); }; -inline void z_internal_null(z_owned_shm_client_t* this_) { z_internal_shm_client_null(this_); }; -inline void z_internal_null(z_owned_shm_client_storage_t* this_) { z_internal_shm_client_storage_null(this_); }; -inline void z_internal_null(z_owned_shm_mut_t* this_) { z_internal_shm_mut_null(this_); }; -inline void z_internal_null(z_owned_shm_t* this_) { z_internal_shm_null(this_); }; -inline void z_internal_null(z_owned_shm_provider_t* this_) { z_internal_shm_provider_null(this_); }; inline void z_internal_null(z_owned_slice_t* this_) { z_internal_slice_null(this_); }; -inline void z_internal_null(z_owned_source_info_t* this_) { z_internal_source_info_null(this_); }; inline void z_internal_null(z_owned_string_array_t* this_) { z_internal_string_array_null(this_); }; inline void z_internal_null(z_owned_string_t* this_) { z_internal_string_null(this_); }; inline void z_internal_null(z_owned_subscriber_t* this_) { z_internal_subscriber_null(this_); }; inline void z_internal_null(z_owned_task_t* this_) { z_internal_task_null(this_); }; inline void z_internal_null(zc_owned_closure_log_t* this_) { zc_internal_closure_log_null(this_); }; -inline void z_internal_null(zc_owned_closure_matching_status_t* this_) { zc_internal_closure_matching_status_null(this_); }; -inline void z_internal_null(zc_owned_liveliness_token_t* this_) { zc_internal_liveliness_token_null(this_); }; -inline void z_internal_null(zc_owned_matching_listener_t* this_) { zc_internal_matching_listener_null(this_); }; -inline void z_internal_null(zc_owned_shm_client_list_t* this_) { zc_internal_shm_client_list_null(this_); }; -inline void z_internal_null(ze_owned_publication_cache_t* this_) { ze_internal_publication_cache_null(this_); }; -inline void z_internal_null(ze_owned_querying_subscriber_t* this_) { ze_internal_querying_subscriber_null(this_); }; inline void z_internal_null(ze_owned_serializer_t* this_) { ze_internal_serializer_null(this_); }; -static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t* x) { *this_ = x->_this; z_internal_alloc_layout_null(&x->_this); } static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { *this_ = x->_this; z_internal_bytes_null(&x->_this); } static inline void z_bytes_writer_take(z_owned_bytes_writer_t* this_, z_moved_bytes_writer_t* x) { *this_ = x->_this; z_internal_bytes_writer_null(&x->_this); } -static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t* x) { *this_ = x->_this; z_internal_chunk_alloc_result_null(&x->_this); } static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { *this_ = x->_this; z_internal_closure_hello_null(&x->_this); } static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { *closure_ = x->_this; z_internal_closure_query_null(&x->_this); } static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { *closure_ = x->_this; z_internal_closure_reply_null(&x->_this); } static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { *closure_ = x->_this; z_internal_closure_sample_null(&x->_this); } -static inline void z_closure_zid_take(z_owned_closure_zid_t* closure_, z_moved_closure_zid_t* x) { *closure_ = x->_this; z_internal_closure_zid_null(&x->_this); } static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { *this_ = x->_this; z_internal_condvar_null(&x->_this); } static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t* x) { *this_ = x->_this; z_internal_config_null(&x->_this); } static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t* x) { *this_ = x->_this; z_internal_encoding_null(&x->_this); } @@ -772,7 +555,6 @@ static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_ static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { *this_ = x->_this; z_internal_fifo_handler_sample_null(&x->_this); } static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *this_ = x->_this; z_internal_hello_null(&x->_this); } static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_internal_keyexpr_null(&x->_this); } -static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t* x) { *this_ = x->_this; z_internal_memory_layout_null(&x->_this); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_internal_mutex_null(&x->_this); } static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_internal_publisher_null(&x->_this); } static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_internal_query_null(&x->_this); } @@ -784,40 +566,22 @@ static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_ static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { *this_ = x->_this; z_internal_ring_handler_sample_null(&x->_this); } static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t* x) { *this_ = x->_this; z_internal_sample_null(&x->_this); } static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t* x) { *this_ = x->_this; z_internal_session_null(&x->_this); } -static inline void z_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t* x) { *this_ = x->_this; z_internal_shm_client_null(&x->_this); } -static inline void z_shm_client_storage_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t* x) { *this_ = x->_this; z_internal_shm_client_storage_null(&x->_this); } -static inline void z_shm_take(z_owned_shm_t* this_, z_moved_shm_t* x) { *this_ = x->_this; z_internal_shm_null(&x->_this); } -static inline void z_shm_mut_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t* x) { *this_ = x->_this; z_internal_shm_mut_null(&x->_this); } -static inline void z_shm_provider_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t* x) { *this_ = x->_this; z_internal_shm_provider_null(&x->_this); } static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t* x) { *this_ = x->_this; z_internal_slice_null(&x->_this); } -static inline void z_source_info_take(z_owned_source_info_t* this_, z_moved_source_info_t* x) { *this_ = x->_this; z_internal_source_info_null(&x->_this); } static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { *this_ = x->_this; z_internal_string_array_null(&x->_this); } static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t* x) { *this_ = x->_this; z_internal_string_null(&x->_this); } static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { *this_ = x->_this; z_internal_subscriber_null(&x->_this); } static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t* x) { *this_ = x->_this; z_internal_task_null(&x->_this); } static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { *closure_ = x->_this; zc_internal_closure_log_null(&x->_this); } -static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure_, zc_moved_closure_matching_status_t* x) { *closure_ = x->_this; zc_internal_closure_matching_status_null(&x->_this); } -static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t* x) { *this_ = x->_this; zc_internal_liveliness_token_null(&x->_this); } -static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t* x) { *this_ = x->_this; zc_internal_matching_listener_null(&x->_this); } -static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t* x) { *this_ = x->_this; zc_internal_shm_client_list_null(&x->_this); } -static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t* x) { *this_ = x->_this; ze_internal_publication_cache_null(&x->_this); } -static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t* x) { *this_ = x->_this; ze_internal_querying_subscriber_null(&x->_this); } static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_serializer_t* x) { *this_ = x->_this; ze_internal_serializer_null(&x->_this); } -inline void z_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t* x) { - z_alloc_layout_take(this_, x); -}; inline void z_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { z_bytes_take(this_, x); }; inline void z_take(z_owned_bytes_writer_t* this_, z_moved_bytes_writer_t* x) { z_bytes_writer_take(this_, x); }; -inline void z_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t* x) { - z_chunk_alloc_result_take(this_, x); -}; inline void z_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { z_closure_hello_take(this_, x); }; @@ -830,9 +594,6 @@ inline void z_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x inline void z_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { z_closure_sample_take(closure_, x); }; -inline void z_take(z_owned_closure_zid_t* closure_, z_moved_closure_zid_t* x) { - z_closure_zid_take(closure_, x); -}; inline void z_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { z_condvar_take(this_, x); }; @@ -857,9 +618,6 @@ inline void z_take(z_owned_hello_t* this_, z_moved_hello_t* x) { inline void z_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { z_keyexpr_take(this_, x); }; -inline void z_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t* x) { - z_memory_layout_take(this_, x); -}; inline void z_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { z_mutex_take(this_, x); }; @@ -893,27 +651,9 @@ inline void z_take(z_owned_sample_t* this_, z_moved_sample_t* x) { inline void z_take(z_owned_session_t* this_, z_moved_session_t* x) { z_session_take(this_, x); }; -inline void z_take(z_owned_shm_client_t* this_, z_moved_shm_client_t* x) { - z_shm_client_take(this_, x); -}; -inline void z_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t* x) { - z_shm_client_storage_take(this_, x); -}; -inline void z_take(z_owned_shm_t* this_, z_moved_shm_t* x) { - z_shm_take(this_, x); -}; -inline void z_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t* x) { - z_shm_mut_take(this_, x); -}; -inline void z_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t* x) { - z_shm_provider_take(this_, x); -}; inline void z_take(z_owned_slice_t* this_, z_moved_slice_t* x) { z_slice_take(this_, x); }; -inline void z_take(z_owned_source_info_t* this_, z_moved_source_info_t* x) { - z_source_info_take(this_, x); -}; inline void z_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { z_string_array_take(this_, x); }; @@ -929,38 +669,17 @@ inline void z_take(z_owned_task_t* this_, z_moved_task_t* x) { inline void z_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { zc_closure_log_take(closure_, x); }; -inline void z_take(zc_owned_closure_matching_status_t* closure_, zc_moved_closure_matching_status_t* x) { - zc_closure_matching_status_take(closure_, x); -}; -inline void z_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t* x) { - zc_liveliness_token_take(this_, x); -}; -inline void z_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t* x) { - zc_publisher_matching_listener_take(this_, x); -}; -inline void z_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t* x) { - zc_shm_client_list_take(this_, x); -}; -inline void z_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t* x) { - ze_publication_cache_take(this_, x); -}; -inline void z_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t* x) { - ze_querying_subscriber_take(this_, x); -}; inline void z_take(ze_owned_serializer_t* this_, ze_moved_serializer_t* x) { ze_serializer_take(this_, x); }; -inline bool z_internal_check(const z_owned_alloc_layout_t& this_) { return z_internal_alloc_layout_check(&this_); }; inline bool z_internal_check(const z_owned_bytes_t& this_) { return z_internal_bytes_check(&this_); }; inline bool z_internal_check(const z_owned_bytes_writer_t& this_) { return z_internal_bytes_writer_check(&this_); }; -inline bool z_internal_check(const z_owned_chunk_alloc_result_t& this_) { return z_internal_chunk_alloc_result_check(&this_); }; inline bool z_internal_check(const z_owned_closure_hello_t& this_) { return z_internal_closure_hello_check(&this_); }; inline bool z_internal_check(const z_owned_closure_query_t& this_) { return z_internal_closure_query_check(&this_); }; inline bool z_internal_check(const z_owned_closure_reply_t& this_) { return z_internal_closure_reply_check(&this_); }; inline bool z_internal_check(const z_owned_closure_sample_t& this_) { return z_internal_closure_sample_check(&this_); }; -inline bool z_internal_check(const z_owned_closure_zid_t& this_) { return z_internal_closure_zid_check(&this_); }; inline bool z_internal_check(const z_owned_condvar_t& this_) { return z_internal_condvar_check(&this_); }; inline bool z_internal_check(const z_owned_config_t& this_) { return z_internal_config_check(&this_); }; inline bool z_internal_check(const z_owned_encoding_t& this_) { return z_internal_encoding_check(&this_); }; @@ -969,7 +688,6 @@ inline bool z_internal_check(const z_owned_fifo_handler_reply_t& this_) { return inline bool z_internal_check(const z_owned_fifo_handler_sample_t& this_) { return z_internal_fifo_handler_sample_check(&this_); }; inline bool z_internal_check(const z_owned_hello_t& this_) { return z_internal_hello_check(&this_); }; inline bool z_internal_check(const z_owned_keyexpr_t& this_) { return z_internal_keyexpr_check(&this_); }; -inline bool z_internal_check(const z_owned_memory_layout_t& this_) { return z_internal_memory_layout_check(&this_); }; inline bool z_internal_check(const z_owned_mutex_t& this_) { return z_internal_mutex_check(&this_); }; inline bool z_internal_check(const z_owned_publisher_t& this_) { return z_internal_publisher_check(&this_); }; inline bool z_internal_check(const z_owned_query_t& query) { return z_internal_query_check(&query); }; @@ -981,24 +699,12 @@ inline bool z_internal_check(const z_owned_ring_handler_reply_t& this_) { return inline bool z_internal_check(const z_owned_ring_handler_sample_t& this_) { return z_internal_ring_handler_sample_check(&this_); }; inline bool z_internal_check(const z_owned_sample_t& this_) { return z_internal_sample_check(&this_); }; inline bool z_internal_check(const z_owned_session_t& this_) { return z_internal_session_check(&this_); }; -inline bool z_internal_check(const z_owned_shm_t& this_) { return z_internal_shm_check(&this_); }; -inline bool z_internal_check(const z_owned_shm_client_t& this_) { return z_internal_shm_client_check(&this_); }; -inline bool z_internal_check(const z_owned_shm_client_storage_t& this_) { return z_internal_shm_client_storage_check(&this_); }; -inline bool z_internal_check(const z_owned_shm_mut_t& this_) { return z_internal_shm_mut_check(&this_); }; -inline bool z_internal_check(const z_owned_shm_provider_t& this_) { return z_internal_shm_provider_check(&this_); }; inline bool z_internal_check(const z_owned_slice_t& this_) { return z_internal_slice_check(&this_); }; -inline bool z_internal_check(const z_owned_source_info_t& this_) { return z_internal_source_info_check(&this_); }; inline bool z_internal_check(const z_owned_string_array_t& this_) { return z_internal_string_array_check(&this_); }; inline bool z_internal_check(const z_owned_string_t& this_) { return z_internal_string_check(&this_); }; inline bool z_internal_check(const z_owned_subscriber_t& this_) { return z_internal_subscriber_check(&this_); }; inline bool z_internal_check(const z_owned_task_t& this_) { return z_internal_task_check(&this_); }; inline bool z_internal_check(const zc_owned_closure_log_t& this_) { return zc_internal_closure_log_check(&this_); }; -inline bool z_internal_check(const zc_owned_closure_matching_status_t& this_) { return zc_internal_closure_matching_status_check(&this_); }; -inline bool z_internal_check(const zc_owned_liveliness_token_t& this_) { return zc_internal_liveliness_token_check(&this_); }; -inline bool z_internal_check(const zc_owned_matching_listener_t& this_) { return zc_internal_matching_listener_check(&this_); }; -inline bool z_internal_check(const zc_owned_shm_client_list_t& this_) { return zc_internal_shm_client_list_check(&this_); }; -inline bool z_internal_check(const ze_owned_publication_cache_t& this_) { return ze_internal_publication_cache_check(&this_); }; -inline bool z_internal_check(const ze_owned_querying_subscriber_t& this_) { return ze_internal_querying_subscriber_check(&this_); }; inline bool z_internal_check(const ze_owned_serializer_t& this_) { return ze_internal_serializer_check(&this_); }; @@ -1014,21 +720,13 @@ inline void z_call(const z_loaned_closure_reply_t* closure, z_loaned_reply_t* re inline void z_call(const z_loaned_closure_sample_t* closure, z_loaned_sample_t* sample) { z_closure_sample_call(closure, sample); }; -inline void z_call(const z_loaned_closure_zid_t* closure, const z_id_t* z_id) { - z_closure_zid_call(closure, z_id); -}; -inline void z_call(const zc_loaned_closure_matching_status_t* closure, const zc_matching_status_t* mathing_status) { - zc_closure_matching_status_call(closure, mathing_status); -}; extern "C" using z_closure_drop_callback_t = void(void* context); extern "C" using z_closure_hello_callabck_t = void(z_loaned_hello_t *hello, void *context); extern "C" using z_closure_query_callabck_t = void(z_loaned_query_t *query, void *context); extern "C" using z_closure_reply_callabck_t = void(z_loaned_reply_t *reply, void *context); extern "C" using z_closure_sample_callabck_t = void(z_loaned_sample_t *sample, void *context); -extern "C" using z_closure_zid_callabck_t = void(const z_id_t *z_id, void *context); extern "C" using zc_closure_log_callabck_t = void(zc_log_severity_t severity, const z_loaned_string_t *msg, void *context); -extern "C" using zc_closure_matching_status_callabck_t = void(const zc_matching_status_t *matching_status, void *context); inline void z_closure(z_owned_closure_hello_t* this_, z_closure_hello_callabck_t* call, z_closure_drop_callback_t* drop, void* context) { @@ -1046,18 +744,10 @@ inline void z_closure(z_owned_closure_sample_t* this_, z_closure_sample_callabck z_closure_drop_callback_t* drop, void* context) { z_closure_sample(this_, call, drop, context); }; -inline void z_closure(z_owned_closure_zid_t* this_, z_closure_zid_callabck_t* call, - z_closure_drop_callback_t* drop, void* context) { - z_closure_zid(this_, call, drop, context); -}; inline void z_closure(zc_owned_closure_log_t* this_, zc_closure_log_callabck_t* call, z_closure_drop_callback_t* drop, void* context) { zc_closure_log(this_, call, drop, context); }; -inline void z_closure(zc_owned_closure_matching_status_t* this_, zc_closure_matching_status_callabck_t* call, - z_closure_drop_callback_t* drop, void* context) { - zc_closure_matching_status(this_, call, drop, context); -}; inline z_result_t z_try_recv(const z_loaned_fifo_handler_query_t* this_, z_owned_query_t* query) { @@ -1127,12 +817,6 @@ inline void z_clone(z_owned_reply_err_t* dst, z_loaned_reply_err_t* this_) { inline void z_clone(z_owned_sample_t* dst, z_loaned_sample_t* this_) { z_sample_clone(dst, this_); }; -inline void z_clone(z_owned_shm_client_storage_t* this_, z_loaned_shm_client_storage_t* from) { - z_shm_client_storage_clone(this_, from); -}; -inline void z_clone(z_owned_shm_t* out, z_loaned_shm_t* this_) { - z_shm_clone(out, this_); -}; inline void z_clone(z_owned_slice_t* dst, z_loaned_slice_t* this_) { z_slice_clone(dst, this_); }; @@ -1145,14 +829,10 @@ inline void z_clone(z_owned_string_t* dst, z_loaned_string_t* this_) { template struct z_loaned_to_owned_type_t {}; template struct z_owned_to_loaned_type_t {}; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_alloc_layout_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_alloc_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_bytes_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_bytes_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_bytes_writer_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_bytes_writer_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_chunk_alloc_result_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_chunk_alloc_result_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_hello_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_query_t type; }; @@ -1161,8 +841,6 @@ template<> struct z_loaned_to_owned_type_t { typedef z template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_reply_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_sample_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_sample_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_zid_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_zid_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_condvar_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_condvar_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_config_t type; }; @@ -1179,8 +857,6 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_h template<> struct z_owned_to_loaned_type_t { typedef z_loaned_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_keyexpr_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_keyexpr_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_memory_layout_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_memory_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_publisher_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_publisher_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_query_t type; }; @@ -1201,18 +877,8 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_ template<> struct z_owned_to_loaned_type_t { typedef z_loaned_sample_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_session_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_session_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_client_storage_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_client_storage_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_mut_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_mut_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_provider_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_provider_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_slice_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_slice_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_source_info_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_source_info_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_string_array_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_string_array_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_string_t type; }; @@ -1221,16 +887,6 @@ template<> struct z_loaned_to_owned_type_t { typedef z_ow template<> struct z_owned_to_loaned_type_t { typedef z_loaned_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_log_t type; }; template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_log_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_matching_status_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_matching_status_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef zc_owned_liveliness_token_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_liveliness_token_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef zc_owned_shm_client_list_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_shm_client_list_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef ze_owned_publication_cache_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef ze_loaned_publication_cache_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef ze_owned_querying_subscriber_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef ze_loaned_querying_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef ze_owned_serializer_t type; }; template<> struct z_owned_to_loaned_type_t { typedef ze_loaned_serializer_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_mutex_t type; }; diff --git a/src/session.rs b/src/session.rs index b64ff9b09..eb0421d3f 100644 --- a/src/session.rs +++ b/src/session.rs @@ -40,6 +40,19 @@ pub unsafe extern "C" fn z_session_loan(this_: &z_owned_session_t) -> &z_loaned_ .as_loaned_c_type_ref() } +// Mutably borrows session. +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub unsafe extern "C" fn z_session_loan_mut( + this_: &mut z_owned_session_t, +) -> &mut z_loaned_session_t { + this_ + .as_rust_type_mut() + .as_mut() + .unwrap_unchecked() + .as_loaned_c_type_mut() +} + /// Constructs a Zenoh session in its gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] @@ -141,17 +154,15 @@ pub extern "C" fn z_close_options_default(this_: &mut MaybeUninit, ) -> result::z_result_t { - let Some(s) = session.take_rust_type() else { - return result::Z_EINVAL; - }; + let s = session.as_rust_type_mut(); match s.close().wait() { Err(e) => { tracing::error!("Error closing session: {}", e); @@ -161,7 +172,16 @@ pub extern "C" fn z_close( } } -/// Frees memory and invalidates the session. +/// Checks if zenoh session is closed. +/// +/// @return `true` if session is closed, `false` otherwise. +#[no_mangle] +pub extern "C" fn z_session_is_closed(session: &z_loaned_session_t) -> bool { + let s = session.as_rust_type_ref(); + s.is_closed() +} + +/// Closes and invalidates the session. #[no_mangle] pub extern "C" fn z_session_drop(this_: &mut z_moved_session_t) { let _ = this_.take_rust_type(); diff --git a/tests/z_api_alignment_test.c b/tests/z_api_alignment_test.c index 712016538..8849268ed 100644 --- a/tests/z_api_alignment_test.c +++ b/tests/z_api_alignment_test.c @@ -346,15 +346,17 @@ int main(int argc, char **argv) { zp_stop_lease_task(z_loan(s1)); #endif - _ret_int8 = z_close(z_move(s1), NULL); + _ret_int8 = z_close(z_loan_mut(s1), NULL); assert(_ret_int8 == 0); + z_drop(z_move(s1)); #ifdef ZENOH_PICO zp_stop_read_task(z_loan(s2)); zp_stop_lease_task(z_loan(s2)); #endif - _ret_int8 = z_close(z_move(s2), NULL); + _ret_int8 = z_close(z_loan_mut(s2), NULL); assert(_ret_int8 == 0); + z_drop(z_move(s2)); z_sleep_s(SLEEP * 5); diff --git a/tests/z_api_double_drop_test.c b/tests/z_api_double_drop_test.c index 377268c37..50f5b3c1a 100644 --- a/tests/z_api_double_drop_test.c +++ b/tests/z_api_double_drop_test.c @@ -29,9 +29,9 @@ void test_session() { z_owned_session_t session; z_open(&session, z_move(config), NULL); assert(z_internal_check(session)); - z_close(z_move(session), NULL); + z_drop(z_move(session)); assert(!z_internal_check(session)); - z_close(z_move(session), NULL); + z_drop(z_move(session)); assert(!z_internal_check(session)); } @@ -51,7 +51,7 @@ void test_publisher() { assert(!z_internal_check(pub)); z_undeclare_publisher(z_move(pub)); assert(!z_internal_check(pub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); } void test_keyexpr() { @@ -94,7 +94,7 @@ void test_subscriber() { assert(!z_internal_check(sub)); z_undeclare_subscriber(z_move(sub)); assert(!z_internal_check(sub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); } void query_handler(z_loaned_query_t *query, void *context) {} @@ -116,7 +116,7 @@ void test_queryable() { assert(!z_internal_check(queryable)); z_undeclare_queryable(z_move(queryable)); assert(!z_internal_check(queryable)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); } int main(int argc, char **argv) { diff --git a/tests/z_api_drop_options.c b/tests/z_api_drop_options.c index 52c9f16fd..05e54f205 100644 --- a/tests/z_api_drop_options.c +++ b/tests/z_api_drop_options.c @@ -42,7 +42,7 @@ void put() { z_put(z_loan(s), z_loan(ke), z_move(payload), &opts); assert(!z_internal_check(payload)); assert(!z_internal_check(attachment)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); } void get() { @@ -70,7 +70,7 @@ void get() { z_get(z_loan(s), z_loan(ke), "", z_move(closure), &opts); assert(!z_internal_check(payload)); assert(!z_internal_check(attachment)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); } int main(int argc, char **argv) { diff --git a/tests/z_api_keyexpr_drop_test.c b/tests/z_api_keyexpr_drop_test.c index f10544c98..4e3e0d1a5 100644 --- a/tests/z_api_keyexpr_drop_test.c +++ b/tests/z_api_keyexpr_drop_test.c @@ -40,7 +40,7 @@ void test_publisher() { assert(strncmp(z_string_data(z_loan(pub_keyexpr)), "foo/bar", z_string_len(z_loan(pub_keyexpr))) == 0); // Check that publisher keeps the correct keyexpr z_undeclare_publisher(z_move(pub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); } void data_handler(z_loaned_sample_t *sample, void *arg) {} @@ -66,7 +66,7 @@ void test_subscriber() { assert(strncmp(z_string_data(z_loan(sub_keyexpr)), "foo/bar", z_string_len(z_loan(sub_keyexpr))) == 0); // Check that subscriber keeps the correct keyexpr z_undeclare_subscriber(z_move(sub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); } int main(int argc, char **argv) { diff --git a/tests/z_int_pub_cache_query_sub_test.c b/tests/z_int_pub_cache_query_sub_test.c index 08b9af7ca..8ee582cb7 100644 --- a/tests/z_int_pub_cache_query_sub_test.c +++ b/tests/z_int_pub_cache_query_sub_test.c @@ -86,7 +86,7 @@ int run_publisher() { ze_undeclare_publication_cache(z_move(pub_cache)); z_undeclare_publisher(z_move(pub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } @@ -144,7 +144,7 @@ int run_subscriber() { z_sleep_s(10); ze_undeclare_querying_subscriber(z_move(sub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return -1; } diff --git a/tests/z_int_pub_sub_attachment_test.c b/tests/z_int_pub_sub_attachment_test.c index bf9a3ad6f..f0a5b9ed9 100644 --- a/tests/z_int_pub_sub_attachment_test.c +++ b/tests/z_int_pub_sub_attachment_test.c @@ -127,7 +127,7 @@ int run_publisher() { } z_undeclare_publisher(z_move(pub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } @@ -191,7 +191,7 @@ int run_subscriber() { z_sleep_s(10); z_undeclare_subscriber(z_move(sub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return -1; } diff --git a/tests/z_int_pub_sub_test.c b/tests/z_int_pub_sub_test.c index f374b47bf..457dcbb0c 100644 --- a/tests/z_int_pub_sub_test.c +++ b/tests/z_int_pub_sub_test.c @@ -76,7 +76,7 @@ int run_publisher() { } z_undeclare_publisher(z_move(pub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } @@ -165,7 +165,7 @@ int run_subscriber() { sleep(10); z_undeclare_subscriber(z_move(sub)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return -1; } diff --git a/tests/z_int_queryable_attachment_test.c b/tests/z_int_queryable_attachment_test.c index 0277bed90..30cae247b 100644 --- a/tests/z_int_queryable_attachment_test.c +++ b/tests/z_int_queryable_attachment_test.c @@ -151,7 +151,7 @@ int run_queryable() { z_sleep_s(10); z_undeclare_queryable(z_move(qable)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } @@ -223,7 +223,7 @@ int run_get() { z_drop(z_move(reply)); z_drop(z_move(handler)); } - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/tests/z_int_queryable_test.c b/tests/z_int_queryable_test.c index 0edcea948..3bb58ecc8 100644 --- a/tests/z_int_queryable_test.c +++ b/tests/z_int_queryable_test.c @@ -83,7 +83,7 @@ int run_queryable() { z_sleep_s(10); z_undeclare_queryable(z_move(qable)); - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } @@ -163,7 +163,7 @@ int run_get() { } z_drop(z_move(handler)); } - z_close(z_move(s), NULL); + z_drop(z_move(s)); return 0; } diff --git a/tests/z_leak_pub_sub_test.c b/tests/z_leak_pub_sub_test.c index a0dee98f0..e4315d3cb 100644 --- a/tests/z_leak_pub_sub_test.c +++ b/tests/z_leak_pub_sub_test.c @@ -88,8 +88,8 @@ int main(int argc, char **argv) { z_undeclare_publisher(z_move(publisher)); z_undeclare_subscriber(z_move(subscriber)); - z_close(z_move(pub_session), NULL); - z_close(z_move(sub_session), NULL); + z_drop(z_move(pub_session)); + z_drop(z_move(sub_session)); z_drop(z_move(pub_keyexpr)); zc_stop_z_runtime(); diff --git a/tests/z_leak_queryable_get_test.c b/tests/z_leak_queryable_get_test.c index d7189270a..126a687f4 100644 --- a/tests/z_leak_queryable_get_test.c +++ b/tests/z_leak_queryable_get_test.c @@ -121,8 +121,8 @@ int main(int argc, char **argv) { assert(received_replies == 5); z_undeclare_queryable(z_move(queryable)); - z_close(z_move(get_session), NULL); - z_close(z_move(queryable_session), NULL); + z_drop(z_move(get_session)); + z_drop(z_move(queryable_session)); z_drop(z_move(queryable_keyexpr)); zc_stop_z_runtime();