Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'history' and 'timeout_ms' options are documented #824

Merged
merged 9 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ zenoh-c API documentation is available on [Read the Docs](https://zenoh-c.readth
## How to build it

```bash
cargo check --all-features
cd docs
doxygen
sphinx-build -b html . _build/html
Expand Down
3 changes: 3 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -855,8 +855,11 @@ Types

.. doxygenstruct:: z_owned_liveliness_token_t
.. doxygenstruct:: z_liveliness_token_options_t
:members:
.. doxygenstruct:: z_liveliness_get_options_t
:members:
.. doxygenstruct:: z_liveliness_subscriber_options_t
:members:

Functions
---------
Expand Down
22 changes: 14 additions & 8 deletions include/zenoh_commons.h
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,9 @@ typedef struct z_moved_keyexpr_t {
*/
#if defined(Z_FEATURE_UNSTABLE_API)
typedef struct z_liveliness_subscriber_options_t {
/**
* Receive liveliness tokens that were declared before this liveliness subscriber.
milyin marked this conversation as resolved.
Show resolved Hide resolved
*/
bool history;
} z_liveliness_subscriber_options_t;
#endif
Expand All @@ -781,6 +784,9 @@ typedef struct z_liveliness_token_options_t {
*/
#if defined(Z_FEATURE_UNSTABLE_API)
typedef struct z_liveliness_get_options_t {
/**
* Set query timeout in milliseconds.
milyin marked this conversation as resolved.
Show resolved Hide resolved
*/
uint32_t timeout_ms;
} z_liveliness_get_options_t;
#endif
Expand Down Expand Up @@ -1314,7 +1320,7 @@ void z_alloc_layout_alloc_gc(struct z_buf_alloc_result_t *out_result,
#endif
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
* @brief Make allocation performing garbage collection and\or defragmentation if needed.
* @brief Make allocation performing garbage collection and/or defragmentation if needed.
*/
#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API))
ZENOHC_API
Expand All @@ -1323,7 +1329,7 @@ void z_alloc_layout_alloc_gc_defrag(struct z_buf_alloc_result_t *out_result,
#endif
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
* @brief Make allocation performing garbage collection and\or defragmentation and\or blocking if needed.
* @brief Make allocation performing garbage collection and/or defragmentation and/or blocking if needed.
*/
#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API))
ZENOHC_API
Expand All @@ -1332,7 +1338,7 @@ void z_alloc_layout_alloc_gc_defrag_blocking(struct z_buf_alloc_result_t *out_re
#endif
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
* @brief Make allocation performing garbage collection and\or defragmentation and\or forced deallocation if needed.
* @brief Make allocation performing garbage collection and/or defragmentation and/or forced deallocation if needed.
*/
#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API))
ZENOHC_API
Expand Down Expand Up @@ -1368,7 +1374,7 @@ z_result_t z_alloc_layout_new(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.
* @brief Make allocation performing garbage collection and\or defragmentation in async manner. Will return Z_EINVAL
* @brief Make allocation performing garbage collection and/or defragmentation in async manner. Will return Z_EINVAL
* if used with non-threadsafe SHM Provider.
*/
#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API))
Expand Down Expand Up @@ -4321,7 +4327,7 @@ void z_shm_provider_alloc_gc(struct z_buf_layout_alloc_result_t *out_result,
#endif
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
* @brief Make allocation performing garbage collection and\or defragmentation if needed.
* @brief Make allocation performing garbage collection and/or defragmentation if needed.
*/
#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API))
ZENOHC_API
Expand All @@ -4332,7 +4338,7 @@ void z_shm_provider_alloc_gc_defrag(struct z_buf_layout_alloc_result_t *out_resu
#endif
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
* @brief Make allocation performing garbage collection and\or defragmentation in async manner. Will return Z_EINVAL
* @brief Make allocation performing garbage collection and/or defragmentation in async manner. Will return Z_EINVAL
* if used with non-threadsafe SHM Provider.
*/
#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API))
Expand All @@ -4347,7 +4353,7 @@ z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result
#endif
/**
* @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
* @brief Make allocation performing garbage collection and\or defragmentation and\or blocking if needed.
* @brief Make allocation performing garbage collection and/or defragmentation and/or blocking if needed.
*/
#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API))
ZENOHC_API
Expand All @@ -4358,7 +4364,7 @@ void z_shm_provider_alloc_gc_defrag_blocking(struct 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 Make allocation performing garbage collection and\or defragmentation and\or forced deallocation if needed.
* @brief Make allocation performing garbage collection and/or defragmentation and/or forced deallocation if needed.
*/
#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API))
ZENOHC_API
Expand Down
2 changes: 2 additions & 0 deletions src/liveliness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ pub extern "C" fn z_liveliness_undeclare_token(
/// @brief The options for `z_liveliness_declare_subscriber()`
#[repr(C)]
pub struct z_liveliness_subscriber_options_t {
/// Receive liveliness tokens that were declared before this liveliness subscriber.
history: bool,
}

Expand Down Expand Up @@ -237,6 +238,7 @@ pub extern "C" fn zc_liveliness_declare_background_subscriber(
/// @brief The options for `z_liveliness_get()`
#[repr(C)]
pub struct z_liveliness_get_options_t {
/// Set query timeout in milliseconds.
timeout_ms: u32,
}

Expand Down
8 changes: 4 additions & 4 deletions src/shm/provider/alloc_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub extern "C" fn z_alloc_layout_alloc_gc(
}

/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief Make allocation performing garbage collection and\or defragmentation if needed.
/// @brief Make allocation performing garbage collection and/or defragmentation if needed.
#[no_mangle]
pub extern "C" fn z_alloc_layout_alloc_gc_defrag(
out_result: &mut MaybeUninit<z_buf_alloc_result_t>,
Expand All @@ -127,7 +127,7 @@ pub extern "C" fn z_alloc_layout_alloc_gc_defrag(
}

/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief Make allocation performing garbage collection and\or defragmentation and\or forced deallocation if needed.
/// @brief Make allocation performing garbage collection and/or defragmentation and/or forced deallocation if needed.
#[no_mangle]
pub extern "C" fn z_alloc_layout_alloc_gc_defrag_dealloc(
out_result: &mut MaybeUninit<z_buf_alloc_result_t>,
Expand All @@ -137,7 +137,7 @@ pub extern "C" fn z_alloc_layout_alloc_gc_defrag_dealloc(
}

/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief Make allocation performing garbage collection and\or defragmentation and\or blocking if needed.
/// @brief Make allocation performing garbage collection and/or defragmentation and/or blocking if needed.
#[no_mangle]
pub extern "C" fn z_alloc_layout_alloc_gc_defrag_blocking(
out_result: &mut MaybeUninit<z_buf_alloc_result_t>,
Expand All @@ -147,7 +147,7 @@ pub extern "C" fn z_alloc_layout_alloc_gc_defrag_blocking(
}

/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief Make allocation performing garbage collection and\or defragmentation in async manner. Will return Z_EINVAL
/// @brief Make allocation performing garbage collection and/or defragmentation in async manner. Will return Z_EINVAL
/// if used with non-threadsafe SHM Provider.
#[no_mangle]
pub extern "C" fn z_alloc_layout_threadsafe_alloc_gc_defrag_async(
Expand Down
8 changes: 4 additions & 4 deletions src/shm/provider/shm_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ pub extern "C" fn z_shm_provider_alloc_gc(
}

/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief Make allocation performing garbage collection and\or defragmentation if needed.
/// @brief Make allocation performing garbage collection and/or defragmentation if needed.
#[no_mangle]
pub extern "C" fn z_shm_provider_alloc_gc_defrag(
out_result: &mut MaybeUninit<z_buf_layout_alloc_result_t>,
Expand All @@ -166,7 +166,7 @@ pub extern "C" fn z_shm_provider_alloc_gc_defrag(
}

/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief Make allocation performing garbage collection and\or defragmentation and\or forced deallocation if needed.
/// @brief Make allocation performing garbage collection and/or defragmentation and/or forced deallocation if needed.
#[no_mangle]
pub extern "C" fn z_shm_provider_alloc_gc_defrag_dealloc(
out_result: &mut MaybeUninit<z_buf_layout_alloc_result_t>,
Expand All @@ -178,7 +178,7 @@ pub extern "C" fn z_shm_provider_alloc_gc_defrag_dealloc(
}

/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief Make allocation performing garbage collection and\or defragmentation and\or blocking if needed.
/// @brief Make allocation performing garbage collection and/or defragmentation and/or blocking if needed.
#[no_mangle]
pub extern "C" fn z_shm_provider_alloc_gc_defrag_blocking(
out_result: &mut MaybeUninit<z_buf_layout_alloc_result_t>,
Expand All @@ -190,7 +190,7 @@ pub extern "C" fn z_shm_provider_alloc_gc_defrag_blocking(
}

/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
/// @brief Make allocation performing garbage collection and\or defragmentation in async manner. Will return Z_EINVAL
/// @brief Make allocation performing garbage collection and/or defragmentation in async manner. Will return Z_EINVAL
/// if used with non-threadsafe SHM Provider.
#[no_mangle]
pub extern "C" fn z_shm_provider_alloc_gc_defrag_async(
Expand Down
Loading