Skip to main content

ohos_basic_services_kit_sys/time_service/
time_service_ffi.rs

1// automatically generated by rust-bindgen 0.71.1
2
3#![allow(non_upper_case_globals)]
4#![allow(non_camel_case_types)]
5#![allow(non_snake_case)]
6
7#[cfg(feature = "api-12")]
8#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
9impl TimeService_ErrCode {
10    /// Success.
11    pub const TIMESERVICE_ERR_OK: TimeService_ErrCode = TimeService_ErrCode(0);
12    /// Failed to obtain system parameters.
13    pub const TIMESERVICE_ERR_INTERNAL_ERROR: TimeService_ErrCode = TimeService_ErrCode(13000001);
14    /// Invalid parameter.
15    pub const TIMESERVICE_ERR_INVALID_PARAMETER: TimeService_ErrCode =
16        TimeService_ErrCode(13000002);
17}
18#[repr(transparent)]
19/// Enumerates the error codes.
20///
21///
22/// Available since API-level: 12
23#[cfg(feature = "api-12")]
24#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
25#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
26pub struct TimeService_ErrCode(pub ::core::ffi::c_uint);
27extern "C" {
28    /// Obtains the current system time zone.
29    ///
30    /// # Arguments
31    ///
32    /// * `timeZone` - Pointer to an array of characters indicating the time zone ID. On success, the string indicates the
33    /// current system time zone ID. On failure, the string is empty. The string is terminated using '
34    /// * `len` - Size of the memory allocated for the time zone ID character array. There is no upper limit for the length
35    /// of the time zone ID. It is recommended to allocate sufficient memory, at least not less than 31 bytes.
36    ///
37    /// # Returns
38    ///
39    /// * Returns [`TIMESERVICE_ERR_OK`] if the operation is successful.
40    /// Returns [`TIMESERVICE_ERR_INTERNAL_ERROR`] if obtaining the system parameters fails.
41    /// Returns [`TIMESERVICE_ERR_INVALID_PARAMETER`] if <b>timeZone</b> is a null pointer or the length of the
42    /// time zone ID (excluding the terminating character ('is greater than or equal to <b>len</b>.
43    ///
44    /// Required System Capabilities: SystemCapability.MiscServices.Time
45    ///
46    /// Available since API-level: 12
47    #[cfg(feature = "api-12")]
48    #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
49    pub fn OH_TimeService_GetTimeZone(
50        timeZone: *mut ::core::ffi::c_char,
51        len: u32,
52    ) -> TimeService_ErrCode;
53}