From bfae07128e988e94ae6c4f111335a0c33a58b044 Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Tue, 10 Sep 2024 16:28:39 +0200 Subject: [PATCH] options parameters added to z_open and z_close --- src/session.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/session.rs b/src/session.rs index 5307f676e..908c308d9 100644 --- a/src/session.rs +++ b/src/session.rs @@ -47,6 +47,12 @@ pub extern "C" fn z_internal_session_null(this_: &mut MaybeUninit, config: &mut z_moved_config_t, + _options: Option<&z_open_options_t>, ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); if cfg!(feature = "logger-autoinit") { @@ -122,12 +129,21 @@ pub extern "C" fn z_internal_session_check(this_: &z_owned_session_t) -> bool { this_.as_rust_type_ref().is_some() } +/// Options passed to the `z_close()` function. +#[repr(C)] +pub struct z_close_options_t { + _dummy: u8, +} + /// Closes a zenoh session. This alos drops and invalidates `session`. /// /// @return 0 in case of success, a negative value if an error occured while closing the session, /// the remaining reference count (number of shallow copies) of the session otherwise, saturating at i8::MAX. #[no_mangle] -pub extern "C" fn z_close(session: &mut z_moved_session_t) -> result::z_result_t { +pub extern "C" fn z_close( + session: &mut z_moved_session_t, + _options: Option<&z_open_options_t>, +) -> result::z_result_t { let Some(s) = session.take_rust_type() else { return result::Z_EINVAL; };