From 0ab2e0f61efdae8510921c96883bd1f942875c2b Mon Sep 17 00:00:00 2001 From: Alexander Bushnev Date: Mon, 18 Mar 2024 18:16:54 +0100 Subject: [PATCH] Rename zc_owned_liveliness_get_options_t to zc_liveliness_get_options_t --- docs/api.rst | 2 +- include/zenoh_commons.h | 19 +++++++++---------- src/liveliness.rs | 22 ++++++++++------------ 3 files changed, 20 insertions(+), 23 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index cfe0aeb77..758c405b5 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -305,7 +305,7 @@ Types .. autocstruct:: zenoh_commons.h::zc_owned_liveliness_token_t .. autocstruct:: zenoh_commons.h::zc_owned_liveliness_declaration_options_t -.. autocstruct:: zenoh_commons.h::zc_owned_liveliness_get_options_t +.. autocstruct:: zenoh_commons.h::zc_liveliness_get_options_t .. autocstruct:: zenoh_commons.h::zc_owned_liveliness_declare_subscriber_options_t Functions diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 25e2b8ea0..6e45ed3d1 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -874,9 +874,9 @@ typedef struct zc_owned_liveliness_token_t { /** * The options for :c:func:`zc_liveliness_declare_subscriber` */ -typedef struct zc_owned_liveliness_get_options_t { +typedef struct zc_liveliness_get_options_t { uint32_t timeout_ms; -} zc_owned_liveliness_get_options_t; +} zc_liveliness_get_options_t; /** * An owned payload, backed by a reference counted owner. * @@ -2320,24 +2320,23 @@ ZENOHC_API int8_t zc_liveliness_get(struct z_session_t session, struct z_keyexpr_t key, struct z_owned_closure_reply_t *callback, - const struct zc_owned_liveliness_get_options_t *options); + const struct zc_liveliness_get_options_t *options); /** * Returns `true` if the options are valid. */ -ZENOHC_API -bool zc_liveliness_get_options_check(const struct zc_owned_liveliness_get_options_t *_opts); +ZENOHC_API bool zc_liveliness_get_options_check(const struct zc_liveliness_get_options_t *_opts); /** - * The gravestone value for `zc_owned_liveliness_get_options_t` + * The gravestone value for `zc_liveliness_get_options_t` */ -ZENOHC_API struct zc_owned_liveliness_get_options_t zc_liveliness_get_options_default(void); +ZENOHC_API struct zc_liveliness_get_options_t zc_liveliness_get_options_default(void); /** * Destroys the options. */ -ZENOHC_API void zc_liveliness_get_options_drop(struct zc_owned_liveliness_get_options_t *opts); +ZENOHC_API void zc_liveliness_get_options_drop(struct zc_liveliness_get_options_t *opts); /** - * The gravestone value for `zc_owned_liveliness_get_options_t` + * The gravestone value for `zc_liveliness_get_options_t` */ -ZENOHC_API struct zc_owned_liveliness_get_options_t zc_liveliness_get_options_null(void); +ZENOHC_API struct zc_liveliness_get_options_t zc_liveliness_get_options_null(void); /** * Returns `true` if the options are valid. */ diff --git a/src/liveliness.rs b/src/liveliness.rs index 040205892..0a7c689dd 100644 --- a/src/liveliness.rs +++ b/src/liveliness.rs @@ -197,29 +197,27 @@ pub extern "C" fn zc_liveliness_declare_subscriber( /// The options for :c:func:`zc_liveliness_declare_subscriber` #[repr(C)] -pub struct zc_owned_liveliness_get_options_t { +pub struct zc_liveliness_get_options_t { timeout_ms: u32, } -/// The gravestone value for `zc_owned_liveliness_get_options_t` +/// The gravestone value for `zc_liveliness_get_options_t` #[no_mangle] -pub extern "C" fn zc_liveliness_get_options_null() -> zc_owned_liveliness_get_options_t { - zc_owned_liveliness_get_options_t { timeout_ms: 0 } +pub extern "C" fn zc_liveliness_get_options_null() -> zc_liveliness_get_options_t { + zc_liveliness_get_options_t { timeout_ms: 0 } } -/// The gravestone value for `zc_owned_liveliness_get_options_t` +/// The gravestone value for `zc_liveliness_get_options_t` #[no_mangle] -pub extern "C" fn zc_liveliness_get_options_default() -> zc_owned_liveliness_get_options_t { - zc_owned_liveliness_get_options_t { timeout_ms: 10000 } +pub extern "C" fn zc_liveliness_get_options_default() -> zc_liveliness_get_options_t { + zc_liveliness_get_options_t { timeout_ms: 10000 } } /// Returns `true` if the options are valid. #[no_mangle] -pub extern "C" fn zc_liveliness_get_options_check( - _opts: &zc_owned_liveliness_get_options_t, -) -> bool { +pub extern "C" fn zc_liveliness_get_options_check(_opts: &zc_liveliness_get_options_t) -> bool { true } /// Destroys the options. #[no_mangle] -pub extern "C" fn zc_liveliness_get_options_drop(opts: &mut zc_owned_liveliness_get_options_t) { +pub extern "C" fn zc_liveliness_get_options_drop(opts: &mut zc_liveliness_get_options_t) { *opts = zc_liveliness_get_options_null() } @@ -233,7 +231,7 @@ pub extern "C" fn zc_liveliness_get( session: z_session_t, key: z_keyexpr_t, callback: &mut z_owned_closure_reply_t, - options: Option<&zc_owned_liveliness_get_options_t>, + options: Option<&zc_liveliness_get_options_t>, ) -> i8 { let Some(session) = session.upgrade() else { log::error!("Failed to declare liveliness token: provided session was invalid");