Tizen Native API
|
The Runtime Information API provides functions to obtain runtime information.
Required Header
#include <runtime_info.h>
Overview
The Runtime Information API provides functions to obtain runtime information, containing miscellaneous system preference. The Runtime Information available is stored in key/value pairs, where there may be different data types for the value.
The runtime_info_set_changed_cb() registers a callback function for a particular key, which will be invoked by the System Service if the state matching that key changes.
Functions | |
int | runtime_info_get_value_int (runtime_info_key_e key, int *value) |
Gets the integer value of the runtime information. | |
int | runtime_info_get_value_bool (runtime_info_key_e key, bool *value) |
Gets the boolean value from the runtime information. | |
int | runtime_info_get_value_double (runtime_info_key_e key, double *value) |
Gets the double value from the runtime information. | |
int | runtime_info_get_value_string (runtime_info_key_e key, char **value) |
Gets the string value for specified runtime information. | |
int | runtime_info_set_changed_cb (runtime_info_key_e key, runtime_info_changed_cb callback, void *user_data) |
Registers a change event callback for given runtime information key. | |
int | runtime_info_unset_changed_cb (runtime_info_key_e key) |
Unregisters the callback function. | |
Typedefs | |
typedef void(* | runtime_info_changed_cb )(runtime_info_key_e key, void *user_data) |
Called when the runtime information changes. |
Typedef Documentation
typedef void(* runtime_info_changed_cb)(runtime_info_key_e key, void *user_data) |
Called when the runtime information changes.
- Since :
- 2.3.1
- Parameters:
-
[in] key The type of notification [in] user_data The user data passed from the callback registration function
- Precondition:
- runtime_info_set_changed_cb() will invoke this callback function.
Enumeration Type Documentation
enum runtime_info_error_e |
Enumeration for error codes for runtime information.
- Since :
- 2.3.1
- Enumerator:
enum runtime_info_key_e |
Enumeration for keys for runtime information.
- Since :
- 2.3.1
- Enumerator:
Function Documentation
int runtime_info_get_value_bool | ( | runtime_info_key_e | key, |
bool * | value | ||
) |
Gets the boolean value from the runtime information.
This function gets current state of the given key which represents specific runtime information.
- Since :
- 2.3.1
- Parameters:
-
[in] key The runtime information key from which data should be read [out] value The current value of the given key
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RUNTIME_INFO_ERROR_NONE Successful RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter RUNTIME_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api RUNTIME_INFO_ERROR_NOT_SUPPORTED Not supported parameter
int runtime_info_get_value_double | ( | runtime_info_key_e | key, |
double * | value | ||
) |
Gets the double value from the runtime information.
This function gets current state of the given key which represents specific runtime information.
- Since :
- 2.3.1
- Parameters:
-
[in] key The runtime information key from which data should be read [out] value The current value of the given key
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RUNTIME_INFO_ERROR_NONE Successful RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter RUNTIME_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api RUNTIME_INFO_ERROR_NOT_SUPPORTED Not supported parameter
int runtime_info_get_value_int | ( | runtime_info_key_e | key, |
int * | value | ||
) |
Gets the integer value of the runtime information.
This function gets current state of the given key which represents specific runtime information.
- Since :
- 2.3.1
- Parameters:
-
[in] key The runtime information status key from which data should be read [out] value The current value of the given key
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RUNTIME_INFO_ERROR_NONE Successful RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter RUNTIME_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api RUNTIME_INFO_ERROR_NOT_SUPPORTED Not supported parameter
int runtime_info_get_value_string | ( | runtime_info_key_e | key, |
char ** | value | ||
) |
Gets the string value for specified runtime information.
This function gets current state of the given key which represents specific runtime information.
- Since :
- 2.3.1
- Remarks:
- You must release value using free().
- Parameters:
-
[in] key The runtime information key from which data should be read [out] value The current value of the given key
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RUNTIME_INFO_ERROR_NONE Successful RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter RUNTIME_INFO_ERROR_IO_ERROR An input/output error occurred when read value from system RUNTIME_INFO_ERROR_OUT_OF_MEMORY Out of memory RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api RUNTIME_INFO_ERROR_NOT_SUPPORTED Not supported parameter
int runtime_info_set_changed_cb | ( | runtime_info_key_e | key, |
runtime_info_changed_cb | callback, | ||
void * | user_data | ||
) |
Registers a change event callback for given runtime information key.
- Since :
- 2.3.1
- Parameters:
-
[in] key The runtime information type [in] callback The callback function to invoke [in] user_data The user data to be passed to the callback function
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RUNTIME_INFO_ERROR_NONE Successful RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter RUNTIME_INFO_ERROR_PERMISSION_DENIED No permission to use the api RUNTIME_INFO_ERROR_NOT_SUPPORTED Not supported parameter
- Postcondition:
- runtime_info_changed_cb() will be invoked.
int runtime_info_unset_changed_cb | ( | runtime_info_key_e | key | ) |
Unregisters the callback function.
- Since :
- 2.3.1
- Parameters:
-
[in] key The runtime information type
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
RUNTIME_INFO_ERROR_NONE Successful RUNTIME_INFO_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- runtime_info_set_changed_cb()