Skip to content

Commit

Permalink
Rename zc_owned_liveliness_get_options_t to zc_liveliness_get_options_t
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc committed Mar 18, 2024
1 parent 32a3b01 commit fb9218b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 9 additions & 10 deletions include/zenoh_commons.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
*/
Expand Down
20 changes: 10 additions & 10 deletions src/liveliness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,29 +197,29 @@ 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,
_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()
}

Expand All @@ -233,7 +233,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");
Expand Down

0 comments on commit fb9218b

Please sign in to comment.