From 2073e6dd26dc78a6b888d2cebd6b0b0807807265 Mon Sep 17 00:00:00 2001 From: Jean-Roland Date: Fri, 15 Nov 2024 16:02:04 +0100 Subject: [PATCH] fix: merge shenanigans --- include/zenoh-pico/collections/element.h | 4 - include/zenoh-pico/net/liveliness.h | 6 +- include/zenoh-pico/net/publish.h | 4 - include/zenoh-pico/net/query.h | 4 - include/zenoh-pico/net/session.h | 2 +- include/zenoh-pico/net/subscribe.h | 4 - include/zenoh-pico/protocol/codec/network.h | 4 - .../zenoh-pico/protocol/definitions/network.h | 4 - include/zenoh-pico/session/liveliness.h | 8 +- include/zenoh-pico/session/session.h | 2 +- include/zenoh-pico/session/subscription.h | 2 +- include/zenoh-pico/session/utils.h | 4 - include/zenoh-pico/transport/common/tx.h | 4 - include/zenoh-pico/transport/multicast/rx.h | 4 - include/zenoh-pico/transport/raweth/rx.h | 4 - include/zenoh-pico/transport/raweth/tx.h | 4 - include/zenoh-pico/transport/unicast/rx.h | 4 - src/api/api.c | 8 +- src/api/liveliness.c | 8 +- src/net/liveliness.c | 23 ++--- src/session/interest.c | 4 +- src/session/liveliness.c | 89 ++++++++++--------- src/session/push.c | 6 +- src/session/rx.c | 13 ++- src/session/subscription.c | 58 ++++++------ zenohpico.pc | 2 +- 26 files changed, 116 insertions(+), 163 deletions(-) diff --git a/include/zenoh-pico/collections/element.h b/include/zenoh-pico/collections/element.h index 16d061b93..5657a63b9 100644 --- a/include/zenoh-pico/collections/element.h +++ b/include/zenoh-pico/collections/element.h @@ -83,8 +83,4 @@ _Z_ELEM_DEFINE(_z_noop, _z_noop_t, _z_noop_size, _z_noop_clear, _z_noop_copy, _z } #endif -#ifdef __cplusplus -} -#endif - #endif /* ZENOH_PICO_COLLECTIONS_ELEMENT_H */ diff --git a/include/zenoh-pico/net/liveliness.h b/include/zenoh-pico/net/liveliness.h index 2f1be9e9d..3fb7c6ded 100644 --- a/include/zenoh-pico/net/liveliness.h +++ b/include/zenoh-pico/net/liveliness.h @@ -26,7 +26,7 @@ extern "C" { #if Z_FEATURE_LIVELINESS == 1 z_result_t _z_declare_liveliness_token(const _z_session_rc_t *zn, _z_liveliness_token_t *ret_token, - _z_keyexpr_t keyexpr); + _z_keyexpr_t *keyexpr); z_result_t _z_undeclare_liveliness_token(_z_liveliness_token_t *token); #if Z_FEATURE_SUBSCRIPTION == 1 @@ -43,7 +43,7 @@ z_result_t _z_undeclare_liveliness_token(_z_liveliness_token_t *token); * Returns: * The created :c:type:`_z_subscriber_t` (in null state if the declaration failed). */ -_z_subscriber_t _z_declare_liveliness_subscriber(const _z_session_rc_t *zn, _z_keyexpr_t keyexpr, +_z_subscriber_t _z_declare_liveliness_subscriber(const _z_session_rc_t *zn, _z_keyexpr_t *keyexpr, _z_closure_sample_callback_t callback, _z_drop_handler_t dropper, bool history, void *arg); @@ -71,7 +71,7 @@ z_result_t _z_undeclare_liveliness_subscriber(_z_subscriber_t *sub); * arg: A pointer that will be passed to the **callback** on each call. * timeout_ms: The timeout value of this query. */ -z_result_t _z_liveliness_query(_z_session_t *zn, _z_keyexpr_t keyexpr, _z_closure_reply_callback_t callback, +z_result_t _z_liveliness_query(_z_session_t *zn, const _z_keyexpr_t *keyexpr, _z_closure_reply_callback_t callback, _z_drop_handler_t dropper, void *arg, uint64_t timeout_ms); #endif // Z_FEATURE_QUERY == 1 diff --git a/include/zenoh-pico/net/publish.h b/include/zenoh-pico/net/publish.h index 6ce150432..b270f4eb3 100644 --- a/include/zenoh-pico/net/publish.h +++ b/include/zenoh-pico/net/publish.h @@ -52,8 +52,4 @@ void _z_publisher_free(_z_publisher_t **pub); } #endif -#ifdef __cplusplus -} -#endif - #endif /* INCLUDE_ZENOH_PICO_NET_PUBLISH_H */ diff --git a/include/zenoh-pico/net/query.h b/include/zenoh-pico/net/query.h index 63df14d25..82dbe9d8c 100644 --- a/include/zenoh-pico/net/query.h +++ b/include/zenoh-pico/net/query.h @@ -82,8 +82,4 @@ void _z_queryable_free(_z_queryable_t **qbl); } #endif -#ifdef __cplusplus -} -#endif - #endif /* ZENOH_PICO_QUERY_NETAPI_H */ diff --git a/include/zenoh-pico/net/session.h b/include/zenoh-pico/net/session.h index 45d554fe4..5ee1556dc 100644 --- a/include/zenoh-pico/net/session.h +++ b/include/zenoh-pico/net/session.h @@ -21,8 +21,8 @@ #include "zenoh-pico/collections/list.h" #include "zenoh-pico/config.h" #include "zenoh-pico/protocol/core.h" -#include "zenoh-pico/session/queryable.h" #include "zenoh-pico/session/liveliness.h" +#include "zenoh-pico/session/queryable.h" #include "zenoh-pico/session/session.h" #include "zenoh-pico/session/subscription.h" #include "zenoh-pico/utils/config.h" diff --git a/include/zenoh-pico/net/subscribe.h b/include/zenoh-pico/net/subscribe.h index 4e018047a..2357a0c8a 100644 --- a/include/zenoh-pico/net/subscribe.h +++ b/include/zenoh-pico/net/subscribe.h @@ -45,8 +45,4 @@ void _z_subscriber_free(_z_subscriber_t **sub); } #endif -#ifdef __cplusplus -} -#endif - #endif /* ZENOH_PICO_SUBSCRIBE_NETAPI_H */ diff --git a/include/zenoh-pico/protocol/codec/network.h b/include/zenoh-pico/protocol/codec/network.h index 406731d2c..661ee9de2 100644 --- a/include/zenoh-pico/protocol/codec/network.h +++ b/include/zenoh-pico/protocol/codec/network.h @@ -44,8 +44,4 @@ z_result_t _z_network_message_decode(_z_network_message_t *msg, _z_zbuf_t *zbf, } #endif -#ifdef __cplusplus -} -#endif - #endif /* INCLUDE_ZENOH_PICO_PROTOCOL_CODEC_NETWORK_H */ diff --git a/include/zenoh-pico/protocol/definitions/network.h b/include/zenoh-pico/protocol/definitions/network.h index e1c165fbc..f828d48f1 100644 --- a/include/zenoh-pico/protocol/definitions/network.h +++ b/include/zenoh-pico/protocol/definitions/network.h @@ -313,8 +313,4 @@ z_result_t _z_n_msg_copy(_z_network_message_t *dst, const _z_network_message_t * } #endif -#ifdef __cplusplus -} -#endif - #endif /* INCLUDE_ZENOH_PICO_PROTOCOL_DEFINITIONS_NETWORK_H */ diff --git a/include/zenoh-pico/session/liveliness.h b/include/zenoh-pico/session/liveliness.h index 3f375f70a..a3df1dc04 100644 --- a/include/zenoh-pico/session/liveliness.h +++ b/include/zenoh-pico/session/liveliness.h @@ -36,19 +36,19 @@ void _z_liveliness_pending_query_copy(_z_liveliness_pending_query_t *dst, const _z_liveliness_pending_query_t *_z_liveliness_pending_query_clone(const _z_liveliness_pending_query_t *src); _Z_ELEM_DEFINE(_z_liveliness_pending_query, _z_liveliness_pending_query_t, _z_noop_size, - _z_liveliness_pending_query_clear, _z_liveliness_pending_query_copy) + _z_liveliness_pending_query_clear, _z_liveliness_pending_query_copy, _z_noop_move) _Z_INT_MAP_DEFINE(_z_liveliness_pending_query, _z_liveliness_pending_query_t) uint32_t _z_liveliness_get_query_id(_z_session_t *zn); -z_result_t _z_liveliness_register_token(_z_session_t *zn, uint32_t id, const _z_keyexpr_t keyexpr); +z_result_t _z_liveliness_register_token(_z_session_t *zn, uint32_t id, const _z_keyexpr_t *keyexpr); void _z_liveliness_unregister_token(_z_session_t *zn, uint32_t id); #if Z_FEATURE_SUBSCRIPTION == 1 -z_result_t _z_liveliness_subscription_declare(_z_session_t *zn, uint32_t id, const _z_keyexpr_t keyexpr, +z_result_t _z_liveliness_subscription_declare(_z_session_t *zn, uint32_t id, const _z_keyexpr_t *keyexpr, const _z_timestamp_t *timestamp); z_result_t _z_liveliness_subscription_undeclare(_z_session_t *zn, uint32_t id, const _z_timestamp_t *timestamp); -z_result_t _z_liveliness_subscription_trigger_history(_z_session_t *zn, _z_keyexpr_t keyexpr); +z_result_t _z_liveliness_subscription_trigger_history(_z_session_t *zn, const _z_keyexpr_t *keyexpr); #endif #if Z_FEATURE_QUERY == 1 diff --git a/include/zenoh-pico/session/session.h b/include/zenoh-pico/session/session.h index b0848dfd4..d1fefc934 100644 --- a/include/zenoh-pico/session/session.h +++ b/include/zenoh-pico/session/session.h @@ -55,7 +55,7 @@ size_t _z_resource_size(_z_resource_t *p); _Z_ELEM_DEFINE(_z_resource, _z_resource_t, _z_noop_size, _z_resource_clear, _z_resource_copy, _z_noop_move) _Z_LIST_DEFINE(_z_resource, _z_resource_t) -_Z_ELEM_DEFINE(_z_keyexpr, _z_keyexpr_t, _z_keyexpr_size, _z_keyexpr_clear, _z_keyexpr_copy) +_Z_ELEM_DEFINE(_z_keyexpr, _z_keyexpr_t, _z_keyexpr_size, _z_keyexpr_clear, _z_keyexpr_copy, _z_keyexpr_move) _Z_INT_MAP_DEFINE(_z_keyexpr, _z_keyexpr_t) // Forward declaration to avoid cyclical include diff --git a/include/zenoh-pico/session/subscription.h b/include/zenoh-pico/session/subscription.h index 01f8d5da1..b70871b30 100644 --- a/include/zenoh-pico/session/subscription.h +++ b/include/zenoh-pico/session/subscription.h @@ -44,7 +44,7 @@ typedef struct { /*------------------ Subscription ------------------*/ z_result_t _z_trigger_subscriptions_put(_z_session_t *zn, _z_keyexpr_t *keyexpr, _z_bytes_t *payload, - _z_encoding_t *encoding, const _z_n_qos_t qos, const _z_timestamp_t *timestamp, + _z_encoding_t *encoding, const _z_timestamp_t *timestamp, const _z_n_qos_t qos, _z_bytes_t *attachment, z_reliability_t reliability); z_result_t _z_trigger_subscriptions_del(_z_session_t *zn, _z_keyexpr_t *keyexpr, const _z_timestamp_t *timestamp, diff --git a/include/zenoh-pico/session/utils.h b/include/zenoh-pico/session/utils.h index a267392af..44c48ff91 100644 --- a/include/zenoh-pico/session/utils.h +++ b/include/zenoh-pico/session/utils.h @@ -48,8 +48,4 @@ static inline void _z_session_mutex_unlock(_z_session_t *zn) { _ZP_UNUSED(zn); } } #endif -#ifdef __cplusplus -} -#endif - #endif /* INCLUDE_ZENOH_PICO_SESSION_UTILS_H */ diff --git a/include/zenoh-pico/transport/common/tx.h b/include/zenoh-pico/transport/common/tx.h index 3676377e1..6809f20f3 100644 --- a/include/zenoh-pico/transport/common/tx.h +++ b/include/zenoh-pico/transport/common/tx.h @@ -41,8 +41,4 @@ z_result_t _z_send_n_batch(_z_session_t *zn, z_congestion_control_t cong_ctrl); } #endif -#ifdef __cplusplus -} -#endif - #endif /* ZENOH_PICO_TRANSPORT_TX_H */ diff --git a/include/zenoh-pico/transport/multicast/rx.h b/include/zenoh-pico/transport/multicast/rx.h index ff8a8e560..f7a81e00a 100644 --- a/include/zenoh-pico/transport/multicast/rx.h +++ b/include/zenoh-pico/transport/multicast/rx.h @@ -30,8 +30,4 @@ z_result_t _z_multicast_update_rx_buffer(_z_transport_multicast_t *ztm); } #endif -#ifdef __cplusplus -} -#endif - #endif /* ZENOH_PICO_TRANSPORT_LINK_RX_H */ diff --git a/include/zenoh-pico/transport/raweth/rx.h b/include/zenoh-pico/transport/raweth/rx.h index fff822dfd..19901b68f 100644 --- a/include/zenoh-pico/transport/raweth/rx.h +++ b/include/zenoh-pico/transport/raweth/rx.h @@ -29,8 +29,4 @@ z_result_t _z_raweth_update_rx_buff(_z_transport_multicast_t *ztm); } #endif -#ifdef __cplusplus -} -#endif - #endif /* ZENOH_PICO_RAWETH_RX_H */ diff --git a/include/zenoh-pico/transport/raweth/tx.h b/include/zenoh-pico/transport/raweth/tx.h index c89d61e84..a338c16f3 100644 --- a/include/zenoh-pico/transport/raweth/tx.h +++ b/include/zenoh-pico/transport/raweth/tx.h @@ -31,8 +31,4 @@ z_result_t _z_raweth_send_t_msg(_z_transport_common_t *ztc, const _z_transport_m } #endif -#ifdef __cplusplus -} -#endif - #endif /* ZENOH_PICO_RAWETH_TX_H */ diff --git a/include/zenoh-pico/transport/unicast/rx.h b/include/zenoh-pico/transport/unicast/rx.h index 0bb88669f..8052ebd88 100644 --- a/include/zenoh-pico/transport/unicast/rx.h +++ b/include/zenoh-pico/transport/unicast/rx.h @@ -30,8 +30,4 @@ z_result_t _z_unicast_update_rx_buffer(_z_transport_unicast_t *ztu); } #endif -#ifdef __cplusplus -} -#endif - #endif /* ZENOH_PICO_UNICAST_RX_H */ diff --git a/src/api/api.c b/src/api/api.c index aa4b8ef4d..40f3e5ed3 100644 --- a/src/api/api.c +++ b/src/api/api.c @@ -830,9 +830,9 @@ z_result_t z_put(const z_loaned_session_t *zs, const z_loaned_keyexpr_t *keyexpr _z_timestamp_t local_timestamp = (opt.timestamp != NULL) ? *opt.timestamp : _z_timestamp_null(); _z_encoding_t local_encoding = (opt.encoding != NULL) ? &opt.encoding->_this._val : _z_encoding_null(); _z_trigger_subscriptions_put( - _Z_RC_IN_VAL(zs), &keyexpr_aliased, &payload_bytes, &local_encoding, + _Z_RC_IN_VAL(zs), &keyexpr_aliased, &payload_bytes, &local_encoding, , &local_timestamp, _z_n_qos_make(opt.is_express, opt.congestion_control == Z_CONGESTION_CONTROL_BLOCK, opt.priority), - &local_timestamp, &attachment_bytes, reliability); + &attachment_bytes, reliability); #endif // Clean-up z_encoding_drop(opt.encoding); @@ -977,9 +977,9 @@ z_result_t z_publisher_put(const z_loaned_publisher_t *pub, z_moved_bytes_t *pay #if Z_FEATURE_LOCAL_SUBSCRIBER == 1 _z_timestamp_t local_timestamp = (opt.timestamp != NULL) ? *opt.timestamp : _z_timestamp_null(); _z_trigger_subscriptions_put( - session, &pub_keyexpr, &payload_bytes, &encoding, + session, &pub_keyexpr, &payload_bytes, &encoding, &local_timestamp, _z_n_qos_make(pub->_is_express, pub->_congestion_control == Z_CONGESTION_CONTROL_BLOCK, pub->_priority), - &local_timestamp, &attachment_bytes, reliability); + &attachment_bytes, reliability); #endif } else { ret = _Z_ERR_SESSION_CLOSED; diff --git a/src/api/liveliness.c b/src/api/liveliness.c index 4f4139396..a9403361f 100644 --- a/src/api/liveliness.c +++ b/src/api/liveliness.c @@ -59,7 +59,7 @@ z_result_t z_liveliness_declare_token(const z_loaned_session_t *zs, z_owned_live _z_keyexpr_t key = _z_update_keyexpr_to_declared(_Z_RC_IN_VAL(zs), *keyexpr); - return _z_declare_liveliness_token(zs, &token->_val, key); + return _z_declare_liveliness_token(zs, &token->_val, &key); } z_result_t z_liveliness_undeclare_token(z_moved_liveliness_token_t *token) { @@ -89,7 +89,7 @@ z_result_t z_liveliness_declare_subscriber(const z_loaned_session_t *zs, z_owned _z_keyexpr_t key = _z_update_keyexpr_to_declared(_Z_RC_IN_VAL(zs), *keyexpr); - _z_subscriber_t int_sub = _z_declare_liveliness_subscriber(zs, key, callback->_this._val.call, + _z_subscriber_t int_sub = _z_declare_liveliness_subscriber(zs, &key, callback->_this._val.call, callback->_this._val.drop, opt.history, ctx); z_internal_closure_sample_null(&callback->_this); @@ -100,7 +100,7 @@ z_result_t z_liveliness_declare_subscriber(const z_loaned_session_t *zs, z_owned } if (opt.history) { - z_result_t ret = _z_liveliness_subscription_trigger_history(_Z_RC_IN_VAL(zs), *keyexpr); + z_result_t ret = _z_liveliness_subscription_trigger_history(_Z_RC_IN_VAL(zs), keyexpr); if (ret != _Z_RES_OK) { return ret; } @@ -132,7 +132,7 @@ z_result_t z_liveliness_get(const z_loaned_session_t *zs, const z_loaned_keyexpr opt = *options; } - ret = _z_liveliness_query(_Z_RC_IN_VAL(zs), *keyexpr, callback->_this._val.call, callback->_this._val.drop, ctx, + ret = _z_liveliness_query(_Z_RC_IN_VAL(zs), keyexpr, callback->_this._val.call, callback->_this._val.drop, ctx, opt.timeout_ms); z_internal_closure_reply_null( diff --git a/src/net/liveliness.c b/src/net/liveliness.c index 45966698f..b428a234a 100644 --- a/src/net/liveliness.c +++ b/src/net/liveliness.c @@ -21,6 +21,7 @@ #include "zenoh-pico/session/session.h" #include "zenoh-pico/session/subscription.h" #include "zenoh-pico/session/utils.h" +#include "zenoh-pico/transport/common/tx.h" #include "zenoh-pico/utils/result.h" #if Z_FEATURE_LIVELINESS == 1 @@ -28,12 +29,12 @@ /**************** Liveliness Token ****************/ z_result_t _z_declare_liveliness_token(const _z_session_rc_t *zn, _z_liveliness_token_t *ret_token, - _z_keyexpr_t keyexpr) { + _z_keyexpr_t *keyexpr) { z_result_t ret; uint32_t id = _z_get_entity_id(_Z_RC_IN_VAL(zn)); - _z_declaration_t declaration = _z_make_decl_token(&keyexpr, id); + _z_declaration_t declaration = _z_make_decl_token(keyexpr, id); _z_network_message_t n_msg = _z_n_msg_make_declare(declaration, false, 0); ret = _z_send_n_msg(_Z_RC_IN_VAL(zn), &n_msg, Z_RELIABILITY_RELIABLE, Z_CONGESTION_CONTROL_BLOCK); _z_n_msg_clear(&n_msg); @@ -41,7 +42,7 @@ z_result_t _z_declare_liveliness_token(const _z_session_rc_t *zn, _z_liveliness_ _z_liveliness_register_token(_Z_RC_IN_VAL(zn), id, keyexpr); ret_token->_id = id; - _z_keyexpr_move(&ret_token->_key, &keyexpr); + _z_keyexpr_move(&ret_token->_key, keyexpr); ret_token->_zn = _z_session_rc_clone_as_weak(zn); return ret; } @@ -66,13 +67,13 @@ z_result_t _z_undeclare_liveliness_token(_z_liveliness_token_t *token) { /**************** Liveliness Subscriber ****************/ #if Z_FEATURE_SUBSCRIPTION == 1 -_z_subscriber_t _z_declare_liveliness_subscriber(const _z_session_rc_t *zn, _z_keyexpr_t keyexpr, +_z_subscriber_t _z_declare_liveliness_subscriber(const _z_session_rc_t *zn, _z_keyexpr_t *keyexpr, _z_closure_sample_callback_t callback, _z_drop_handler_t dropper, bool history, void *arg) { _z_subscription_t s; s._id = _z_get_entity_id(_Z_RC_IN_VAL(zn)); - s._key_id = keyexpr._id; - s._key = _z_get_expanded_key_from_key(_Z_RC_IN_VAL(zn), &keyexpr); + s._key_id = keyexpr->_id; + s._key = _z_get_expanded_key_from_key(_Z_RC_IN_VAL(zn), keyexpr); s._callback = callback; s._dropper = dropper; s._arg = arg; @@ -88,7 +89,7 @@ _z_subscriber_t _z_declare_liveliness_subscriber(const _z_session_rc_t *zn, _z_k // Build the declare message to send on the wire uint8_t mode = history ? (_Z_INTEREST_FLAG_CURRENT | _Z_INTEREST_FLAG_FUTURE) : _Z_INTEREST_FLAG_FUTURE; _z_interest_t interest = _z_make_interest( - &keyexpr, s._id, _Z_INTEREST_FLAG_KEYEXPRS | _Z_INTEREST_FLAG_TOKENS | _Z_INTEREST_FLAG_RESTRICTED | mode); + keyexpr, s._id, _Z_INTEREST_FLAG_KEYEXPRS | _Z_INTEREST_FLAG_TOKENS | _Z_INTEREST_FLAG_RESTRICTED | mode); _z_network_message_t n_msg = _z_n_msg_make_interest(interest); if (_z_send_n_msg(_Z_RC_IN_VAL(zn), &n_msg, Z_RELIABILITY_RELIABLE, Z_CONGESTION_CONTROL_BLOCK) != _Z_RES_OK) { @@ -131,7 +132,7 @@ z_result_t _z_undeclare_liveliness_subscriber(_z_subscriber_t *sub) { /**************** Liveliness Query ****************/ #if Z_FEATURE_QUERY == 1 -z_result_t _z_liveliness_query(_z_session_t *zn, _z_keyexpr_t keyexpr, _z_closure_reply_callback_t callback, +z_result_t _z_liveliness_query(_z_session_t *zn, const _z_keyexpr_t *keyexpr, _z_closure_reply_callback_t callback, _z_drop_handler_t dropper, void *arg, uint64_t timeout_ms) { z_result_t ret = _Z_RES_OK; @@ -140,7 +141,7 @@ z_result_t _z_liveliness_query(_z_session_t *zn, _z_keyexpr_t keyexpr, _z_closur (_z_liveliness_pending_query_t *)z_malloc(sizeof(_z_liveliness_pending_query_t)); if (pq != NULL) { uint32_t id = _z_liveliness_get_query_id(zn); - pq->_key = _z_get_expanded_key_from_key(zn, &keyexpr); + pq->_key = _z_get_expanded_key_from_key(zn, keyexpr); pq->_callback = callback; pq->_dropper = dropper; pq->_arg = arg; @@ -148,8 +149,8 @@ z_result_t _z_liveliness_query(_z_session_t *zn, _z_keyexpr_t keyexpr, _z_closur ret = _z_liveliness_register_pending_query(zn, id, pq); if (ret == _Z_RES_OK) { _ZP_UNUSED(timeout_ms); // Current interest in pico don't support timeout - - _z_interest_t interest = _z_make_interest(&keyexpr, id, + _z_keyexpr_t key = _z_keyexpr_alias(*keyexpr); + _z_interest_t interest = _z_make_interest(&key, id, _Z_INTEREST_FLAG_KEYEXPRS | _Z_INTEREST_FLAG_TOKENS | _Z_INTEREST_FLAG_RESTRICTED | _Z_INTEREST_FLAG_CURRENT); diff --git a/src/session/interest.c b/src/session/interest.c index 36ef208ed..88a0626bd 100644 --- a/src/session/interest.c +++ b/src/session/interest.c @@ -178,9 +178,9 @@ static z_result_t _z_interest_send_decl_queryable(_z_session_t *zn, uint32_t int #if Z_FEATURE_LIVELINESS == 1 static z_result_t _z_interest_send_decl_token(_z_session_t *zn, uint32_t interest_id) { - _zp_session_lock_mutex(zn); + _z_session_mutex_lock(zn); _z_keyexpr_intmap_t token_list = _z_keyexpr_intmap_clone(&zn->_local_tokens); - _zp_session_unlock_mutex(zn); + _z_session_mutex_unlock(zn); _z_keyexpr_intmap_iterator_t iter = _z_keyexpr_intmap_iterator_make(&token_list); while (_z_keyexpr_intmap_iterator_next(&iter)) { // Build the declare message to send on the wire diff --git a/src/session/liveliness.c b/src/session/liveliness.c index a02a99cc3..cdbbcf766 100644 --- a/src/session/liveliness.c +++ b/src/session/liveliness.c @@ -34,58 +34,59 @@ /**************** Liveliness Token ****************/ -z_result_t _z_liveliness_register_token(_z_session_t *zn, uint32_t id, const _z_keyexpr_t keyexpr) { +z_result_t _z_liveliness_register_token(_z_session_t *zn, uint32_t id, const _z_keyexpr_t *keyexpr) { z_result_t ret = _Z_RES_OK; - _Z_DEBUG("Register liveliness token (%i:%.*s)", (int)id, (int)_z_string_len(&keyexpr._suffix), - _z_string_data(&keyexpr._suffix)); + _Z_DEBUG("Register liveliness token (%i:%.*s)", (int)id, (int)_z_string_len(&keyexpr->_suffix), + _z_string_data(&keyexpr->_suffix)); - _zp_session_lock_mutex(zn); + _z_session_mutex_lock(zn); const _z_keyexpr_t *pkeyexpr = _z_keyexpr_intmap_get(&zn->_local_tokens, id); if (pkeyexpr != NULL) { _Z_ERROR("Duplicate token id %i", (int)id); ret = _Z_ERR_ENTITY_DECLARATION_FAILED; } else { - _z_keyexpr_intmap_insert(&zn->_local_tokens, id, _z_keyexpr_clone(&keyexpr)); + _z_keyexpr_intmap_insert(&zn->_local_tokens, id, _z_keyexpr_clone(keyexpr)); } - _zp_session_unlock_mutex(zn); + _z_session_mutex_unlock(zn); return ret; } void _z_liveliness_unregister_token(_z_session_t *zn, uint32_t id) { - _zp_session_lock_mutex(zn); + _z_session_mutex_lock(zn); _Z_DEBUG("Unregister liveliness token (%i)", (int)id); _z_keyexpr_intmap_remove(&zn->_local_tokens, id); - _zp_session_unlock_mutex(zn); + _z_session_mutex_unlock(zn); } /**************** Liveliness Subscriber ****************/ #if Z_FEATURE_SUBSCRIPTION == 1 -z_result_t _z_liveliness_subscription_declare(_z_session_t *zn, uint32_t id, const _z_keyexpr_t keyexpr, +z_result_t _z_liveliness_subscription_declare(_z_session_t *zn, uint32_t id, const _z_keyexpr_t *keyexpr, const _z_timestamp_t *timestamp) { z_result_t ret = _Z_RES_OK; - _zp_session_lock_mutex(zn); + _z_session_mutex_lock(zn); const _z_keyexpr_t *pkeyexpr = _z_keyexpr_intmap_get(&zn->_remote_tokens, id); if (pkeyexpr != NULL) { _Z_ERROR("Duplicate token id %i", (int)id); ret = _Z_ERR_ENTITY_DECLARATION_FAILED; } else { - _z_keyexpr_intmap_insert(&zn->_remote_tokens, id, _z_keyexpr_clone(&keyexpr)); + _z_keyexpr_intmap_insert(&zn->_remote_tokens, id, _z_keyexpr_clone(keyexpr)); } - _zp_session_unlock_mutex(zn); + _z_session_mutex_unlock(zn); if (ret == _Z_RES_OK) { - ret = _z_trigger_liveliness_subscriptions_declare(zn, keyexpr, timestamp); + _z_keyexpr_t key = _z_keyexpr_alias(*keyexpr); + ret = _z_trigger_liveliness_subscriptions_declare(zn, &key, timestamp); } return ret; @@ -95,7 +96,7 @@ z_result_t _z_liveliness_subscription_undeclare(_z_session_t *zn, uint32_t id, c z_result_t ret = _Z_RES_OK; _z_keyexpr_t *key = NULL; - _zp_session_lock_mutex(zn); + _z_session_mutex_lock(zn); const _z_keyexpr_t *keyexpr = _z_keyexpr_intmap_get(&zn->_remote_tokens, id); if (keyexpr != NULL) { key = _z_keyexpr_clone(keyexpr); @@ -103,32 +104,32 @@ z_result_t _z_liveliness_subscription_undeclare(_z_session_t *zn, uint32_t id, c } else { ret = _Z_ERR_ENTITY_UNKNOWN; } - _zp_session_unlock_mutex(zn); + _z_session_mutex_unlock(zn); if (key != NULL) { - ret = _z_trigger_liveliness_subscriptions_undeclare(zn, *key, timestamp); + ret = _z_trigger_liveliness_subscriptions_undeclare(zn, key, timestamp); _z_keyexpr_clear(key); } return ret; } -z_result_t _z_liveliness_subscription_trigger_history(_z_session_t *zn, _z_keyexpr_t keyexpr) { +z_result_t _z_liveliness_subscription_trigger_history(_z_session_t *zn, const _z_keyexpr_t *keyexpr) { z_result_t ret = _Z_RES_OK; - _Z_DEBUG("Retrieve liveliness history for %.*s", (int)_z_string_len(&keyexpr._suffix), - _z_string_data(&keyexpr._suffix)); + _Z_DEBUG("Retrieve liveliness history for %.*s", (int)_z_string_len(&keyexpr->_suffix), + _z_string_data(&keyexpr->_suffix)); - _zp_session_lock_mutex(zn); + _z_session_mutex_lock(zn); _z_keyexpr_intmap_t token_list = _z_keyexpr_intmap_clone(&zn->_remote_tokens); - _zp_session_unlock_mutex(zn); + _z_session_mutex_unlock(zn); _z_keyexpr_intmap_iterator_t iter = _z_keyexpr_intmap_iterator_make(&token_list); _z_timestamp_t tm = _z_timestamp_null(); while (_z_keyexpr_intmap_iterator_next(&iter)) { _z_keyexpr_t key = *_z_keyexpr_intmap_iterator_value(&iter); - if (_z_keyexpr_suffix_intersects(&key, &keyexpr)) { - ret = _z_trigger_liveliness_subscriptions_declare(zn, key, &tm); + if (_z_keyexpr_suffix_intersects(&key, keyexpr)) { + ret = _z_trigger_liveliness_subscriptions_declare(zn, &key, &tm); if (ret != _Z_RES_OK) { break; } @@ -174,7 +175,7 @@ z_result_t _z_liveliness_register_pending_query(_z_session_t *zn, uint32_t id, _ _Z_DEBUG("Register liveliness query for (%ju:%.*s)", (uintmax_t)pen_qry->_key._id, (int)_z_string_len(&pen_qry->_key._suffix), _z_string_data(&pen_qry->_key._suffix)); - _zp_session_lock_mutex(zn); + _z_session_mutex_lock(zn); const _z_liveliness_pending_query_t *pq = _z_liveliness_pending_query_intmap_get(&zn->_liveliness_pending_queries, id); @@ -186,16 +187,16 @@ z_result_t _z_liveliness_register_pending_query(_z_session_t *zn, uint32_t id, _ _z_liveliness_pending_query_clone(pen_qry)); } - _zp_session_unlock_mutex(zn); + _z_session_mutex_unlock(zn); return ret; } -z_result_t _z_liveliness_pending_query_reply(_z_session_t *zn, uint32_t interest_id, const _z_keyexpr_t keyexpr, +z_result_t _z_liveliness_pending_query_reply(_z_session_t *zn, uint32_t interest_id, const _z_keyexpr_t *keyexpr, const _z_timestamp_t *timestamp) { z_result_t ret = _Z_RES_OK; - _zp_session_lock_mutex(zn); + _z_session_mutex_lock(zn); const _z_liveliness_pending_query_t *pq = _z_liveliness_pending_query_intmap_get(&zn->_liveliness_pending_queries, interest_id); @@ -206,9 +207,9 @@ z_result_t _z_liveliness_pending_query_reply(_z_session_t *zn, uint32_t interest _Z_DEBUG("Liveliness pending query reply %i resolve result %i", (int)interest_id, ret); if (ret == _Z_RES_OK) { - _Z_DEBUG("Resolving %d - %.*s on mapping 0x%x", keyexpr._id, (int)_z_string_len(&keyexpr._suffix), - _z_string_data(&keyexpr._suffix), _z_keyexpr_mapping_id(&keyexpr)); - _z_keyexpr_t expanded_ke = __unsafe_z_get_expanded_key_from_key(zn, &keyexpr); + _Z_DEBUG("Resolving %d - %.*s on mapping 0x%x", keyexpr->_id, (int)_z_string_len(&keyexpr->_suffix), + _z_string_data(&keyexpr->_suffix), _z_keyexpr_mapping_id(keyexpr)); + _z_keyexpr_t expanded_ke = __unsafe_z_get_expanded_key_from_key(zn, keyexpr, true); _Z_DEBUG("Reply liveliness query for %d - %.*s", expanded_ke._id, (int)_z_string_len(&expanded_ke._suffix), _z_string_data(&expanded_ke._suffix)); @@ -218,15 +219,17 @@ z_result_t _z_liveliness_pending_query_reply(_z_session_t *zn, uint32_t interest if (ret == _Z_RES_OK) { _z_encoding_t encoding = _z_encoding_null(); - _z_reply_t reply = _z_reply_create(expanded_ke, zn->_local_zid, _z_bytes_null(), timestamp, &encoding, - Z_SAMPLE_KIND_PUT, _z_bytes_null()); + _z_bytes_t payload = _z_bytes_null(); + _z_bytes_t attachment = _z_bytes_null(); + _z_reply_t reply = _z_reply_alias(&expanded_ke, zn->_local_zid, &payload, timestamp, &encoding, + Z_SAMPLE_KIND_PUT, &attachment); pq->_callback(&reply, pq->_arg); _z_reply_clear(&reply); } } - _zp_session_unlock_mutex(zn); + _z_session_mutex_unlock(zn); return ret; } @@ -234,7 +237,7 @@ z_result_t _z_liveliness_pending_query_reply(_z_session_t *zn, uint32_t interest z_result_t _z_liveliness_pending_query_drop(_z_session_t *zn, uint32_t interest_id) { z_result_t ret = _Z_RES_OK; - _zp_session_lock_mutex(zn); + _z_session_mutex_lock(zn); const _z_liveliness_pending_query_t *pq = _z_liveliness_pending_query_intmap_get(&zn->_liveliness_pending_queries, interest_id); @@ -248,17 +251,17 @@ z_result_t _z_liveliness_pending_query_drop(_z_session_t *zn, uint32_t interest_ _z_liveliness_pending_query_intmap_remove(&zn->_liveliness_pending_queries, interest_id); } - _zp_session_unlock_mutex(zn); + _z_session_mutex_unlock(zn); return ret; } void _z_liveliness_unregister_pending_query(_z_session_t *zn, uint32_t id) { - _zp_session_lock_mutex(zn); + _z_session_mutex_lock(zn); _z_liveliness_pending_query_intmap_remove(&zn->_liveliness_pending_queries, id); - _zp_session_unlock_mutex(zn); + _z_session_mutex_unlock(zn); } #endif // Z_FEATURE_QUERY == 1 @@ -268,14 +271,14 @@ void _z_liveliness_unregister_pending_query(_z_session_t *zn, uint32_t id) { z_result_t _z_liveliness_process_token_declare(_z_session_t *zn, const _z_n_msg_declare_t *decl) { #if Z_FEATURE_QUERY == 1 if (decl->has_interest_id) { - _z_liveliness_pending_query_reply(zn, decl->_interest_id, decl->_decl._body._decl_token._keyexpr, + _z_liveliness_pending_query_reply(zn, decl->_interest_id, &decl->_decl._body._decl_token._keyexpr, &decl->_ext_timestamp); } #endif #if Z_FEATURE_SUBSCRIPTION == 1 return _z_liveliness_subscription_declare(zn, decl->_decl._body._decl_token._id, - decl->_decl._body._decl_token._keyexpr, &decl->_ext_timestamp); + &decl->_decl._body._decl_token._keyexpr, &decl->_ext_timestamp); #else _ZP_UNUSED(zn); _ZP_UNUSED(decl); @@ -309,7 +312,7 @@ z_result_t _z_liveliness_process_declare_final(_z_session_t *zn, const _z_n_msg_ /**************** Init/Clear ****************/ void _z_liveliness_init(_z_session_t *zn) { - _zp_session_lock_mutex(zn); + _z_session_mutex_lock(zn); zn->_remote_tokens = _z_keyexpr_intmap_make(); zn->_local_tokens = _z_keyexpr_intmap_make(); @@ -318,11 +321,11 @@ void _z_liveliness_init(_z_session_t *zn) { zn->_liveliness_pending_queries = _z_liveliness_pending_query_intmap_make(); #endif - _zp_session_unlock_mutex(zn); + _z_session_mutex_unlock(zn); } void _z_liveliness_clear(_z_session_t *zn) { - _zp_session_lock_mutex(zn); + _z_session_mutex_lock(zn); #if Z_FEATURE_QUERY == 1 _z_liveliness_pending_query_intmap_clear(&zn->_liveliness_pending_queries); @@ -330,7 +333,7 @@ void _z_liveliness_clear(_z_session_t *zn) { _z_keyexpr_intmap_clear(&zn->_local_tokens); _z_keyexpr_intmap_clear(&zn->_remote_tokens); - _zp_session_unlock_mutex(zn); + _z_session_mutex_unlock(zn); } #endif // Z_FEATURE_LIVELINESS == 1 diff --git a/src/session/push.c b/src/session/push.c index 6f0a6c371..098a1ec24 100644 --- a/src/session/push.c +++ b/src/session/push.c @@ -29,11 +29,11 @@ z_result_t _z_trigger_push(_z_session_t *zn, _z_n_msg_push_t *push, z_reliabilit if (push->_body._is_put) { _z_msg_put_t *put = &push->_body._body._put; - ret = _z_trigger_subscriptions_put(zn, push->_key, put->_payload, &put->_encoding, &put->_commons._timestamp, - push->_qos, put->_attachment, reliability); + ret = _z_trigger_subscriptions_put(zn, &push->_key, &put->_payload, &put->_encoding, &put->_commons._timestamp, + push->_qos, &put->_attachment, reliability); } else { _z_msg_del_t *del = &push->_body._body._del; - ret = _z_trigger_subscriptions_del(zn, push->_key, &del->_commons._timestamp, push->_qos, del->_attachment, + ret = _z_trigger_subscriptions_del(zn, &push->_key, &del->_commons._timestamp, push->_qos, &del->_attachment, reliability); } return ret; diff --git a/src/session/rx.c b/src/session/rx.c index c9ac83fcc..d94621b70 100644 --- a/src/session/rx.c +++ b/src/session/rx.c @@ -110,9 +110,9 @@ z_result_t _z_handle_network_message(_z_session_rc_t *zsrc, _z_zenoh_message_t * case _Z_REQUEST_PUT: { #if Z_FEATURE_SUBSCRIPTION == 1 _z_msg_put_t put = req->_body._put; - ret = _z_trigger_subscriptions_put(zn, &req->_key, &put._payload, &put._encoding, Z_SAMPLE_KIND_PUT, - &put._commons._timestamp, req->_ext_qos, &put._attachment, - msg->_reliability); + ret = _z_trigger_subscriptions_put(zn, &req->_key, &put._payload, &put._encoding, + &put._commons._timestamp, req->_ext_qos, &put._attachment, + msg->_reliability); #endif if (ret == _Z_RES_OK) { _z_network_message_t final = _z_n_msg_make_response_final(req->_rid); @@ -122,11 +122,8 @@ z_result_t _z_handle_network_message(_z_session_rc_t *zsrc, _z_zenoh_message_t * case _Z_REQUEST_DEL: { #if Z_FEATURE_SUBSCRIPTION == 1 _z_msg_del_t del = req->_body._del; - _z_encoding_t encoding = _z_encoding_null(); - _z_bytes_t empty_payload = _z_bytes_null(); - ret = _z_trigger_subscriptions_del(zn, &req->_key, &empty_payload, &encoding, Z_SAMPLE_KIND_DELETE, - &del._commons._timestamp, req->_ext_qos, &del._attachment, - msg->_reliability); + ret = _z_trigger_subscriptions_del(zn, &req->_key, &del._commons._timestamp, req->_ext_qos, + &del._attachment, msg->_reliability); #endif if (ret == _Z_RES_OK) { _z_network_message_t final = _z_n_msg_make_response_final(req->_rid); diff --git a/src/session/subscription.c b/src/session/subscription.c index b23fe71e5..adc4fb8e2 100644 --- a/src/session/subscription.c +++ b/src/session/subscription.c @@ -129,7 +129,8 @@ _z_subscription_rc_t *__unsafe_z_get_subscription_by_id(_z_session_t *zn, _z_sub * Make sure that the following mutexes are locked before calling this function: * - zn->_mutex_inner */ -static z_result_t __unsafe_z_get_subscriptions_by_key(_z_session_t *zn, _z_subscriber_kind_t kind, const _z_keyexpr_t *key, +static z_result_t __unsafe_z_get_subscriptions_by_key(_z_session_t *zn, _z_subscriber_kind_t kind, + const _z_keyexpr_t *key, _z_subscription_infos_svec_t *sub_infos) { _z_subscription_rc_list_t *subs = (kind == _Z_SUBSCRIBER_KIND_SUBSCRIBER) ? zn->_subscriptions : zn->_liveliness_subscriptions; @@ -181,17 +182,15 @@ _z_subscription_rc_t *_z_register_subscription(_z_session_t *zn, _z_subscriber_k return ret; } -void _z_trigger_subscriptions_put(_z_session_t *zn, _z_keyexpr_t *keyexpr, _z_bytes_t *payload, - _z_encoding_t *encoding, const _z_n_qos_t qos, const _z_timestamp_t *timestamp, - _z_bytes_t *attachment, z_reliability_t reliability) { - z_result_t ret = _z_trigger_subscriptions_impl(zn, _Z_SUBSCRIBER_KIND_SUBSCRIBER, keyexpr, payload, encoding, Z_SAMPLE_KIND_PUT, timestamp, qos, - attachment, reliability); - (void)ret; +z_result_t _z_trigger_subscriptions_put(_z_session_t *zn, _z_keyexpr_t *keyexpr, _z_bytes_t *payload, + _z_encoding_t *encoding, const _z_timestamp_t *timestamp, const _z_n_qos_t qos, + _z_bytes_t *attachment, z_reliability_t reliability) { + return _z_trigger_subscriptions_impl(zn, _Z_SUBSCRIBER_KIND_SUBSCRIBER, keyexpr, payload, encoding, + Z_SAMPLE_KIND_PUT, timestamp, qos, attachment, reliability); } z_result_t _z_trigger_subscriptions_del(_z_session_t *zn, _z_keyexpr_t *keyexpr, const _z_timestamp_t *timestamp, - const _z_n_qos_t qos, _z_bytes_t *attachment, - z_reliability_t reliability) { + const _z_n_qos_t qos, _z_bytes_t *attachment, z_reliability_t reliability) { _z_encoding_t encoding = _z_encoding_null(); _z_bytes_t payload = _z_bytes_null(); return _z_trigger_subscriptions_impl(zn, _Z_SUBSCRIBER_KIND_SUBSCRIBER, keyexpr, &payload, &encoding, @@ -203,8 +202,8 @@ z_result_t _z_trigger_liveliness_subscriptions_declare(_z_session_t *zn, _z_keye _z_encoding_t encoding = _z_encoding_null(); _z_bytes_t payload = _z_bytes_null(); _z_bytes_t attachment = _z_bytes_null(); - return _z_trigger_subscriptions_impl(zn, _Z_SUBSCRIBER_KIND_LIVELINESS_SUBSCRIBER, keyexpr, &payload, - &encoding, Z_SAMPLE_KIND_PUT, timestamp, _Z_N_QOS_DEFAULT, &attachment, + return _z_trigger_subscriptions_impl(zn, _Z_SUBSCRIBER_KIND_LIVELINESS_SUBSCRIBER, keyexpr, &payload, &encoding, + Z_SAMPLE_KIND_PUT, timestamp, _Z_N_QOS_DEFAULT, &attachment, Z_RELIABILITY_RELIABLE); } @@ -213,13 +212,13 @@ z_result_t _z_trigger_liveliness_subscriptions_undeclare(_z_session_t *zn, _z_ke _z_encoding_t encoding = _z_encoding_null(); _z_bytes_t payload = _z_bytes_null(); _z_bytes_t attachment = _z_bytes_null(); - return _z_trigger_subscriptions_impl(zn, _Z_SUBSCRIBER_KIND_LIVELINESS_SUBSCRIBER, keyexpr, &payload, - &encoding, Z_SAMPLE_KIND_DELETE, timestamp, _Z_N_QOS_DEFAULT, &attachment, + return _z_trigger_subscriptions_impl(zn, _Z_SUBSCRIBER_KIND_LIVELINESS_SUBSCRIBER, keyexpr, &payload, &encoding, + Z_SAMPLE_KIND_DELETE, timestamp, _Z_N_QOS_DEFAULT, &attachment, Z_RELIABILITY_RELIABLE); } -static z_result_t _z_subscription_get_infos(_z_session_t *zn, _z_subscriber_kind_t kind, const _z_keyexpr_t *keyexpr, _z_keyexpr_t *key, - _z_subscription_infos_svec_t *subs, size_t *sub_nb) { +static z_result_t _z_subscription_get_infos(_z_session_t *zn, _z_subscriber_kind_t kind, const _z_keyexpr_t *keyexpr, + _z_keyexpr_t *key, _z_subscription_infos_svec_t *subs, size_t *sub_nb) { // Check cache if (!_z_subscription_get_from_cache(zn, keyexpr, key, subs, sub_nb)) { _Z_DEBUG("Resolving %d - %.*s on mapping 0x%x", keyexpr->_id, (int)_z_string_len(&keyexpr->_suffix), @@ -244,7 +243,8 @@ static z_result_t _z_subscription_get_infos(_z_session_t *zn, _z_subscriber_kind return _Z_RES_OK; } -static z_result_t _z_trigger_subscriptions_inner(_z_session_t *zn, _z_subscriber_kind_t sub_kind, const _z_keyexpr_t *keyexpr, _z_bytes_t *payload, +static z_result_t _z_trigger_subscriptions_inner(_z_session_t *zn, _z_subscriber_kind_t sub_kind, + const _z_keyexpr_t *keyexpr, _z_bytes_t *payload, _z_encoding_t *encoding, const _z_zint_t sample_kind, const _z_timestamp_t *timestamp, const _z_n_qos_t qos, _z_bytes_t *attachment, z_reliability_t reliability) { @@ -275,11 +275,12 @@ static z_result_t _z_trigger_subscriptions_inner(_z_session_t *zn, _z_subscriber return _Z_RES_OK; } -z_result_t _z_trigger_subscriptions_impl(_z_session_t *zn, _z_subscriber_kind_t sub_kind, _z_keyexpr_t *keyexpr, _z_bytes_t *payload, - _z_encoding_t *encoding, const _z_zint_t sample_kind, const _z_timestamp_t *timestamp, - const _z_n_qos_t qos, _z_bytes_t *attachment, z_reliability_t reliability) { - z_result_t ret = - _z_trigger_subscriptions_inner(zn, sub_kind, keyexpr, payload, encoding, sample_kind, timestamp, qos, attachment, reliability); +z_result_t _z_trigger_subscriptions_impl(_z_session_t *zn, _z_subscriber_kind_t sub_kind, _z_keyexpr_t *keyexpr, + _z_bytes_t *payload, _z_encoding_t *encoding, const _z_zint_t sample_kind, + const _z_timestamp_t *timestamp, const _z_n_qos_t qos, _z_bytes_t *attachment, + z_reliability_t reliability) { + z_result_t ret = _z_trigger_subscriptions_inner(zn, sub_kind, keyexpr, payload, encoding, sample_kind, timestamp, + qos, attachment, reliability); // Clean up _z_keyexpr_clear(keyexpr); _z_encoding_clear(encoding); @@ -311,9 +312,9 @@ void _z_flush_subscriptions(_z_session_t *zn) { } #else // Z_FEATURE_SUBSCRIPTION == 0 -void _z_trigger_local_subscriptions(_z_session_t *zn, _z_keyexpr_t *keyexpr, _z_bytes_t *payload, - _z_encoding_t *encoding, const _z_n_qos_t qos, const _z_timestamp_t *timestamp, - _z_bytes_t *attachment, z_reliability_t reliability) { +z_result_t _z_trigger_subscriptions_put(_z_session_t *zn, _z_keyexpr_t *keyexpr, _z_bytes_t *payload, + _z_encoding_t *encoding, const _z_timestamp_t *timestamp, const _z_n_qos_t qos, + _z_bytes_t *attachment, z_reliability_t reliability) { _ZP_UNUSED(zn); _ZP_UNUSED(keyexpr); _ZP_UNUSED(payload); @@ -326,9 +327,8 @@ void _z_trigger_local_subscriptions(_z_session_t *zn, _z_keyexpr_t *keyexpr, _z_ return _Z_RES_OK; } -z_result_t _z_trigger_subscriptions_del(_z_session_t *zn, const _z_keyexpr_t keyexpr, const _z_timestamp_t *timestamp, - const _z_n_qos_t qos, const _z_bytes_t attachment, - z_reliability_t reliability) { +z_result_t _z_trigger_subscriptions_del(_z_session_t *zn, _z_keyexpr_t *keyexpr, const _z_timestamp_t *timestamp, + const _z_n_qos_t qos, _z_bytes_t *attachment, z_reliability_t reliability) { _ZP_UNUSED(zn); _ZP_UNUSED(keyexpr); _ZP_UNUSED(qos); @@ -339,7 +339,7 @@ z_result_t _z_trigger_subscriptions_del(_z_session_t *zn, const _z_keyexpr_t key return _Z_RES_OK; } -z_result_t _z_trigger_liveliness_subscriptions_declare(_z_session_t *zn, const _z_keyexpr_t keyexpr, +z_result_t _z_trigger_liveliness_subscriptions_declare(_z_session_t *zn, _z_keyexpr_t *keyexpr, const _z_timestamp_t *timestamp) { _ZP_UNUSED(zn); _ZP_UNUSED(keyexpr); @@ -348,7 +348,7 @@ z_result_t _z_trigger_liveliness_subscriptions_declare(_z_session_t *zn, const _ return _Z_RES_OK; } -z_result_t _z_trigger_liveliness_subscriptions_undeclare(_z_session_t *zn, const _z_keyexpr_t keyexpr, +z_result_t _z_trigger_liveliness_subscriptions_undeclare(_z_session_t *zn, _z_keyexpr_t *keyexpr, const _z_timestamp_t *timestamp) { _ZP_UNUSED(zn); _ZP_UNUSED(keyexpr); diff --git a/zenohpico.pc b/zenohpico.pc index 1e3b39ae2..3922083d4 100644 --- a/zenohpico.pc +++ b/zenohpico.pc @@ -3,6 +3,6 @@ prefix=/usr/local Name: zenohpico Description: URL: -Version: 1.0.20241018dev +Version: 1.0.20241115dev Cflags: -I${prefix}/include Libs: -L${prefix}/lib -lzenohpico