Tizen Native API  7.0
Package Archive Info

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]pathThe path of the package
[out]archive_infoThe package archive information for the given package
Returns:
0 on success, otherwise a negative error value
Return values:
PACKAGE_MANAGER_ERROR_NONESuccessful
PACKAGE_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
PACKAGE_MANAGER_ERROR_IO_ERRORInternal I/O error
See also:
package_archive_info_destroy()

Destroys the package archive information handle.

Since :
4.0
Parameters:
[in]archive_infoThe package archive information handle
Returns:
0 on success, otherwise a negative error value
Return values:
PACKAGE_MANAGER_ERROR_NONESuccessful
PACKAGE_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
See also:
package_archive_info_create()

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_infoThe package archive information
[in]callbackThe iteration callback function
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
PACKAGE_MANAGER_ERROR_NONESuccessful
PACKAGE_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
PACKAGE_MANAGER_ERROR_SYSTEM_ERRORSevere 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_infoThe package archive information
[out]api_versionThe API version of the package
Returns:
0 on success, otherwise a negative error value
Return values:
PACKAGE_MANAGER_ERROR_NONESuccessful
PACKAGE_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORYOut 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_infoThe package archive information
[out]authorThe author of the package
Returns:
0 on success, otherwise a negative error value
Return values:
PACKAGE_MANAGER_ERROR_NONESuccessful
PACKAGE_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
PACKAGE_MANAGER_ERROR_IO_ERRORI/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_infoThe package archive information
[out]descriptionThe description of the package
Returns:
0 on success, otherwise a negative error value
Return values:
PACKAGE_MANAGER_ERROR_NONESuccessful
PACKAGE_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
PACKAGE_MANAGER_ERROR_IO_ERRORI/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_infoThe package archive information
[out]iconThe raw icon of the package
[out]icon_sizeThe size of the icon
Returns:
0 on success, otherwise a negative error value
Return values:
PACKAGE_MANAGER_ERROR_NONESuccessful
PACKAGE_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
PACKAGE_MANAGER_ERROR_IO_ERRORI/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_infoThe package archive information
[out]labelThe label of the package
Returns:
0 on success, otherwise a negative error value
Return values:
PACKAGE_MANAGER_ERROR_NONESuccessful
PACKAGE_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
PACKAGE_MANAGER_ERROR_IO_ERRORI/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_infoThe package archive information
[out]packageThe package name
Returns:
0 on success, otherwise a negative error value
Return values:
PACKAGE_MANAGER_ERROR_NONESuccessful
PACKAGE_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORYOut 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_infoThe package archive information
[out]typeThe type of the package
Returns:
0 on success, otherwise a negative error value
Return values:
PACKAGE_MANAGER_ERROR_NONESuccessful
PACKAGE_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORYOut 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_infoThe package archive information
[out]versionThe version of the package
Returns:
0 on success, otherwise a negative error value
Return values:
PACKAGE_MANAGER_ERROR_NONESuccessful
PACKAGE_MANAGER_ERROR_INVALID_PARAMETERInvalid parameter
PACKAGE_MANAGER_ERROR_OUT_OF_MEMORYOut of memory