Skip to content

Commit

Permalink
'history' and 'timeout_ms' options are documented (eclipse-zenoh#824)
Browse files Browse the repository at this point in the history
* members added to doc

* doc comment added

* doc corrected, warning on build doc fixed

* macro header update

* doc updated

* doc updated
  • Loading branch information
milyin authored Dec 3, 2024
1 parent 612f534 commit 752d7b5
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 16 deletions.
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 {
/**
* If true, subscriber will receive the state change notifications for liveliness tokens that were declared before its declaration.
*/
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 {
/**
* The timeout for the liveliness query in milliseconds. 0 means default query timeout from zenoh configuration.
*/
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 {
/// If true, subscriber will receive the state change notifications for liveliness tokens that were declared before its declaration.
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 {
/// The timeout for the liveliness query in milliseconds. 0 means default query timeout from zenoh configuration.
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

0 comments on commit 752d7b5

Please sign in to comment.