Tizen Native API
|
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. | |
int | runtime_info_get_system_memory_info (runtime_memory_info_s *info) |
Gets system memory information. | |
int | runtime_info_get_process_memory_info (int *pid, int size, process_memory_info_s **info) |
Gets memory information per processes. | |
int | runtime_info_get_cpu_usage (runtime_cpu_usage_s *usage) |
Gets cpu information. | |
int | runtime_info_get_process_cpu_usage (int *pid, int size, process_cpu_usage_s **usage) |
Gets cpu usage per processes. | |
Typedefs | |
typedef void(* | runtime_info_changed_cb )(runtime_info_key_e key, void *user_data) |
Called when the runtime information changes. |
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.
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
- 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.
- Enumerator:
enum runtime_info_key_e |
Enumeration for keys for runtime information..
- Enumerator:
Function Documentation
int runtime_info_get_cpu_usage | ( | runtime_cpu_usage_s * | usage | ) |
Gets cpu information.
- Since :
- 2.4
- Parameters:
-
[out] usage The cpu usage structure
- 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 occured while reading from system
- See also:
- runtime_info_get_process_cpu_usage()
int runtime_info_get_process_cpu_usage | ( | int * | pid, |
int | size, | ||
process_cpu_usage_s ** | usage | ||
) |
Gets cpu usage per processes.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Remarks:
- You must release s value using free().
The size of s is the same with size.
- Parameters:
-
[in] pid The process unique id array [in] size The size of pid array [out] usage The cpu usage structure array of the processes
- 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_OUT_OF_MEMORY Not able to allocate memory (for output param/other operations) RUNTIME_INFO_ERROR_REMOTE_IO Call to resource daemon failed (dbus errors/resource daemon errors) RUNTIME_INFO_ERROR_IO_ERROR An I/O error occured (during dbus message operations/other IO operations) #RUNTIME_INFO_PERMISSION_DENIED Process not authorized to request process usage info
- See also:
- runtime_info_get_cpu_usage()
int runtime_info_get_process_memory_info | ( | int * | pid, |
int | size, | ||
process_memory_info_s ** | info | ||
) |
Gets memory information per processes.
- Since :
- 2.4
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/systemmonitor
- Remarks:
- You must release s value using free().
The size of s is the same with size.
- Parameters:
-
[in] pid The process unique id array [in] size The size of pid array [out] info The memory information structure array of the processes
- 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_OUT_OF_MEMORY Not able to allocate memory (for output param/other operations) RUNTIME_INFO_ERROR_REMOTE_IO Call to resource daemon failed (dbus errors/resource daemon errors) RUNTIME_INFO_ERROR_IO_ERROR An I/O error during dbus message operations #RUNTIME_INFO_PERMISSION_DENIED Process not authorized to request process usage info
int runtime_info_get_system_memory_info | ( | runtime_memory_info_s * | info | ) |
Gets system memory information.
- Since :
- 2.4
- Parameters:
-
[out] info The system memory information structure
- 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 occured while reading from system
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
- 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 (Since 2.3.1)
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
- 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 (Since 2.3.1)
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
- 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 (Since 2.3.1)
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
- 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 (Since 2.3.1)
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
- 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 (Since 2.3.1)
- 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
- 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()