diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 0a701993d..42306a4d1 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -16,13 +16,6 @@ file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.c") foreach(file ${files}) get_filename_component(target ${file} NAME_WE) - - # Exclude some examples if UNSTABLE feature is disabled - if(NOT(ZENOHC_BUILD_WITH_UNSTABLE_API)) - if(${target} STREQUAL "z_info") - continue() - endif() - endif() # Exclude SHM examples if SHM feature is disabled if(NOT(ZENOHC_BUILD_WITH_SHARED_MEMORY AND (ZENOHC_BUILD_WITH_UNSTABLE_API))) if(${target} MATCHES "^.*_shm.*$") diff --git a/examples/z_scout.c b/examples/z_scout.c index 547a90600..1013e30a5 100644 --- a/examples/z_scout.c +++ b/examples/z_scout.c @@ -15,7 +15,6 @@ #include "zenoh.h" -#if defined(Z_FEATURE_UNSTABLE_API) void fprintpid(FILE *stream, z_id_t pid) { int len = 0; for (int i = 0; i < 16; i++) { @@ -33,7 +32,6 @@ void fprintpid(FILE *stream, z_id_t pid) { fprintf(stream, ")"); } } -#endif void fprintwhatami(FILE *stream, z_whatami_t whatami) { z_view_string_t whatami_str; @@ -57,9 +55,8 @@ void fprintlocators(FILE *stream, const z_loaned_string_array_t *locs) { void fprinthello(FILE *stream, const z_loaned_hello_t *hello) { fprintf(stream, "Hello { pid: "); -#if defined(Z_FEATURE_UNSTABLE_API) + fprintpid(stream, z_hello_zid(hello)); -#endif fprintf(stream, ", whatami: "); fprintwhatami(stream, z_hello_whatami(hello)); diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index d0ad0eeea..143cb9950 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -506,14 +506,6 @@ typedef struct z_owned_closure_sample_t { typedef struct z_moved_closure_sample_t { struct z_owned_closure_sample_t _this; } z_moved_closure_sample_t; -/** - * @brief A Zenoh ID. - * - * In general, valid Zenoh IDs are LSB-first 128bit unsigned and non-zero integers. - */ -typedef struct ALIGN(1) z_id_t { - uint8_t id[16]; -} z_id_t; /** * @brief A zenoh id-processing closure. * @@ -2527,13 +2519,9 @@ void z_hello_locators(const struct z_loaned_hello_t *this_, */ ZENOHC_API enum z_whatami_t z_hello_whatami(const struct z_loaned_hello_t *this_); /** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Returns id of Zenoh entity that transmitted hello message. */ -#if defined(Z_FEATURE_UNSTABLE_API) -ZENOHC_API -struct z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); -#endif +ZENOHC_API struct z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); /** * @brief Formats the `z_id_t` into 16-digit hex string (LSB-first order) */ @@ -2651,7 +2639,8 @@ ZENOHC_API bool z_internal_closure_zid_check(const struct z_owned_closure_zid_t /** * @brief Constructs a null closure. */ -ZENOHC_API void z_internal_closure_zid_null(struct z_owned_closure_zid_t *this_); +ZENOHC_API +void z_internal_closure_zid_null(struct z_owned_closure_zid_t *this_); /** * Returns ``true`` if conditional variable is valid, ``false`` otherwise. */ @@ -4382,13 +4371,9 @@ ZENOHC_API const char *z_time_now_as_str(const char *buf, size_t len); /** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Returns id associated with this timestamp. */ -#if defined(Z_FEATURE_UNSTABLE_API) -ZENOHC_API -struct z_id_t z_timestamp_id(const struct z_timestamp_t *this_); -#endif +ZENOHC_API struct z_id_t z_timestamp_id(const struct z_timestamp_t *this_); /** * Create uhlc timestamp from session id. */ diff --git a/splitguide.yaml b/splitguide.yaml index 0efe48406..b1f5c3d29 100644 --- a/splitguide.yaml +++ b/splitguide.yaml @@ -47,7 +47,7 @@ zenoh_opaque.h: - z_owned_source_info_t!#unstable - z_loaned_source_info_t!#unstable - z_entity_global_id_t!#unstable - - z_id_t!#unstable + - z_id_t! - z_timestamp_t! - z_owned_publisher_t! - z_loaned_publisher_t! diff --git a/src/commons.rs b/src/commons.rs index 9009609bb..1eb2d22a4 100644 --- a/src/commons.rs +++ b/src/commons.rs @@ -32,13 +32,11 @@ use zenoh::{ #[cfg(feature = "unstable")] use crate::transmute::IntoCType; #[cfg(feature = "unstable")] -use crate::z_id_t; -#[cfg(feature = "unstable")] use crate::z_moved_source_info_t; use crate::{ result, transmute::{CTypeRef, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, - z_loaned_bytes_t, z_loaned_encoding_t, z_loaned_keyexpr_t, z_loaned_session_t, + z_id_t, z_loaned_bytes_t, z_loaned_encoding_t, z_loaned_keyexpr_t, z_loaned_session_t, }; /// A zenoh unsigned integer @@ -92,8 +90,6 @@ pub extern "C" fn z_timestamp_ntp64_time(this_: &z_timestamp_t) -> u64 { this_.as_rust_type_ref().get_time().0 } -#[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 Returns id associated with this timestamp. #[no_mangle] pub extern "C" fn z_timestamp_id(this_: &z_timestamp_t) -> z_id_t { diff --git a/src/scouting.rs b/src/scouting.rs index 09e8cc41d..14d1b4712 100644 --- a/src/scouting.rs +++ b/src/scouting.rs @@ -22,12 +22,10 @@ use zenoh::{ pub use crate::opaque_types::{z_loaned_hello_t, z_moved_hello_t, z_owned_hello_t}; use crate::{ result::{self, Z_OK}, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, - z_closure_hello_call, z_closure_hello_loan, z_moved_closure_hello_t, z_moved_config_t, + transmute::{IntoCType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, + z_closure_hello_call, z_closure_hello_loan, z_id_t, z_moved_closure_hello_t, z_moved_config_t, z_owned_string_array_t, z_view_string_t, CString, CStringView, ZVector, }; -#[cfg(feature = "unstable")] -use crate::{transmute::IntoCType, z_id_t}; decl_c_type!( owned(z_owned_hello_t, option Hello ), loaned(z_loaned_hello_t), @@ -70,8 +68,6 @@ pub extern "C" fn z_hello_clone(dst: &mut MaybeUninit, this_: & .write(Some(this_.as_rust_type_ref().clone())); } -#[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 Returns id of Zenoh entity that transmitted hello message. #[no_mangle] pub extern "C" fn z_hello_zid(this_: &z_loaned_hello_t) -> z_id_t { diff --git a/tests/z_api_alignment_test.c b/tests/z_api_alignment_test.c index c73a89855..cfc1df46a 100644 --- a/tests/z_api_alignment_test.c +++ b/tests/z_api_alignment_test.c @@ -26,14 +26,12 @@ const char *value = "Test value"; -#if defined(Z_FEATURE_UNSTABLE_API) volatile unsigned int zids = 0; void zid_handler(const z_id_t *id, void *arg) { (void)(arg); (void)(id); zids++; } -#endif volatile unsigned int hellos = 0; void hello_handler(z_loaned_hello_t *hello, void *arg) { @@ -201,7 +199,6 @@ int main(int argc, char **argv) { assert(0 == z_open(&s1, z_move(_ret_config), NULL)); assert(z_internal_check(s1)); -#if defined(Z_FEATURE_UNSTABLE_API) z_id_t _ret_zid = z_info_zid(z_loan(s1)); z_owned_string_t str; z_id_to_string(&_ret_zid, &str); @@ -221,7 +218,6 @@ int main(int argc, char **argv) { z_sleep_s(SLEEP); assert(zids == 1); -#endif #ifdef ZENOH_PICO zp_task_read_options_t _ret_read_opt = zp_task_read_options_default();