Tizen(Headed) Native API
6.5
|
Package Archive Info API. It provides functions for getting information of the package archive.
Required Header
#include <package_archive_info.h>
Overview
The Package Archive Info API provides functions to get information from the package archive. You can get basic information such as package id, description, label, author and so on. Also you can get raw data of icon of the package archive.
Functions | |
int | package_archive_info_create (const char *path, package_archive_info_h *archive_info) |
Creates the package archive information for the given package. | |
int | package_archive_info_destroy (package_archive_info_h archive_info) |
Destroys the package archive information handle. | |
int | package_archive_info_get_package (package_archive_info_h archive_info, char **package) |
Gets the package name. | |
int | package_archive_info_get_type (package_archive_info_h archive_info, char **type) |
Gets the type of the package. | |
int | package_archive_info_get_version (package_archive_info_h archive_info, char **version) |
Gets the version of the package. | |
int | package_archive_info_get_api_version (package_archive_info_h archive_info, char **api_version) |
Gets the API version of the package. | |
int | package_archive_info_get_description (package_archive_info_h archive_info, char **description) |
Gets the description of the package. | |
int | package_archive_info_get_label (package_archive_info_h archive_info, char **label) |
Gets the label of the package. | |
int | package_archive_info_get_author (package_archive_info_h archive_info, char **author) |
Gets the author of the package. | |
int | package_archive_info_get_icon (package_archive_info_h archive_info, unsigned char **icon, size_t *icon_size) |
Gets the raw icon of the package. | |
int | package_archive_info_foreach_direct_dependency (package_archive_info_h archive_info, package_info_dependency_info_cb callback, void *user_data) |
Retrieves direct dependencies of the given package. | |
Typedefs | |
typedef struct package_archive_info_s * | package_archive_info_h |
The package archive information handle. |
Typedef Documentation
typedef struct package_archive_info_s* package_archive_info_h |
The package archive information handle.
- Since :
- 4.0
Function Documentation
int package_archive_info_create | ( | const char * | path, |
package_archive_info_h * | archive_info | ||
) |
Creates the package archive information for the given package.
- Since :
- 4.0
- Remarks:
- If the given path is relevant to media storage, the privilege http://tizen.org/privilege/mediastorage is needed.
- If the given path is relevant to external storage, the privilege http://tizen.org/privilege/externalstorage is needed.
- You must release archive_info using package_archive_info_destroy().
- Parameters:
-
[in] path The path of the package [out] archive_info The package archive information for the given package
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PACKAGE_MANAGER_ERROR_NONE Successful PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory PACKAGE_MANAGER_ERROR_IO_ERROR Internal I/O error
- See also:
- package_archive_info_destroy()
int package_archive_info_destroy | ( | package_archive_info_h | archive_info | ) |
Destroys the package archive information handle.
- Since :
- 4.0
- Parameters:
-
[in] archive_info The package archive information handle
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PACKAGE_MANAGER_ERROR_NONE Successful PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
- See also:
- package_archive_info_create()
int package_archive_info_foreach_direct_dependency | ( | package_archive_info_h | archive_info, |
package_info_dependency_info_cb | callback, | ||
void * | user_data | ||
) |
Retrieves direct dependencies of the given package.
package_info_dependency_info_cb() is called for each direct dependency of the given package. For example, if there are packages having the following relationship:
B --> E A --> B --> C D --> C
A --> B means that A depends on B.
If package_archive_info_foreach_direct_dependency(A) is called, the callback will be called once with the following argument values: from = A, to = B.
- Since :
- 5.5
- Remarks:
- The function provides the results synchronously. If there are no dependencies, this function will return PACKAGE_MANAGER_ERROR_NONE immediately and the callback will not be invoked.
- Parameters:
-
[in] archive_info The package archive information [in] callback The iteration callback function [in] user_data The user data to be passed to the callback function
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PACKAGE_MANAGER_ERROR_NONE Successful PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter PACKAGE_MANAGER_ERROR_SYSTEM_ERROR Severe system error
int package_archive_info_get_api_version | ( | package_archive_info_h | archive_info, |
char ** | api_version | ||
) |
Gets the API version of the package.
- Since :
- 4.0
- Remarks:
- You must release api_version using free().
- Parameters:
-
[in] archive_info The package archive information [out] api_version The API version of the package
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PACKAGE_MANAGER_ERROR_NONE Successful PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
int package_archive_info_get_author | ( | package_archive_info_h | archive_info, |
char ** | author | ||
) |
Gets the author of the package.
- Since :
- 4.0
- Remarks:
- You must release author using free().
- Parameters:
-
[in] archive_info The package archive information [out] author The author of the package
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PACKAGE_MANAGER_ERROR_NONE Successful PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
int package_archive_info_get_description | ( | package_archive_info_h | archive_info, |
char ** | description | ||
) |
Gets the description of the package.
- Since :
- 4.0
- Remarks:
- You must release description using free().
- Parameters:
-
[in] archive_info The package archive information [out] description The description of the package
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PACKAGE_MANAGER_ERROR_NONE Successful PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
int package_archive_info_get_icon | ( | package_archive_info_h | archive_info, |
unsigned char ** | icon, | ||
size_t * | icon_size | ||
) |
Gets the raw icon of the package.
- Since :
- 4.0
- Remarks:
- You must release icon using free().
- Parameters:
-
[in] archive_info The package archive information [out] icon The raw icon of the package [out] icon_size The size of the icon
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PACKAGE_MANAGER_ERROR_NONE Successful PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
int package_archive_info_get_label | ( | package_archive_info_h | archive_info, |
char ** | label | ||
) |
Gets the label of the package.
- Since :
- 4.0
- Remarks:
- You must release label using free().
- Parameters:
-
[in] archive_info The package archive information [out] label The label of the package
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PACKAGE_MANAGER_ERROR_NONE Successful PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory PACKAGE_MANAGER_ERROR_IO_ERROR I/O error
int package_archive_info_get_package | ( | package_archive_info_h | archive_info, |
char ** | package | ||
) |
Gets the package name.
- Since :
- 4.0
- Remarks:
- You must release package using free().
- Parameters:
-
[in] archive_info The package archive information [out] package The package name
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PACKAGE_MANAGER_ERROR_NONE Successful PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
int package_archive_info_get_type | ( | package_archive_info_h | archive_info, |
char ** | type | ||
) |
Gets the type of the package.
- Since :
- 4.0
- Remarks:
- You must release type using free().
- Parameters:
-
[in] archive_info The package archive information [out] type The type of the package
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PACKAGE_MANAGER_ERROR_NONE Successful PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
int package_archive_info_get_version | ( | package_archive_info_h | archive_info, |
char ** | version | ||
) |
Gets the version of the package.
- Since :
- 4.0
- Remarks:
- You must release version using free().
- Parameters:
-
[in] archive_info The package archive information [out] version The version of the package
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PACKAGE_MANAGER_ERROR_NONE Successful PACKAGE_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter PACKAGE_MANAGER_ERROR_OUT_OF_MEMORY Out of memory