Skip to content

Commit

Permalink
renamed z_liveliness* function to give them correct names (#826)
Browse files Browse the repository at this point in the history
* renamed z_liveliness* function to make it accord to correct ones in zenoh-pico

* rename liveliness token types

* cargo fmt
  • Loading branch information
milyin authored Nov 19, 2024
1 parent 4b759d4 commit f511073
Show file tree
Hide file tree
Showing 10 changed files with 619 additions and 712 deletions.
4 changes: 2 additions & 2 deletions build-resources/opaque-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ get_opaque_type_data!(Subscriber<()>, z_loaned_subscriber_t);
/// expressions.
///
/// A DELETE on the token's key expression will be received by subscribers if the token is destroyed, or if connectivity between the subscriber and the token's creator is lost.
get_opaque_type_data!(Option<LivelinessToken>, zc_owned_liveliness_token_t);
get_opaque_type_data!(Option<LivelinessToken>, z_owned_liveliness_token_t);
#[cfg(feature = "unstable")]
/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
get_opaque_type_data!(LivelinessToken, zc_loaned_liveliness_token_t);
get_opaque_type_data!(LivelinessToken, z_loaned_liveliness_token_t);
#[cfg(feature = "unstable")]
/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief An owned Zenoh publication cache.
Expand Down
26 changes: 13 additions & 13 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -815,25 +815,25 @@ Liveliness
Types
-----

.. doxygenstruct:: zc_owned_liveliness_token_t
.. doxygenstruct:: zc_liveliness_declaration_options_t
.. doxygenstruct:: zc_liveliness_get_options_t
.. doxygenstruct:: zc_liveliness_subscriber_options_t
.. doxygenstruct:: z_owned_liveliness_token_t
.. doxygenstruct:: z_liveliness_token_options_t
.. doxygenstruct:: z_liveliness_get_options_t
.. doxygenstruct:: z_liveliness_subscriber_options_t

Functions
---------
.. doxygenfunction:: zc_liveliness_declare_subscriber
.. doxygenfunction:: z_liveliness_declare_subscriber
.. doxygenfunction:: zc_liveliness_declare_background_subscriber
.. doxygenfunction:: zc_liveliness_get
.. doxygenfunction:: z_liveliness_get

.. doxygenfunction:: zc_liveliness_declare_token
.. doxygenfunction:: zc_liveliness_undeclare_token
.. doxygenfunction:: zc_liveliness_token_loan
.. doxygenfunction:: zc_liveliness_token_drop
.. doxygenfunction:: z_liveliness_declare_token
.. doxygenfunction:: z_liveliness_undeclare_token
.. doxygenfunction:: z_liveliness_token_loan
.. doxygenfunction:: z_liveliness_token_drop

.. doxygenfunction:: zc_liveliness_subscriber_options_default
.. doxygenfunction:: zc_liveliness_declaration_options_default
.. doxygenfunction:: zc_liveliness_get_options_default
.. doxygenfunction:: z_liveliness_subscriber_options_default
.. doxygenfunction:: z_liveliness_token_options_default
.. doxygenfunction:: z_liveliness_get_options_default

Publication Cache
=================
Expand Down
2 changes: 1 addition & 1 deletion examples/z_get_liveliness.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int main(int argc, char** argv) {
z_owned_fifo_handler_reply_t handler;
z_owned_closure_reply_t closure;
z_fifo_channel_reply_new(&closure, &handler, 16);
zc_liveliness_get(z_loan(s), z_loan(keyexpr), z_move(closure), NULL);
z_liveliness_get(z_loan(s), z_loan(keyexpr), z_move(closure), NULL);
z_owned_reply_t reply;
for (z_result_t res = z_recv(z_loan(handler), &reply); res == Z_OK; res = z_recv(z_loan(handler), &reply)) {
if (z_reply_is_ok(z_loan(reply))) {
Expand Down
4 changes: 2 additions & 2 deletions examples/z_liveliness.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ int main(int argc, char** argv) {
}

printf("Declaring liveliness token '%s'...\n", args.keyexpr);
zc_owned_liveliness_token_t token;
if (zc_liveliness_declare_token(z_loan(s), &token, z_loan(keyexpr), NULL) < 0) {
z_owned_liveliness_token_t token;
if (z_liveliness_declare_token(z_loan(s), &token, z_loan(keyexpr), NULL) < 0) {
printf("Unable to create liveliness token!\n");
exit(-1);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/z_sub_liveliness.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ int main(int argc, char** argv) {
z_owned_closure_sample_t callback;
z_closure(&callback, data_handler, NULL, NULL);
z_owned_subscriber_t sub;
if (zc_liveliness_declare_subscriber(z_loan(s), &sub, z_loan(ke), z_move(callback), NULL) < 0) {
if (z_liveliness_declare_subscriber(z_loan(s), &sub, z_loan(ke), z_move(callback), NULL) < 0) {
printf("Unable to declare liveliness subscriber.\n");
exit(-1);
}
Expand Down
Loading

0 comments on commit f511073

Please sign in to comment.