Remove unnecessary handle and related functions
[platform/core/appfw/pkgmgr-info.git] / include / pkgmgr-info.h
1 /*
2  * pkgmgr-info
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7  * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */
22
23 /**
24  * @file                pkgmgr-info.h
25  * @author              Sewook Park <sewook7.park@samsung.com>
26  * @author              Shobhit Srivastava <shobhit.s@samsung.com>
27  * @version             0.1
28  * @brief               This file declares API of pkgmgr-info library
29  *
30  * @addtogroup          APPLICATION_FRAMEWORK
31  * @{
32  *
33  * @defgroup            PackageManagerInfo
34  * @section             Header Header file to include:
35  * @code
36  * #include             <pkgmgr-info.h>
37  * @endcode
38  *
39  * @}
40  */
41
42 #ifndef __PKG_INFO_H__
43 #define __PKG_INFO_H__
44
45 #include <errno.h>
46 #include <stdbool.h>
47 #include <unistd.h>
48 #include <sys/types.h>
49
50 #include "pkgmgrinfo_type.h"
51
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55
56
57 /**
58  * @mainpage
59  *
60  * This is package information library
61  *
62  * Package Information Library is used to get package related information.\n
63  * It uses the package manifest information database to get any package related information\n
64  * It also provides API to set information in the package info database\n
65  *
66  */
67
68 /**
69  * @file        pkgmgr-info.h
70  * @brief       Package Information Library Header File
71  *
72  * Generated by    Sewook Park <sewook7.park@samsung.com>
73  */
74
75
76
77  /** String property for filtering based on package info*/
78 #define PMINFO_PKGINFO_PROP_PACKAGE_ID          "PMINFO_PKGINFO_PROP_PACKAGE_ID"
79  /** String property for filtering based on package info*/
80 #define PMINFO_PKGINFO_PROP_PACKAGE_TYPE        "PMINFO_PKGINFO_PROP_PACKAGE_TYPE"
81  /** String property for filtering based on package info*/
82 #define PMINFO_PKGINFO_PROP_PACKAGE_VERSION     "PMINFO_PKGINFO_PROP_PACKAGE_VERSION"
83  /** String property for filtering based on package info*/
84 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION            "PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION"
85   /** String property for filtering based on package info*/
86 #define PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE           "PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE"
87  /** String property for filtering based on package info*/
88 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME         "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME"
89  /** String property for filtering based on package info*/
90 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL                "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
91  /** String property for filtering based on package info*/
92 #define PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF         "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
93  /** String property for filtering based on package info*/
94 #define PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE           "PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE"
95
96  /** Boolean property for filtering based on package info*/
97 #define PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE           "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
98  /** Boolean property for filtering based on package info*/
99 #define PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD             "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"
100  /** Boolean property for filtering based on package info*/
101 #define PMINFO_PKGINFO_PROP_PACKAGE_READONLY            "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"
102    /** Boolean property for filtering based on package info*/
103 #define PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM              "PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM"
104   /** Boolean property for filtering based on package info*/
105 #define PMINFO_PKGINFO_PROP_PACKAGE_UPDATE              "PMINFO_PKGINFO_PROP_PACKAGE_UPDATE"
106   /** Boolean property for filtering based on package info*/
107 #define PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING          "PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING"
108    /** Boolean property for filtering based on package info*/
109 #define PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING           "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING"
110    /** Boolean property for filtering based on package info*/
111 #define PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE             "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE"
112    /** Boolean property for filtering based on package info*/
113 #define PMINFO_PKGINFO_PROP_PACKAGE_DISABLE             "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE"
114    /** Boolean property for filtering based on package info*/
115 #define PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE               "PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE"
116
117  /** Integer property for filtering based on package info*/
118 #define PMINFO_PKGINFO_PROP_PACKAGE_SIZE                "PMINFO_PKGINFO_PROP_PACKAGE_SIZE"
119
120  /** String property for filtering based on app info*/
121 #define PMINFO_APPINFO_PROP_APP_ID              "PMINFO_APPINFO_PROP_APP_ID"
122  /** String property for filtering based on app info*/
123 #define PMINFO_APPINFO_PROP_APP_COMPONENT               "PMINFO_APPINFO_PROP_APP_COMPONENT"
124  /** String property for filtering based on app info*/
125 #define PMINFO_APPINFO_PROP_APP_EXEC            "PMINFO_APPINFO_PROP_APP_EXEC"
126  /** String property for filtering based on app info*/
127 #define PMINFO_APPINFO_PROP_APP_ICON            "PMINFO_APPINFO_PROP_APP_ICON"
128  /** String property for filtering based on app info*/
129 #define PMINFO_APPINFO_PROP_APP_TYPE            "PMINFO_APPINFO_PROP_APP_TYPE"
130  /** String property for filtering based on app info*/
131 #define PMINFO_APPINFO_PROP_APP_OPERATION       "PMINFO_APPINFO_PROP_APP_OPERATION"
132  /** String property for filtering based on app info*/
133 #define PMINFO_APPINFO_PROP_APP_URI                     "PMINFO_APPINFO_PROP_APP_URI"
134  /** String property for filtering based on app info*/
135 #define PMINFO_APPINFO_PROP_APP_MIME            "PMINFO_APPINFO_PROP_APP_MIME"
136  /** String property for filtering based on app info*/
137 #define PMINFO_APPINFO_PROP_APP_CATEGORY        "PMINFO_APPINFO_PROP_APP_CATEGORY"
138  /** String property for filtering based on app info*/
139 #define PMINFO_APPINFO_PROP_APP_HWACCELERATION  "PMINFO_APPINFO_PROP_APP_HWACCELERATION"
140  /** String property for filtering based on app info*/
141 #define PMINFO_APPINFO_PROP_APP_SCREENREADER    "PMINFO_APPINFO_PROP_APP_SCREENREADER"
142  /** String property for filtering based on app info*/
143 #define PMINFO_APPINFO_PROP_APP_PACKAGE         "PMINFO_APPINFO_PROP_APP_PACKAGE"
144  /** String property for filtering based on app info*/
145 #define PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE               "PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE"
146  /** String property for filtering based on app info*/
147 #define PMINFO_APPINFO_PROP_PRIVILEGE   "PMINFO_APPINFO_PROP_PRIVILEGE"
148
149 /** Integer property for filtering app support mode */
150 #define PMINFO_APPINFO_PROP_APP_SUPPORT_MODE            "PMINFO_APPINFO_PROP_APP_SUPPORT_MODE"
151
152  /** Boolean property for filtering based on app info*/
153 #define PMINFO_APPINFO_PROP_APP_NODISPLAY               "PMINFO_APPINFO_PROP_APP_NODISPLAY"
154  /** Boolean property for filtering based on app info*/
155 #define PMINFO_APPINFO_PROP_APP_MULTIPLE                "PMINFO_APPINFO_PROP_APP_MULTIPLE"
156  /** Boolean property for filtering based on app info*/
157 #define PMINFO_APPINFO_PROP_APP_ONBOOT                  "PMINFO_APPINFO_PROP_APP_ONBOOT"
158  /** Boolean property for filtering based on app info*/
159 #define PMINFO_APPINFO_PROP_APP_AUTORESTART     "PMINFO_APPINFO_PROP_APP_AUTORESTART"
160  /** Boolean property for filtering based on app info*/
161 #define PMINFO_APPINFO_PROP_APP_TASKMANAGE      "PMINFO_APPINFO_PROP_APP_TASKMANAGE"
162  /** Boolean property for filtering based on app info*/
163 #define PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION "PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION"
164  /** Boolean property for filtering based on app info*/
165 #define PMINFO_APPINFO_PROP_APP_UI_GADGET       "PMINFO_APPINFO_PROP_APP_UI_GADGET"
166  /** Boolean property for filtering based on app info*/
167 #define PMINFO_APPINFO_PROP_APP_DISABLE "PMINFO_APPINFO_PROP_APP_DISABLE"
168  /** Boolean property for filtering based on app info*/
169 #define PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE "PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE"
170  /** Boolean property for filtering based on app info*/
171 #define PMINFO_APPINFO_PROP_APP_CHECK_STORAGE   "PMINFO_APPINFO_PROP_APP_CHECK_STORAGE"
172 /** Boolean property for filtering based on app info*/
173 #define PMINFO_APPINFO_PROP_PKG_DISABLE "PMINFO_APPINFO_PROP_PKG_DISABLE"
174
175  /** will be updated*/
176  /** string property for filtering based on pkg info*/
177 #define PMINFO_PKGINFO_PROP_RANGE_BASIC "PMINFO_PKGINFO_PROP_RANGE_BASIC"
178
179 /* For multiuser support */
180 const char *getIconPath(uid_t uid, bool readonly);
181 char *getUserPkgParserDBPath(void);
182 char *getUserPkgParserDBPathUID(uid_t uid);
183 char *getUserPkgCertDBPath(void);
184 const char *getUserManifestPath(uid_t uid, bool readonly);
185
186 /**
187  * @fn  int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
188  * @fn  int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
189  * @brief       This API gets list of installed packages
190  *
191  * @par         This API is for package-manager client application
192  * @par Sync (or) Async : Synchronous API
193  * @param[in]   pkg_list_cb     iteration function for list
194  * @param[in]   user_data       user data to be passed to callback function
195  * @param[in]   uid     the addressee user id of the instruction
196  * @return      0 if success, error code(<0) if fail
197  * @retval      PMINFO_R_OK     success
198  * @retval      PMINFO_R_EINVAL invalid argument
199  * @retval      PMINFO_R_ERROR  internal error
200  * @pre         None
201  * @post        None
202  * @code
203 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
204 {
205         char *pkgid1 = NULL;
206         char *pkgid2 = NULL;
207         pkgid1 = (char *)user_data;
208         pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid2);
209         if (strcmp(pkgid1, pkgid2) == 0) {
210                 return -1;
211         } else {
212                 return 0;
213         }
214 }
215
216 static int list_pkgs()
217 {
218         int ret = 0;
219         char *name = "helloworld";
220         ret = pkgmgrinfo_pkginfo_get_list(pkg_list_cb, (void *)name);
221         if (ret != PMINFO_R_OK) {
222                 return -1;
223         }
224         return 0;
225 }
226  * @endcode
227  */
228 int pkgmgrinfo_pkginfo_get_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
229 int pkgmgrinfo_pkginfo_get_usr_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
230
231 /**
232  * @fn  int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data)
233  * @fn  int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid)
234  * @brief       This API gets list of disabled packages
235  *
236  * @par         This API is for package-manager client application
237  * @par Sync (or) Async : Synchronous API
238  * @param[in]   pkg_list_cb     iteration function for list
239  * @param[in]   user_data       user data to be passed to callback function
240  * @param[in]   uid     the addressee user id of the instruction
241  * @return      0 if success, error code(<0) if fail
242  * @retval      PMINFO_R_OK     success
243  * @retval      PMINFO_R_EINVAL invalid argument
244  * @retval      PMINFO_R_ERROR  internal error
245  * @pre         None
246  * @post        None
247  */
248 int pkgmgrinfo_pkginfo_get_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data);
249 int pkgmgrinfo_pkginfo_get_usr_disabled_list(pkgmgrinfo_pkg_list_cb pkg_list_cb, void *user_data, uid_t uid);
250
251 /**
252  * @fn int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
253  * @brief       This API creates the package information handle from db which is not disabled
254  *
255  * @par         This API is for package-manager client application
256  * @par Sync (or) Async : Synchronous API
257  *
258  * @param[in]   pkgid   pointer to package ID
259  * @param[in]   uid     the addressee user id of the instruction
260  * @param[out] handle           pointer to the package info handle.
261  * @return      0 if success, error code(<0) if fail
262  * @retval      PMINFO_R_OK     success
263  * @retval      PMINFO_R_EINVAL invalid argument
264  * @retval      PMINFO_R_ERROR  internal error
265  * @pre         None
266  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
267  * @see         pkgmgrinfo_pkginfo_get_pkgid()
268  * @see         pkgmgrinfo_pkginfo_is_removable()
269  * @code
270 static int get_pkg_type(const char *pkgid)
271 {
272         int ret = 0;
273         char *type = NULL;
274         pkgmgrinfo_pkginfo_h handle;
275         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
276         if (ret != PMINFO_R_OK)
277                 return -1;
278         ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
279         if (ret != PMINFO_R_OK) {
280                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
281                 return -1;
282         }
283         printf("pkgtype: %s\n", type);
284         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
285         return 0;
286 }
287  * @endcode
288  */
289 int pkgmgrinfo_pkginfo_get_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
290 int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
291
292 /**
293  * @fn int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
294  * @brief       This API creates the disabled package information handle from db
295  *
296  * @par         This API is for package-manager client application
297  * @par Sync (or) Async : Synchronous API
298  *
299  * @param[in]   pkgid   pointer to package ID
300  * @param[in]   uid     the addressee user id of the instruction
301  * @param[out] handle           pointer to the package info handle.
302  * @return      0 if success, error code(<0) if fail
303  * @retval      PMINFO_R_OK     success
304  * @retval      PMINFO_R_EINVAL invalid argument
305  * @retval      PMINFO_R_ERROR  internal error
306  * @pre         None
307  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
308  * @see         pkgmgrinfo_pkginfo_get_pkginfo()
309  */
310 int pkgmgrinfo_pkginfo_get_disabled_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
311 int pkgmgrinfo_pkginfo_get_usr_disabled_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
312
313 /**
314  * @fn int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle)
315  * @brief       This API creates the package information handle from db regardless of its disable or storage status
316  *
317  * @par         This API is for package-manager client application
318  * @par Sync (or) Async : Synchronous API
319  *
320  * @param[in]   pkgid   pointer to package ID
321  * @param[in]   uid     the addressee user id of the instruction
322  * @param[out] handle           pointer to the package info handle.
323  * @return      0 if success, error code(<0) if fail
324  * @retval      PMINFO_R_OK     success
325  * @retval      PMINFO_R_EINVAL invalid argument
326  * @retval      PMINFO_R_ERROR  internal error
327  * @pre         None
328  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
329  * @see         pkgmgrinfo_pkginfo_get_pkgid()
330  * @see         pkgmgrinfo_pkginfo_is_removable()
331  * @code
332 static int get_pkg_type(const char *pkgid)
333 {
334         int ret = 0;
335         char *type = NULL;
336         pkgmgrinfo_pkginfo_h handle;
337         ret = pkgmgrinfo_pkginfo_get_all_pkginfo(pkgid, &handle);
338         if (ret != PMINFO_R_OK)
339                 return -1;
340         ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
341         if (ret != PMINFO_R_OK) {
342                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
343                 return -1;
344         }
345         printf("pkgtype: %s\n", type);
346         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
347         return 0;
348 }
349  * @endcode
350  */
351 int pkgmgrinfo_pkginfo_get_all_pkginfo(const char *pkgid, pkgmgrinfo_pkginfo_h *handle);
352 int pkgmgrinfo_pkginfo_get_usr_all_pkginfo(const char *pkgid, uid_t uid, pkgmgrinfo_pkginfo_h *handle);
353
354 /**
355  * @fn int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name)
356  * @brief       This API gets the package name from the package ID
357  *
358  * @par         This API is for package-manager client application
359  * @par Sync (or) Async : Synchronous API
360  *
361  * @param[in]   handle  pointer to package info handle
362  * @param[out]  pkg_name        pointer to hold package name
363  * @return      0 if success, error code(<0) if fail
364  * @retval      PMINFO_R_OK     success
365  * @retval      PMINFO_R_EINVAL invalid argument
366  * @retval      PMINFO_R_ERROR  internal error
367  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
368  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
369  * @see         pkgmgrinfo_pkginfo_get_type()
370  * @see         pkgmgrinfo_pkginfo_is_removable()
371  * @code
372 static int get_pkg_name(const char *pkgid)
373 {
374         int ret = 0;
375         char *pkgname = NULL;
376         pkgmgrinfo_pkginfo_h handle;
377         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
378         if (ret != PMINFO_R_OK)
379                 return -1;
380         ret = pkgmgrinfo_pkginfo_get_pkgname(handle, &pkgname);
381         if (ret != PMINFO_R_OK) {
382                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
383                 return -1;
384         }
385         printf("pkgname: %s\n", pkgname);
386         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
387         return 0;
388 }
389  * @endcode
390  */
391 int pkgmgrinfo_pkginfo_get_pkgname(pkgmgrinfo_pkginfo_h handle, char **pkg_name);
392
393 /**
394  * @fn int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid)
395  * @brief       This API gets the package id from the package ID
396  *
397  * @par         This API is for package-manager client application
398  * @par Sync (or) Async : Synchronous API
399  *
400  * @param[in]   handle  pointer to package info handle
401  * @param[out]  pkgid   pointer to hold package id
402  * @return      0 if success, error code(<0) if fail
403  * @retval      PMINFO_R_OK     success
404  * @retval      PMINFO_R_EINVAL invalid argument
405  * @retval      PMINFO_R_ERROR  internal error
406  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
407  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
408  * @see         pkgmgrinfo_pkginfo_get_type()
409  * @see         pkgmgrinfo_pkginfo_is_removable()
410  * @code
411 static int get_pkgid(const char *pkgid)
412 {
413         int ret = 0;
414         char *pkg_id = NULL;
415         pkgmgrinfo_pkginfo_h handle;
416         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
417         if (ret != PMINFO_R_OK)
418                 return -1;
419         ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkg_id);
420         if (ret != PMINFO_R_OK) {
421                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
422                 return -1;
423         }
424         printf("pkg id: %s\n", pkg_id);
425         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
426         return 0;
427 }
428  * @endcode
429  */
430 int pkgmgrinfo_pkginfo_get_pkgid(pkgmgrinfo_pkginfo_h handle, char **pkgid);
431
432 /**
433  * @fn int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type)
434  * @brief       This API gets the package type from the package ID
435  *
436  * @par         This API is for package-manager client application
437  * @par Sync (or) Async : Synchronous API
438  *
439  * @param[in]   handle  pointer to package info handle
440  * @param[out] type             pointer to hold package type
441  * @return      0 if success, error code(<0) if fail
442  * @retval      PMINFO_R_OK     success
443  * @retval      PMINFO_R_EINVAL invalid argument
444  * @retval      PMINFO_R_ERROR  internal error
445  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
446  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
447  * @see         pkgmgrinfo_pkginfo_get_pkgid()
448  * @see         pkgmgrinfo_pkginfo_is_removable()
449  * @code
450 static int get_pkg_type(const char *pkgid)
451 {
452         int ret = 0;
453         char *type = NULL;
454         pkgmgrinfo_pkginfo_h handle;
455         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
456         if (ret != PMINFO_R_OK)
457                 return -1;
458         ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
459         if (ret != PMINFO_R_OK) {
460                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
461                 return -1;
462         }
463         printf("pkgtype: %s\n", type);
464         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
465         return 0;
466 }
467  * @endcode
468  */
469 int pkgmgrinfo_pkginfo_get_type(pkgmgrinfo_pkginfo_h handle, char **type);
470
471 /**
472  * @fn int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version)
473  * @brief       This API gets the package version from the package ID
474  *
475  * @par         This API is for package-manager client application
476  * @par Sync (or) Async : Synchronous API
477  *
478  * @param[in]   handle  pointer to package info handle
479  * @param[out] version          pointer to hold package version
480  * @return      0 if success, error code(<0) if fail
481  * @retval      PMINFO_R_OK     success
482  * @retval      PMINFO_R_EINVAL invalid argument
483  * @retval      PMINFO_R_ERROR  internal error
484  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
485  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
486  * @see         pkgmgrinfo_pkginfo_get_pkgid()
487  * @see         pkgmgrinfo_pkginfo_is_removable()
488  * @code
489 static int get_pkg_version(const char *pkgid)
490 {
491         int ret = 0;
492         char *version = NULL;
493         pkgmgrinfo_pkginfo_h handle;
494         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
495         if (ret != PMINFO_R_OK)
496                 return -1;
497         ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
498         if (ret != PMINFO_R_OK) {
499                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
500                 return -1;
501         }
502         printf("pkg version: %s\n", version);
503         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
504         return 0;
505 }
506  * @endcode
507  */
508 int pkgmgrinfo_pkginfo_get_version(pkgmgrinfo_pkginfo_h handle, char **version);
509
510 /**
511  * @fn int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version)
512  * @brief       This API gets the package api_version from the package ID
513  *
514  * @par         This API is for package-manager client application
515  * @par Sync (or) Async : Synchronous API
516  *
517  * @param[in]   handle  pointer to package info handle
518  * @param[out] api_version              pointer to hold package api_version
519  * @return      0 if success, error code(<0) if fail
520  * @retval      PMINFO_R_OK     success
521  * @retval      PMINFO_R_EINVAL invalid argument
522  * @retval      PMINFO_R_ERROR  internal error
523  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
524  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
525  * @see         pkgmgrinfo_pkginfo_get_pkgid()
526  * @see         pkgmgrinfo_pkginfo_is_removable()
527  * @code
528 static int get_pkg_api_version(const char *pkgid)
529 {
530         int ret = 0;
531         char *api_version = NULL;
532         pkgmgrinfo_pkginfo_h handle = NULL;
533         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
534         if (ret != PMINFO_R_OK)
535                 return -1;
536         ret = pkgmgrinfo_pkginfo_get_api_version(handle, &api_version);
537         if (ret != PMINFO_R_OK) {
538                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
539                 return -1;
540         }
541         printf("pkg api_version: %s\n", api_version);
542         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
543         return 0;
544 }
545  * @endcode
546  */
547 int pkgmgrinfo_pkginfo_get_api_version(pkgmgrinfo_pkginfo_h handle, char **api_version);
548
549 /**
550  * @fn int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name)
551  * @brief       This API gets tep(tizen expansion package) file name associated with the package
552  *
553  * @par This API is for package-manager client application
554  * @par Sync (or) Async : Synchronous API
555  *
556  * @param[in] handle    pointer to the pkginfo handle.
557  * @param[out] tep_name pointer to hold tep name
558  * @return      0 if success, error code(<0) if fail
559  * @retval      PMINFO_R_OK success
560  * @retval      PMINFO_R_EINVAL invalid argument
561  * @retval      PMINFO_R_ERROR  internal error
562  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
563  * @post        pkgmgrinfo_pkginfo_destroy_pkginfo()
564  * @see pkgmgrinfo_pkginfo_get_pkgid()
565  * @code
566 static int get_tep_name(const char *pkgid)
567 {
568         int ret = 0;
569         char *tep_name = NULL;
570         pkgmgrinfo_pkginfo_h handle = NULL;
571         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
572         if (ret != PMINFO_R_OK)
573                 return -1;
574         ret = pkgmgrinfo_pkginfo_get_tep_name(handle, &tep_name);
575         if (ret != PMINFO_R_OK) {
576                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
577                 return -1;
578         }
579         printf("TEP name is: %s\n", tep_name);
580         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
581         return 0;
582 }
583  * @endcode
584  */
585 int pkgmgrinfo_pkginfo_get_tep_name(pkgmgrinfo_pkginfo_h handle, char **tep_name);
586
587 /**
588  * @fn int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file)
589  * @brief       This API gets package mount point path associated with the package
590  *                      if package is mount-installed. Otherwise, zip_mount_file is left as NULL value
591  *
592  * @par This API is for package-manager client application
593  * @par Sync (or) Async : Synchronous API
594  *
595  * @param[in] handle    pointer to the pkginfo handle.
596  * @param[out] zip_mount_file   pointer to hold zip mount file
597  * @return      0 if success, error code(<0) if fail
598  * @retval      PMINFO_R_OK success
599  * @retval      PMINFO_R_EINVAL invalid argument
600  * @retval      PMINFO_R_ERROR  internal error
601  * @pre pkgmgrinfo_pkginfo_get_pkginfo()
602  * @post        pkgmgrinfo_pkginfo_destroy_pkginfo()
603  * @see pkgmgrinfo_pkginfo_get_pkgid()
604  * @code
605 static int get_zip_mount_file(const char *pkgid)
606 {
607         int ret = 0;
608         char *zip_mount_file = NULL;
609         pkgmgrinfo_pkginfo_h handle = NULL;
610         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
611         if (ret != PMINFO_R_OK)
612                 return -1;
613         ret = pkgmgrinfo_pkginfo_get_zip_mount_file(handle, &zip_mount_file);
614         if (ret != PMINFO_R_OK) {
615                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
616                 return -1;
617         }
618         if (zip_mount_file != NULL)
619                 printf("Zip mount path is: %s\n", zip_mount_file);
620         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
621         return 0;
622 }
623  * @endcode
624  */
625 int pkgmgrinfo_pkginfo_get_zip_mount_file(pkgmgrinfo_pkginfo_h handle, char **zip_mount_file);
626
627 /**
628  * @fn int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path)
629  * @brief       This API gets package external image path associated with the package
630  *                      if package is installed in external storage.
631  *                      Otherwise, the return value will be PMINFO_R_ENOENT.
632  *
633  * @par This API is for package-manager client application
634  * @par Sync (or) Async : Synchronous API
635  *
636  * @param[in] handle    pointer to the pkginfo handle.
637  * @param[out] ext_image_path   pointer to hold external image path
638  * @return      0 if success, error code(<0) if fail
639  * @retval      PMINFO_R_OK success
640  * @retval      PMINFO_R_EINVAL invalid argument
641  * @retval      PMINFO_R_ERROR  internal error
642  * @revall      PMINFO_R_ENOENT no valid data
643  * @pre pkgmgrinfo_pkginfo_get_pkginfo()
644  * @post        pkgmgrinfo_pkginfo_destroy_pkginfo()
645  * @see pkgmgrinfo_pkginfo_get_pkgid()
646  * @code
647 static int get_external_image_path(const char *pkgid)
648 {
649         int ret = 0;
650         char *ext_image_path = NULL;
651         pkgmgrinfo_pkginfo_h handle = NULL;
652         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
653         if (ret != PMINFO_R_OK)
654                 return -1;
655         ret = pkgmgrinfo_pkginfo_get_external_image_path(handle, &ext_image_path);
656         if (ret != PMINFO_R_OK) {
657                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
658                 return -1;
659         }
660         printf("external image path is: %s\n", ext_image_path);
661         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
662         return 0;
663 }
664  * @endcode
665  */
666 int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path);
667
668 /**
669  * @fn int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
670  * @brief       This API gets the package install location from the package ID
671  *
672  * @par         This API is for package-manager client application
673  * @par Sync (or) Async : Synchronous API
674  *
675  * @param[in] handle    pointer to package info handle
676  * @param[out] location         pointer to hold package install location
677  * @return      0 if success, error code(<0) if fail
678  * @retval      PMINFO_R_OK     success
679  * @retval      PMINFO_R_EINVAL invalid argument
680  * @retval      PMINFO_R_ERROR  internal error
681  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
682  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
683  * @see         pkgmgrinfo_pkginfo_get_pkgid()
684  * @see         pkgmgrinfo_pkginfo_is_removable()
685  * @code
686 static int get_pkg_install_location(const char *pkgid)
687 {
688         int ret = 0;
689         pkgmgrinfo_install_location location;
690         pkgmgrinfo_pkginfo_h handle;
691         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
692         if (ret != PMINFO_R_OK)
693                 return -1;
694         ret = pkgmgrinfo_pkginfo_get_install_location(handle, &location);
695         if (ret != PMINFO_R_OK) {
696                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
697                 return -1;
698         }
699         printf("pkg install location: %d\n", location);
700         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
701         return 0;
702 }
703  * @endcode
704  */
705 int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location);
706
707 /**
708  * @fn int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size)
709  * @brief       This API gets the package size from the package ID. size will be 0 if package install location is internal-only.
710  size will be 0 if package install location is prefer-external but size is not specified in manifest file.Application should check
711  the return value of pkgmgrinfo_pkginfo_get_install_location() and use it to distinguish the above cases.
712  *
713  * @par         This API is for package-manager client application
714  * @par Sync (or) Async : Synchronous API
715  *
716  * @param[in]   handle  pointer to package info handle
717  * @param[out] size             pointer to hold package size
718  * @return      0 if success, error code(<0) if fail
719  * @retval      PMINFO_R_OK     success
720  * @retval      PMINFO_R_EINVAL invalid argument
721  * @retval      PMINFO_R_ERROR  internal error
722  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
723  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
724  * @see         pkgmgrinfo_pkginfo_get_pkgid()
725  * @see         pkgmgrinfo_pkginfo_is_removable()
726  * @code
727 static int get_pkg_size(const char *pkgid)
728 {
729         int ret = 0;
730         int size = 0;
731         pkgmgrinfo_pkginfo_h handle;
732         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
733         if (ret != PMINFO_R_OK)
734                 return -1;
735         ret = pkgmgrinfo_pkginfo_get_package_size(handle, &size);
736         if (ret != PMINFO_R_OK) {
737                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
738                 return -1;
739         }
740         printf("pkgsize: %d\n", size);
741         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
742         return 0;
743 }
744  * @endcode
745  */
746 int pkgmgrinfo_pkginfo_get_package_size(pkgmgrinfo_pkginfo_h handle, int *size);
747
748 /**
749  * @fn int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon)
750  * @brief       This API gets the package icon from the package ID
751  *
752  * @par         This API is for package-manager client application
753  * @par Sync (or) Async : Synchronous API
754  *
755  * @param[in]   handle  pointer to package info handle
756  * @param[out] icon             pointer to hold package icon
757  * @return      0 if success, error code(<0) if fail
758  * @retval      PMINFO_R_OK     success
759  * @retval      PMINFO_R_EINVAL invalid argument
760  * @retval      PMINFO_R_ERROR  internal error
761  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
762  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
763  * @see         pkgmgrinfo_pkginfo_get_pkgid()
764  * @see         pkgmgrinfo_pkginfo_is_removable()
765  * @code
766 static int get_pkg_icon(const char *pkgid)
767 {
768         int ret = 0;
769         char *icon = NULL;
770         pkgmgrinfo_pkginfo_h handle;
771         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
772         if (ret != PMINFO_R_OK)
773                 return -1;
774         ret = pkgmgrinfo_pkginfo_get_icon(handle, &icon);
775         if (ret != PMINFO_R_OK) {
776                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
777                 return -1;
778         }
779         printf("pkg icon: %s\n", icon);
780         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
781         return 0;
782 }
783  * @endcode
784  */
785 int pkgmgrinfo_pkginfo_get_icon(pkgmgrinfo_pkginfo_h handle, char **icon);
786
787 /**
788  * @fn int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
789  * @brief       This API gets the package label from the package ID
790  *
791  * @par         This API is for package-manager client application
792  * @par Sync (or) Async : Synchronous API
793  *
794  * @param[in]   handle  pointer to package info handle
795  * @param[out] label            pointer to hold package label
796  * @return      0 if success, error code(<0) if fail
797  * @retval      PMINFO_R_OK     success
798  * @retval      PMINFO_R_EINVAL invalid argument
799  * @retval      PMINFO_R_ERROR  internal error
800  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
801  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
802  * @see         pkgmgrinfo_pkginfo_get_pkgid()
803  * @see         pkgmgrinfo_pkginfo_is_removable()
804  * @code
805 static int get_pkg_label(const char *pkgid)
806 {
807         int ret = 0;
808         char *label = NULL;
809         pkgmgrinfo_pkginfo_h handle;
810         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
811         if (ret != PMINFO_R_OK)
812                 return -1;
813         ret = pkgmgrinfo_pkginfo_get_label(handle, &label);
814         if (ret != PMINFO_R_OK) {
815                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
816                 return -1;
817         }
818         printf("pkg label: %s\n", label);
819         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
820         return 0;
821 }
822  * @endcode
823  */
824 int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label);
825
826 /**
827  * @fn int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
828  * @brief       This API gets the package description from the package ID
829  *
830  * @par         This API is for package-manager client application
831  * @par Sync (or) Async : Synchronous API
832  *
833  * @param[in]   handle  pointer to package info handle
834  * @param[out] description              pointer to hold package description
835  * @return      0 if success, error code(<0) if fail
836  * @retval      PMINFO_R_OK     success
837  * @retval      PMINFO_R_EINVAL invalid argument
838  * @retval      PMINFO_R_ERROR  internal error
839  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
840  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
841  * @see         pkgmgrinfo_pkginfo_get_pkgid()
842  * @see         pkgmgrinfo_pkginfo_is_removable()
843  * @code
844 static int get_pkg_description(const char *pkgid)
845 {
846         int ret = 0;
847         char *description = NULL;
848         pkgmgrinfo_pkginfo_h handle;
849         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
850         if (ret != PMINFO_R_OK)
851                 return -1;
852         ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
853         if (ret != PMINFO_R_OK) {
854                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
855                 return -1;
856         }
857         printf("pkg description: %s\n", description);
858         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
859         return 0;
860 }
861  * @endcode
862  */
863 int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description);
864
865 /**
866  * @fn int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)
867  * @brief       This API gets the package's author name from the package ID
868  *
869  * @par         This API is for package-manager client application
870  * @par Sync (or) Async : Synchronous API
871  *
872  * @param[in]   handle  pointer to package info handle
873  * @param[out] author_name              pointer to hold package author name
874  * @return      0 if success, error code(<0) if fail
875  * @retval      PMINFO_R_OK     success
876  * @retval      PMINFO_R_EINVAL invalid argument
877  * @retval      PMINFO_R_ERROR  internal error
878  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
879  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
880  * @see         pkgmgrinfo_pkginfo_get_pkgid()
881  * @see         pkgmgrinfo_pkginfo_is_removable()
882  * @code
883 static int get_pkg_author_name(const char *pkgid)
884 {
885         int ret = 0;
886         char *author_name = NULL;
887         pkgmgrinfo_pkginfo_h handle;
888         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
889         if (ret != PMINFO_R_OK)
890                 return -1;
891         ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author_name);
892         if (ret != PMINFO_R_OK) {
893                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
894                 return -1;
895         }
896         printf("pkg author name: %s\n", author_name);
897         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
898         return 0;
899 }
900  * @endcode
901  */
902 int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name);
903
904 /**
905  * @fn int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email)
906  * @brief       This API gets the package's author email from the package ID
907  *
908  * @par         This API is for package-manager client application
909  * @par Sync (or) Async : Synchronous API
910  *
911  * @param[in]   handle  pointer to package info handle
912  * @param[out] author_email             pointer to hold package author email
913  * @return      0 if success, error code(<0) if fail
914  * @retval      PMINFO_R_OK     success
915  * @retval      PMINFO_R_EINVAL invalid argument
916  * @retval      PMINFO_R_ERROR  internal error
917  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
918  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
919  * @see         pkgmgrinfo_pkginfo_get_pkgid()
920  * @see         pkgmgrinfo_pkginfo_is_removable()
921  * @code
922 static int get_pkg_author_email(const char *pkgid)
923 {
924         int ret = 0;
925         char *author_email = NULL;
926         pkgmgrinfo_pkginfo_h handle;
927         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
928         if (ret != PMINFO_R_OK)
929                 return -1;
930         ret = pkgmgrinfo_pkginfo_get_author_email(handle, &author_email);
931         if (ret != PMINFO_R_OK) {
932                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
933                 return -1;
934         }
935         printf("pkg author email: %s\n", author_email);
936         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
937         return 0;
938 }
939  * @endcode
940  */
941 int pkgmgrinfo_pkginfo_get_author_email(pkgmgrinfo_pkginfo_h handle, char **author_email);
942
943 /**
944  * @fn int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href)
945  * @brief       This API gets the package's author href from the package ID
946  *
947  * @par         This API is for package-manager client application
948  * @par Sync (or) Async : Synchronous API
949  *
950  * @param[in]   handle  pointer to package info handle
951  * @param[out] author_href              pointer to hold package author href
952  * @return      0 if success, error code(<0) if fail
953  * @retval      PMINFO_R_OK     success
954  * @retval      PMINFO_R_EINVAL invalid argument
955  * @retval      PMINFO_R_ERROR  internal error
956  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
957  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
958  * @see         pkgmgrinfo_pkginfo_get_pkgid()
959  * @see         pkgmgrinfo_pkginfo_is_removable()
960  * @code
961 static int get_pkg_author_href(const char *pkgid)
962 {
963         int ret = 0;
964         char *author_href = NULL;
965         pkgmgrinfo_pkginfo_h handle;
966         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
967         if (ret != PMINFO_R_OK)
968                 return -1;
969         ret = pkgmgrinfo_pkginfo_get_author_href(handle, &author_href);
970         if (ret != PMINFO_R_OK) {
971                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
972                 return -1;
973         }
974         printf("pkg author href: %s\n", author_href);
975         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
976         return 0;
977 }
978  * @endcode
979  */
980 int pkgmgrinfo_pkginfo_get_author_href(pkgmgrinfo_pkginfo_h handle, char **author_href);
981
982 /**
983  * @fn int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage)
984  * @brief       This API gets the package installed storagae value from the package ID
985  *
986  * @par         This API is for package-manager client application
987  * @par Sync (or) Async : Synchronous API
988  *
989  * @param[in]   handle  pointer to package info handle
990  * @param[out] storage          pointer to hold package installed storage
991  * @return      0 if success, error code(<0) if fail
992  * @retval      PMINFO_R_OK     success
993  * @retval      PMINFO_R_EINVAL invalid argument
994  * @retval      PMINFO_R_ERROR  internal error
995  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
996  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
997  * @see         pkgmgrinfo_pkginfo_get_pkgid()
998  * @see         pkgmgrinfo_pkginfo_is_removable()
999  * @code
1000 static int get_pkg_installed_storage(const char *pkgid)
1001 {
1002         int ret = 0;
1003         pkgmgrinfo_installed_storage storage;
1004         pkgmgrinfo_pkginfo_h handle;
1005         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1006         if (ret != PMINFO_R_OK)
1007                 return -1;
1008         ret = pkgmgrinfo_pkginfo_get_installed_storage(handle, &storage);
1009         if (ret != PMINFO_R_OK) {
1010                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1011                 return -1;
1012         }
1013         printf("pkg installed storage: %d\n", storage);
1014         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1015         return 0;
1016 }
1017  * @endcode
1018  */
1019 int pkgmgrinfo_pkginfo_get_installed_storage(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_installed_storage *storage);
1020
1021 /**
1022  * @fn int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time)
1023  * @brief       This API gets the installed time of package from the package ID
1024  *
1025  * @par         This API is for package-manager client application
1026  * @par Sync (or) Async : Synchronous API
1027  *
1028  * @param[in]   handle  pointer to package info handle
1029  * @param[out] installed_time           pointer to hold installed time of package
1030  * @return      0 if success, error code(<0) if fail
1031  * @retval      PMINFO_R_OK     success
1032  * @retval      PMINFO_R_EINVAL invalid argument
1033  * @retval      PMINFO_R_ERROR  internal error
1034  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1035  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1036  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1037  * @see         pkgmgrinfo_pkginfo_is_removable()
1038  * @code
1039 static int get_pkg_installed_time(const char *pkgid)
1040 {
1041         int ret = 0;
1042         int installed_time = 0;
1043         pkgmgrinfo_pkginfo_h handle;
1044         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1045         if (ret != PMINFO_R_OK)
1046                 return -1;
1047         ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &installed_time);
1048         if (ret != PMINFO_R_OK) {
1049                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1050                 return -1;
1051         }
1052         printf("installed_time: %d\n", installed_time);
1053         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1054         return 0;
1055 }
1056  * @endcode
1057  */
1058 int pkgmgrinfo_pkginfo_get_installed_time(pkgmgrinfo_pkginfo_h handle, int *installed_time);
1059
1060 /**
1061  * @fn int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle)
1062  * @brief       This API creates the update info handle
1063  *
1064  * @par         This API is for package-manager client application
1065  * @par Sync (or) Async : Synchronous API
1066  *
1067  * @param[out]  handle  pointer to package update info handle
1068  * @return      0 if success, error code(<0) if fail
1069  * @retval      PMINFO_R_OK     success
1070  * @retval      PMINFO_R_EINVAL invalid argument
1071  * @retval      PMINFO_R_ERROR  internal error
1072  * @post        pkgmgrinfo_updateinfo_destroy()
1073  * @see         pkgmgrinfo_updateinfo_set_pkgid()
1074  * @see         pkgmgrinfo_updateinfo_set_version()
1075  * @see         pkgmgrinfo_updateinfo_set_type()
1076  * @see         pkgmgr_client_register_pkg_updateinfo()
1077  * @code
1078 static int updateinfo_handle_create()
1079 {
1080         int ret = 0;
1081
1082         pkgmgrinfo_updateinfo_h handle;
1083         ret = pkgmgrinfo_updateinfo_create(&handle);
1084         if (ret != PMINFO_R_OK)
1085                 return -1;
1086         pkgmgrinfo_update_infodestroy(handle);
1087         return 0;
1088 }
1089  * @endcode
1090  */
1091 int pkgmgrinfo_updateinfo_create(pkgmgrinfo_updateinfo_h *update_handle);
1092
1093 /**
1094  * @fn int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle)
1095  * @brief       This API destroy the update info handle
1096  *
1097  * @par         This API is for package-manager client application
1098  * @par Sync (or) Async : Synchronous API
1099  *
1100  * @param[in]   handle  pointer to package update info handle
1101  * @return      0 if success, error code(<0) if fail
1102  * @retval      PMINFO_R_OK     success
1103  * @retval      PMINFO_R_EINVAL invalid argument
1104  * @pre         pkgmgrinfo_updateinfo_create()
1105  * @see         pkgmgr_client_register_pkg_updateinfo()
1106  * @code
1107 static int updateinfo_handle_destroy(pkgmgrinfo_updateinfo_h handle)
1108 {
1109         int ret = 0;
1110
1111         ret = pkgmgrinfo_updateinfo_destroy(handle);
1112         if (ret != PMINFO_R_OK)
1113                 return -1;
1114         return 0;
1115 }
1116  * @endcode
1117  */
1118 int pkgmgrinfo_updateinfo_destroy(pkgmgrinfo_updateinfo_h update_handle);
1119
1120 /**
1121  * @fn int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle)
1122  * @brief       This API creates the package update information handle from db
1123  *
1124  * @par         This API is for package-manager client application
1125  * @par Sync (or) Async : Synchronous API
1126  *
1127  * @param[in]   pkgid   pointer to package ID
1128  * @param[in]   uid     the addressee user id of the instruction
1129  * @param[out] update_handle            pointer to the package update info handle.
1130  * @return      0 if success, error code(<0) if fail
1131  * @retval      PMINFO_R_OK     success
1132  * @retval      PMINFO_R_EINVAL invalid argument
1133  * @retval      PMINFO_R_ERROR  internal error
1134  * @pre         None
1135  * @post                pkgmgrinfo_updateinfo_destroy()
1136  * @see         pkgmgrinfo_updateinfo_get_pkgid()
1137  * @see         pkgmgrinfo_updateinfo_get_version()
1138  * @see         pkgmgrinfo_updateinfo_get_update_type()
1139  * @code
1140 static int get_pkg_update_info(const char *pkgid)
1141 {
1142         int ret = 0;
1143         char *version;
1144         pkgmgrinfo_updateinfo_h handle;
1145         ret = pkgmgrinfo_updateinfo_get_updateinfo(pkgid, &handle);
1146         if (ret != PMINFO_R_OK)
1147                 return -1;
1148         ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1149         if (ret != PMINFO_R_OK) {
1150                 pkgmgrinfo_updateinfo_destroy(handle);
1151                 return -1;
1152         }
1153         printf("pkg update version: %s\n", version
1154         pkgmgrinfo_updateinfo_destroy(handle);
1155         return 0;
1156 }
1157  * @endcode
1158  */
1159 int pkgmgrinfo_updateinfo_get_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle);
1160 int pkgmgrinfo_updateinfo_get_usr_updateinfo(const char *pkgid, pkgmgrinfo_updateinfo_h *update_handle, uid_t uid);
1161
1162 /**
1163  * @fn int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid)
1164  * @brief       This API sets given pkgid into handle
1165  *
1166  * @par         This API is for package-manager client application
1167  * @par Sync (or) Async : Synchronous API
1168  *
1169  * @param[in]   handle  pointer to package update info handle
1170  * @param[in]   pkgid   package id
1171  * @return      0 if success, error code(<0) if fail
1172  * @retval      PMINFO_R_OK     success
1173  * @retval      PMINFO_R_EINVAL invalid argument
1174  * @retval      PMINFO_R_ERROR  internal error
1175  * @code
1176 static int set_pkgid_to_handle(pkgmgrinfo_updateinfo_h handle, const char *pkgid)
1177 {
1178         int ret = 0;
1179
1180         ret = pkgmgrinfo_updateinfo_set_pkgid(handle, pkgid);
1181         if (ret != PMINFO_R_OK)
1182                 return -1;
1183         return 0;
1184 }
1185  * @endcode
1186  */
1187 int pkgmgrinfo_updateinfo_set_pkgid(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *pkgid);
1188
1189 /**
1190  * @fn int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version)
1191  * @brief       This API sets given version into handle
1192  *
1193  * @par         This API is for package-manager client application
1194  * @par Sync (or) Async : Synchronous API
1195  *
1196  * @param[in]   handle  pointer to package update info handle
1197  * @param[in]   version update version
1198  * @return      0 if success, error code(<0) if fail
1199  * @retval      PMINFO_R_OK     success
1200  * @retval      PMINFO_R_EINVAL invalid argument
1201  * @retval      PMINFO_R_ERROR  internal error
1202  * @code
1203 static int set_version_to_handle(pkgmgrinfo_updateinfo_h handle, const char *version)
1204 {
1205         int ret = 0;
1206
1207         ret = pkgmgrinfo_updateinfo_set_version(handle, version);
1208         if (ret != PMINFO_R_OK)
1209                 return -1;
1210         return 0;
1211 }
1212  * @endcode
1213  */
1214 int pkgmgrinfo_updateinfo_set_version(pkgmgrinfo_updateinfo_h updateinfo_handle, const char *version);
1215
1216 /**
1217  * @fn int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type)
1218  * @brief       This API sets given update type into handle
1219  *
1220  * @par         This API is for package-manager client application
1221  * @par Sync (or) Async : Synchronous API
1222  *
1223  * @param[in]   handle  pointer to package update info handle
1224  * @param[in]   type    update type
1225  * @return      0 if success, error code(<0) if fail
1226  * @retval      PMINFO_R_OK     success
1227  * @retval      PMINFO_R_EINVAL invalid argument
1228  * @retval      PMINFO_R_ERROR  internal error
1229  * @code
1230 static int set_type_to_handle(pkgmgrinfo_updateinfo_h handle, pkgmgrinfo_updateinfo_update_type type)
1231 {
1232         int ret = 0;
1233
1234         ret = pkgmgrinfo_updateinfo_set_type(handle, type);
1235         if (ret != PMINFO_R_OK)
1236                 return -1;
1237         return 0;
1238 }
1239  * @endcode
1240  */
1241 int pkgmgrinfo_updateinfo_set_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type type);
1242
1243 /**
1244  * @fn int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid)
1245  * @brief       This API retrieves the pkgid from given update info
1246  *
1247  * @par         This API is for package-manager client application
1248  * @par Sync (or) Async : Synchronous API
1249  *
1250  * @param[in]   handle  pointer to package update info handle
1251  * @param[out]  pkgid   package id
1252  * @return      0 if success, error code(<0) if fail
1253  * @retval      PMINFO_R_OK     success
1254  * @retval      PMINFO_R_EINVAL invalid argument
1255  * @retval      PMINFO_R_ERROR  internal error
1256  * @code
1257 static int get_pkgid_from_handle(pkgmgrinfo_updateinfo_h handle)
1258 {
1259         int ret = 0;
1260         char *pkgid;
1261
1262         ret = pkgmgrinfo_updateinfo_get_pkgid(handle, &pkgid);
1263         if (ret != PMINFO_R_OK)
1264                 return -1;
1265         return 0;
1266 }
1267  * @endcode
1268  */
1269 int pkgmgrinfo_updateinfo_get_pkgid(pkgmgrinfo_updateinfo_h update_handle, char **pkgid);
1270
1271 /**
1272  * @fn int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version)
1273  * @brief       This API retrieves the version from given update info
1274  *
1275  * @par         This API is for package-manager client application
1276  * @par Sync (or) Async : Synchronous API
1277  *
1278  * @param[in]   handle  pointer to package update info handle
1279  * @param[out]  version update version
1280  * @return      0 if success, error code(<0) if fail
1281  * @retval      PMINFO_R_OK     success
1282  * @retval      PMINFO_R_EINVAL invalid argument
1283  * @retval      PMINFO_R_ERROR  internal error
1284  * @code
1285 static int get_version_from_handle(pkgmgrinfo_updateinfo_h handle)
1286 {
1287         int ret = 0;
1288         char *version;
1289
1290         ret = pkgmgrinfo_updateinfo_get_version(handle, &version);
1291         if (ret != PMINFO_R_OK)
1292                 return -1;
1293         return 0;
1294 }
1295  * @endcode
1296  */
1297 int pkgmgrinfo_updateinfo_get_version(pkgmgrinfo_updateinfo_h updateinfo_handle, char **version);
1298
1299 /**
1300  * @fn int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type)
1301  * @brief       This API retrieves the update type from given update info
1302  *
1303  * @par         This API is for package-manager client application
1304  * @par Sync (or) Async : Synchronous API
1305  *
1306  * @param[in]   handle  pointer to package update info handle
1307  * @param[out]  type    update type
1308  * @return      0 if success, error code(<0) if fail
1309  * @retval      PMINFO_R_OK     success
1310  * @retval      PMINFO_R_EINVAL invalid argument
1311  * @retval      PMINFO_R_ERROR  internal error
1312  * @code
1313 static int get_type_from_handle(pkgmgrinfo_updateinfo_h handle)
1314 {
1315         int ret = 0;
1316         pkgmgrinfo_updateinfo_update_type *type;
1317
1318         ret = pkgmgrinfo_updateinfo_get_type(handle, &type);
1319         if (ret != PMINFO_R_OK)
1320                 return -1;
1321         return 0;
1322 }
1323  * @endcode
1324  */
1325 int pkgmgrinfo_updateinfo_get_update_type(pkgmgrinfo_updateinfo_h updateinfo_handle, pkgmgrinfo_updateinfo_update_type *type);
1326
1327
1328 /**
1329  * @fn int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data)
1330  * @brief       This API retrieve the update informations and invoke given callback for it.
1331  *
1332  * @par         This API is for package-manager client application
1333  * @par Sync (or) Async : Synchronous API
1334  *
1335  * @param[in]   callback        callback to be invoked for each retrieved informations
1336  * @param[in]   user_data       user data to be passed to callback
1337  * @return      0 if success, error code(<0) if fail
1338  * @retval      PMINFO_R_OK     success
1339  * @retval      PMINFO_R_EINVAL invalid argument
1340  * @retval      PMINFO_R_ERROR  internal error
1341  * @code
1342 static int foreach_pkg_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback)
1343 {
1344         int ret = 0;
1345
1346         ret = pkgmgrinfo_updateinfo_foreach_updateinfo(callback, NULL);
1347         if (ret != PMINFO_R_OK)
1348                 return -1;
1349         return 0;
1350 }
1351  * @endcode
1352  */
1353 int pkgmgrinfo_updateinfo_foreach_updateinfo(pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1354 int pkgmgrinfo_updateinfo_usr_foreach_updateinfo(uid_t uid, pkgmgrinfo_foreach_updateinfo_cb callback, void *user_data);
1355
1356 /**
1357  * @fn int pkgmgrinfo_plugininfo_is_executed(const char *pkgid, const char *appid, const char *plugin_type, const char *plugin_name, bool *is_executed);
1358  * @brief       This API checkes whether given plugin had been executed with given package ID and application ID or not.
1359  *
1360  * @par         This API is for package-manager client application
1361  * @par Sync (or) Async : Synchronous API
1362  *
1363  * @param[in]   pkgid   package ID
1364  * @param[in]   appid   application ID
1365  * @param[in]   plugin_type     plugin type to be checked
1366  * @param[in]   plugin_name     plugin name to be checked
1367  * @param[out]  is_executed     check result
1368  * @return      0 if success, error code(<0) if fail
1369  * @retval      PMINFO_R_OK     success
1370  * @retval      PMINFO_R_EINVAL invalid argument
1371  * @retval      PMINFO_R_ERROR  internal error
1372  * @code
1373 static bool check_execute_info(const char *pkgid, const char *appid, const char *plugin_type, const char *plugin_name)
1374 {
1375         int ret = 0;
1376         bool is_executed;
1377
1378         ret = pkgmgrinfo_plugininfo_is_executed(pkgid, appid, plugin_type, plugin_name, &is_executed);
1379         if (ret != PMINFO_R_OK)
1380                 return -1;
1381         printf("is checked is [%d]\n", is_executed);
1382         return 0;
1383 }
1384  * @endcode
1385  */
1386 int pkgmgrinfo_plugininfo_is_executed(const char *pkgid, const char *appid,
1387                 const char *plugin_type, const char *plugin_name, bool *is_executed);
1388
1389 /**
1390  * @fn int pkgmgrinfo_plugininfo_foreach_plugininfo(const char *pkgid, const char *plugin_type, const char *plugin_name, pkgmgrinfo_plugin_list_cb plugin_list_cb, void *user_data);
1391  * @brief       This API retrieve the previous plugin execution info and invoke callbacks each of it.
1392  *
1393  * @par         This API is for package-manager client application
1394  * @par Sync (or) Async : Synchronous API
1395  *
1396  * @param[in]   pkgid                   package ID
1397  * @param[in]   plugin_type             type of plugin
1398  * @param[in]   plugin_name             name of plugin
1399  * @param[in]   plugin_list_cb  callback to be invoked for each plugin execution info
1400  * @param[out]  user_data               user data to be passed to callback
1401  * @return      0 if success, error code(<0) if fail
1402  * @retval      PMINFO_R_OK     success
1403  * @retval      PMINFO_R_EINVAL invalid argument
1404  * @retval      PMINFO_R_ERROR  internal error
1405  * @code
1406 static int foreach_pkg_plugininfo(const char *pkgid, const char *plugin_type, const char *plugin_name, pkgmgrinfo_plugin_list_cb callback)
1407 {
1408         int ret = 0;
1409
1410         ret = pkgmgrinfo_plugininfo_foreach_plugininfo(pkgid, plugin_type, plugin_name, callback, NULL);
1411         if (ret != PMINFO_R_OK)
1412                 return -1;
1413         return 0;
1414 }
1415  * @endcode
1416  */
1417 int pkgmgrinfo_plugininfo_foreach_plugininfo(const char *pkgid,
1418                 const char *plugin_type, const char *plugin_name,
1419                 pkgmgrinfo_plugin_list_cb plugin_list_cb, void *user_data);
1420
1421 /**
1422  * @fn int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode)
1423  * @brief       This API gets the launch mode of package from the package ID
1424  *
1425  * @par         This API is for package-manager client application
1426  * @par Sync (or) Async : Synchronous API
1427  *
1428  * @param[in]   handle  pointer to package info handle
1429  * @param[out] mode             pointer to hold launch mode of package
1430  * @return      0 if success, error code(<0) if fail
1431  * @retval      PMINFO_R_OK     success
1432  * @retval      PMINFO_R_EINVAL invalid argument
1433  * @retval      PMINFO_R_ERROR  internal error
1434  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1435  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1436  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1437  * @see         pkgmgrinfo_pkginfo_is_removable()
1438  * @code
1439 static int get_pkg_launch_mode(const char *pkgid)
1440 {
1441         int ret = 0;
1442         char *launch_mode = NULL;
1443         pkgmgrinfo_pkginfo_h handle;
1444         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1445         if (ret != PMINFO_R_OK)
1446                 return -1;
1447         ret = pkgmgrinfo_pkginfo_get_launch_mode(handle, &mode);
1448         if (ret != PMINFO_R_OK) {
1449                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1450                 return -1;
1451         }
1452         printf("launch mode: %s\n", mode);
1453         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1454         return 0;
1455 }
1456  * @endcode
1457  */
1458 int pkgmgrinfo_appinfo_get_launch_mode(pkgmgrinfo_appinfo_h handle, char **mode);
1459
1460 /**
1461  * @fn int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid)
1462  * @brief       This API gets the store client id of package from the package ID
1463  *
1464  * @par         This API is for package-manager client application
1465  * @par Sync (or) Async : Synchronous API
1466  *
1467  * @param[in]   handle  pointer to package info handle
1468  * @param[out] storeclientid            pointer to hold store client id of package
1469  * @return      0 if success, error code(<0) if fail
1470  * @retval      PMINFO_R_OK     success
1471  * @retval      PMINFO_R_EINVAL invalid argument
1472  * @retval      PMINFO_R_ERROR  internal error
1473  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1474  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1475  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1476  * @see         pkgmgrinfo_pkginfo_is_removable()
1477  * @code
1478 static int get_pkg_storeclientid(const char *pkgid)
1479 {
1480         int ret = 0;
1481         char *storeclientid = 0;
1482         pkgmgrinfo_pkginfo_h handle;
1483         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1484         if (ret != PMINFO_R_OK)
1485                 return -1;
1486         ret = pkgmgrinfo_pkginfo_get_storeclientid(handle, &storeclientid);
1487         if (ret != PMINFO_R_OK) {
1488                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1489                 return -1;
1490         }
1491         printf(store client id: %s\n", storeclientid);
1492         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1493         return 0;
1494 }
1495  * @endcode
1496  */
1497 int pkgmgrinfo_pkginfo_get_storeclientid(pkgmgrinfo_pkginfo_h handle, char **storeclientid);
1498
1499 /**
1500  * @fn int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid)
1501  * @brief       This API gets the main app id of package from the package ID
1502  *
1503  * @par         This API is for package-manager client application
1504  * @par Sync (or) Async : Synchronous API
1505  *
1506  * @param[in]   handle  pointer to package info handle
1507  * @param[out] mainappid                pointer to hold main app id of package
1508  * @return      0 if success, error code(<0) if fail
1509  * @retval      PMINFO_R_OK     success
1510  * @retval      PMINFO_R_EINVAL invalid argument
1511  * @retval      PMINFO_R_ERROR  internal error
1512  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1513  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1514  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1515  * @see         pkgmgrinfo_pkginfo_is_removable()
1516  * @code
1517 static int get_pkg_mainappid(const char *pkgid)
1518 {
1519         int ret = 0;
1520         char *mainappid = 0;
1521         pkgmgrinfo_pkginfo_h handle;
1522         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1523         if (ret != PMINFO_R_OK)
1524                 return -1;
1525         ret = pkgmgrinfo_pkginfo_get_mainappid(handle, &mainappid);
1526         if (ret != PMINFO_R_OK) {
1527                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1528                 return -1;
1529         }
1530         printf(main app id: %s\n", mainappid);
1531         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1532         return 0;
1533 }
1534  * @endcode
1535  */
1536 int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h handle, char **mainappid);
1537
1538 /**
1539  * @fn int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url)
1540  * @brief       This API gets the url of package from the package ID
1541  *
1542  * @par         This API is for package-manager client application
1543  * @par Sync (or) Async : Synchronous API
1544  *
1545  * @param[in]   handle  pointer to package info handle
1546  * @param[out] url              pointer to hold url of package
1547  * @return      0 if success, error code(<0) if fail
1548  * @retval      PMINFO_R_OK     success
1549  * @retval      PMINFO_R_EINVAL invalid argument
1550  * @retval      PMINFO_R_ERROR  internal error
1551  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1552  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1553  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1554  * @see         pkgmgrinfo_pkginfo_is_removable()
1555  * @code
1556 static int get_pkg_url(const char *pkgid)
1557 {
1558         int ret = 0;
1559         char *url = 0;
1560         pkgmgrinfo_pkginfo_h handle;
1561         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1562         if (ret != PMINFO_R_OK)
1563                 return -1;
1564         ret = pkgmgrinfo_pkginfo_get_url(handle, &url);
1565         if (ret != PMINFO_R_OK) {
1566                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1567                 return -1;
1568         }
1569         printf("url : %s\n", url);
1570         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1571         return 0;
1572 }
1573  * @endcode
1574  */
1575 int pkgmgrinfo_pkginfo_get_url(pkgmgrinfo_pkginfo_h handle, char **url);
1576
1577 /**
1578  * @fn int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path)
1579  * @brief       This API gets the root path of package
1580  *
1581  * @par Sync (or) Async : Synchronous API
1582  *
1583  * @param[in] handle            pointer to package info handle
1584  * @param[out] path             pointer to hold root path of package
1585  * @return      0 if success, error code(<0) if fail
1586  * @retval      PMINFO_R_OK     success
1587  * @retval      PMINFO_R_EINVAL invalid argument
1588  * @retval      PMINFO_R_ERROR  internal error
1589  * @code
1590 static int get_root_path(const char *pkgid)
1591 {
1592         int ret = 0;
1593         char *path = 0;
1594         pkgmgrinfo_pkginfo_h handle;
1595         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1596         if (ret != PMINFO_R_OK)
1597                 return -1;
1598
1599         ret = pkgmgrinfo_pkginfo_get_root_path(handle, &path);
1600         if (ret != PMINFO_R_OK) {
1601                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1602                 return -1;
1603         }
1604         printf("path : %s\n", path);
1605         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1606
1607         return 0;
1608 }
1609  * @endcode
1610  */
1611 int pkgmgrinfo_pkginfo_get_root_path(pkgmgrinfo_pkginfo_h handle, char **path);
1612
1613
1614 /**
1615  * @fn int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path)
1616  * @brief       This API gets the csc path of package
1617  *
1618  * @par Sync (or) Async : Synchronous API
1619  *
1620  * @param[in] handle            pointer to package info handle
1621  * @param[out] path             pointer to hold csc path of package
1622  * @return      0 if success, error code(<0) if fail
1623  * @retval      PMINFO_R_OK     success
1624  * @retval      PMINFO_R_EINVAL invalid argument
1625  * @retval      PMINFO_R_ERROR  internal error
1626  * @code
1627 static int get_csc_path(const char *pkgid)
1628 {
1629         int ret = 0;
1630         char *path = 0;
1631         pkgmgrinfo_pkginfo_h handle;
1632         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1633         if (ret != PMINFO_R_OK)
1634                 return -1;
1635
1636         ret = pkgmgrinfo_pkginfo_get_csc_path(handle, &path);
1637         if (ret != PMINFO_R_OK) {
1638                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1639                 return -1;
1640         }
1641         printf("path : %s\n", path);
1642         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1643
1644         return 0;
1645 }
1646  * @endcode
1647  */
1648 int pkgmgrinfo_pkginfo_get_csc_path(pkgmgrinfo_pkginfo_h handle, char **path);
1649
1650 /**
1651  * @fn int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode)
1652  * @brief       This API gets the support_mode of package
1653  *
1654  * @par Sync (or) Async : Synchronous API
1655  *
1656  * @param[in] handle            pointer to package info handle
1657  * @param[out] support_mode             pointer to hold support_mode of package
1658  * @return      0 if success, error code(<0) if fail
1659  * @retval      PMINFO_R_OK     success
1660  * @retval      PMINFO_R_EINVAL invalid argument
1661  * @retval      PMINFO_R_ERROR  internal error
1662  * @code
1663 static int get_support_mode(const char *pkgid)
1664 {
1665         int ret = 0;
1666         int support_mode = 0;
1667         pkgmgrinfo_pkginfo_h handle = NULL;
1668         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1669         if (ret != PMINFO_R_OK)
1670                 return -1;
1671
1672         ret = pkgmgrinfo_pkginfo_get_support_mode(handle, &support_mode);
1673         if (ret != PMINFO_R_OK) {
1674                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1675                 return -1;
1676         }
1677         printf("support_mode : %s\n", support_mode);
1678         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1679
1680         return 0;
1681 }
1682  * @endcode
1683  */
1684 int pkgmgrinfo_pkginfo_get_support_mode(pkgmgrinfo_pkginfo_h handle, int *support_mode);
1685
1686 /**
1687  * @fn int pkgmgrinfo_pkginfo_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1688  * @brief       This API compare the cert information from given package id
1689  *
1690  * @par         This API is for package-manager client application
1691  * @par Sync (or) Async : Synchronous API
1692  *
1693  * @param[in]   lhs_package_id  pointer to first package ID
1694  * @param[in]   rhs_package_id  pointer to second package ID
1695  * @param[out] compare_result           pointer to the compare result.
1696  * @return      0 if success, error code(<0) if fail
1697  * @retval      PMINFO_R_OK     success
1698  * @retval      PMINFO_R_EINVAL invalid argument
1699  * @retval      PMINFO_R_ERROR  internal error
1700  * @pre         None
1701  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1702  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1703  * @see         pkgmgrinfo_pkginfo_is_removable()
1704  * @code
1705 static int compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1706 {
1707         int ret = 0;
1708         pkgmgrinfo_cert_compare_result_type_e result;
1709
1710         ret = pkgmgrinfo_pkginfo_compare_pkg_cert_info(lhs_package_id, rhs_package_id, &result);
1711         if (ret != PMINFO_R_OK) {
1712                 return -1;
1713         }
1714         printf("result: %d\n", result);
1715         return 0;
1716 }
1717  * @endcode
1718  */
1719 int pkgmgrinfo_pkginfo_compare_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1720 int pkgmgrinfo_pkginfo_compare_usr_pkg_cert_info(const char *lhs_package_id, const char *rhs_package_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1721 /**
1722  * @fn int pkgmgrinfo_pkginfo_compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1723  * @brief       This API compare the cert information from given app id
1724  *
1725  * @par         This API is for package-manager client application
1726  * @par Sync (or) Async : Synchronous API
1727  *
1728  * @param[in]   lhs_app_id      pointer to first app ID
1729  * @param[in]   rhs_app_id      pointer to second app ID
1730  * @param[out] compare_result           pointer to the compare result.
1731  * @return      0 if success, error code(<0) if fail
1732  * @retval      PMINFO_R_OK     success
1733  * @retval      PMINFO_R_EINVAL invalid argument
1734  * @retval      PMINFO_R_ERROR  internal error
1735  * @pre         None
1736  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1737  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1738  * @see         pkgmgrinfo_pkginfo_is_removable()
1739  * @code
1740 static int compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result)
1741 {
1742         int ret = 0;
1743         pkgmgrinfo_cert_compare_result_type_e result;
1744
1745         ret = pkgmgrinfo_pkginfo_compare_app_cert_info(lhs_app_id, rhs_app_id, &result);
1746         if (ret != PMINFO_R_OK) {
1747                 return -1;
1748         }
1749         printf("result: %d\n", result);
1750         return 0;
1751 }
1752  * @endcode
1753  */
1754 int pkgmgrinfo_pkginfo_compare_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1755 int pkgmgrinfo_pkginfo_compare_usr_app_cert_info(const char *lhs_app_id, const char *rhs_app_id, uid_t uid, pkgmgrinfo_cert_compare_result_type_e *compare_result);
1756 /**
1757  * @fn int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable)
1758  * @brief       This API gets the package 'removable' value from the package ID
1759  *
1760  * @par         This API is for package-manager client application
1761  * @par Sync (or) Async : Synchronous API
1762  *
1763  * @param[in]   handle  pointer to package info handle
1764  * @param[out] removable                pointer to hold package removable value
1765  * @return      0 if success, error code(<0) if fail
1766  * @retval      PMINFO_R_OK     success
1767  * @retval      PMINFO_R_EINVAL invalid argument
1768  * @retval      PMINFO_R_ERROR  internal error
1769  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1770  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1771  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1772  * @see         pkgmgrinfo_pkginfo_is_readonly()
1773  * @code
1774 static int get_pkg_removable(const char *pkgid)
1775 {
1776         int ret = 0;
1777         bool removable;
1778         pkgmgrinfo_pkginfo_h handle;
1779         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1780         if (ret != PMINFO_R_OK)
1781                 return -1;
1782         ret = pkgmgrinfo_pkginfo_is_removable(handle, &removable);
1783         if (ret != PMINFO_R_OK) {
1784                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1785                 return -1;
1786         }
1787         printf("pkg removable: %d\n", removable);
1788         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1789         return 0;
1790 }
1791  * @endcode
1792  */
1793 int pkgmgrinfo_pkginfo_is_removable(pkgmgrinfo_pkginfo_h handle, bool *removable);
1794
1795 /**
1796  * @fn int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable)
1797  * @brief       This API check that the package can move internal storage to external storage or external storage to internal storage from the package ID
1798  *
1799  * @par         This API is for package-manager client application
1800  * @par Sync (or) Async : Synchronous API
1801  *
1802  * @param[in]   handle  pointer to package info handle
1803  * @param[out] movable          pointer to hold package movable state
1804  * @return      0 if success, error code(<0) if fail
1805  * @retval      PMINFO_R_OK     success
1806  * @retval      PMINFO_R_EINVAL invalid argument
1807  * @retval      PMINFO_R_ERROR  internal error
1808  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1809  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1810  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1811  * @code
1812 static int get_pkg_movable(const char *pkgid)
1813 {
1814         int ret = 0;
1815         bool movable;
1816         pkgmgrinfo_pkginfo_h handle;
1817         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1818         if (ret != PMINFO_R_OK)
1819                 return -1;
1820         ret = pkgmgrinfo_pkginfo_is_movable(handle, &movable);
1821         if (ret != PMINFO_R_OK) {
1822                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1823                 return -1;
1824         }
1825         printf("pkg movable: %d\n", movable);
1826         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1827         return 0;
1828 }
1829  * @endcode
1830  */
1831 int pkgmgrinfo_pkginfo_is_movable(pkgmgrinfo_pkginfo_h handle, bool *movable);
1832
1833 /**
1834  * @fn int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload)
1835  * @brief       This API gets the package 'preload' value from the package ID
1836  *
1837  * @par         This API is for package-manager client application
1838  * @par Sync (or) Async : Synchronous API
1839  *
1840  * @param[in]   handle  pointer to package info handle
1841  * @param[out] preload          pointer to hold package preload value
1842  * @return      0 if success, error code(<0) if fail
1843  * @retval      PMINFO_R_OK     success
1844  * @retval      PMINFO_R_EINVAL invalid argument
1845  * @retval      PMINFO_R_ERROR  internal error
1846  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1847  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1848  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1849  * @see         pkgmgrinfo_pkginfo_is_readonly()
1850  * @code
1851 static int get_pkg_preload(const char *pkgid)
1852 {
1853         int ret = 0;
1854         bool preload;
1855         pkgmgrinfo_pkginfo_h handle;
1856         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1857         if (ret != PMINFO_R_OK)
1858                 return -1;
1859         ret = pkgmgrinfo_pkginfo_is_preload(handle, &preload);
1860         if (ret != PMINFO_R_OK) {
1861                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1862                 return -1;
1863         }
1864         printf("pkg preload: %d\n", preload);
1865         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1866         return 0;
1867 }
1868  * @endcode
1869  */
1870 int pkgmgrinfo_pkginfo_is_preload(pkgmgrinfo_pkginfo_h handle, bool *preload);
1871
1872 /**
1873  * @fn int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system)
1874  * @brief       This API gets the value for given handle is system or not
1875  *
1876  * @par         This API is for package-manager client application
1877  * @par Sync (or) Async : Synchronous API
1878  *
1879  * @param[in]   handle  pointer to package info handle
1880  * @param[out] system           pointer to hold  system is or not
1881  * @return      0 if success, error code(<0) if fail
1882  * @retval      PMINFO_R_OK     success
1883  * @retval      PMINFO_R_EINVAL invalid argument
1884  * @retval      PMINFO_R_ERROR  internal error
1885  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1886  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1887  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1888  * @see         pkgmgrinfo_pkginfo_is_readonly()
1889  * @code
1890 static int get_pkg_system(const char *pkgid)
1891 {
1892         int ret = 0;
1893         bool system = false;
1894         pkgmgrinfo_pkginfo_h handle = NULL;
1895         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1896         if (ret != PMINFO_R_OK)
1897                 return -1;
1898         ret = pkgmgrinfo_pkginfo_is_system(handle, &system);
1899         if (ret != PMINFO_R_OK) {
1900                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1901                 return -1;
1902         }
1903         printf("pkg system: %d\n", system);
1904         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1905         return 0;
1906 }
1907  * @endcode
1908  */
1909 int pkgmgrinfo_pkginfo_is_system(pkgmgrinfo_pkginfo_h handle, bool *system);
1910
1911 /**
1912  * @fn int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly)
1913  * @brief       This API gets the package 'readonly' value from the package ID
1914  *
1915  * @par         This API is for package-manager client application
1916  * @par Sync (or) Async : Synchronous API
1917  *
1918  * @param[in]   handle  pointer to package info handle
1919  * @param[out] readonly pointer to hold package readonly value
1920  * @return      0 if success, error code(<0) if fail
1921  * @retval      PMINFO_R_OK     success
1922  * @retval      PMINFO_R_EINVAL invalid argument
1923  * @retval      PMINFO_R_ERROR  internal error
1924  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1925  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1926  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1927  * @see         pkgmgrinfo_pkginfo_is_removable()
1928  * @code
1929 static int get_pkg_readonly(const char *pkgid)
1930 {
1931         int ret = 0;
1932         bool readonly;
1933         pkgmgrinfo_pkginfo_h handle;
1934         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1935         if (ret != PMINFO_R_OK)
1936                 return -1;
1937         ret = pkgmgrinfo_pkginfo_is_readonly(handle, &readonly);
1938         if (ret != PMINFO_R_OK) {
1939                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1940                 return -1;
1941         }
1942         printf("pkg readonly: %d\n", readonly);
1943         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1944         return 0;
1945 }
1946  * @endcode
1947  */
1948 int pkgmgrinfo_pkginfo_is_readonly(pkgmgrinfo_pkginfo_h handle, bool *readonly);
1949
1950
1951 /**
1952  * @fn int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update)
1953  * @brief       This API gets the package 'update' value from the package ID
1954  *
1955  * @par         This API is for package-manager client application
1956  * @par Sync (or) Async : Synchronous API
1957  *
1958  * @param[in]   handle  pointer to package info handle
1959  * @param[out] update   pointer to hold package update value
1960  * @return      0 if success, error code(<0) if fail
1961  * @retval      PMINFO_R_OK     success
1962  * @retval      PMINFO_R_EINVAL invalid argument
1963  * @retval      PMINFO_R_ERROR  internal error
1964  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
1965  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
1966  * @see         pkgmgrinfo_pkginfo_get_pkgid()
1967  * @code
1968 static int get_pkg_update(const char *pkgid)
1969 {
1970         int ret = 0;
1971         bool update;
1972         pkgmgrinfo_pkginfo_h handle;
1973         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
1974         if (ret != PMINFO_R_OK)
1975                 return -1;
1976         ret = pkgmgrinfo_pkginfo_is_update(handle, &update);
1977         if (ret != PMINFO_R_OK) {
1978                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1979                 return -1;
1980         }
1981         printf("pkg update: %d\n", update);
1982         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
1983         return 0;
1984 }
1985  * @endcode
1986  */
1987 int pkgmgrinfo_pkginfo_is_update(pkgmgrinfo_pkginfo_h handle, bool *update);
1988
1989 /**
1990  * @fn int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable)
1991  * @brief       This API gets the package 'support_disable' value from the package ID
1992  *
1993  * @par         This API is for package-manager client application
1994  * @par Sync (or) Async : Synchronous API
1995  *
1996  * @param[in]   handle  pointer to package info handle
1997  * @param[out]  support_disable pointer to hold package support_disable value
1998  * @return      0 if success, error code(<0) if fail
1999  * @retval      PMINFO_R_OK     success
2000  * @retval      PMINFO_R_EINVAL invalid argument
2001  * @retval      PMINFO_R_ERROR  internal error
2002  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2003  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2004  * @see         pkgmgrinfo_pkginfo_get_pkgid()
2005  * @code
2006 static int get_pkg_support_disable(const char *pkgid)
2007 {
2008         int ret = 0;
2009         bool support_disable;
2010         pkgmgrinfo_pkginfo_h handle = NULL;
2011         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2012         if (ret != PMINFO_R_OK)
2013                 return -1;
2014         ret = pkgmgrinfo_pkginfo_is_support_disable(handle, &support_disable);
2015         if (ret != PMINFO_R_OK) {
2016                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2017                 return -1;
2018         }
2019         printf("pkg support_disable: %d\n", support_disable);
2020         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2021         return 0;
2022 }
2023  * @endcode
2024  */
2025 int pkgmgrinfo_pkginfo_is_support_disable(pkgmgrinfo_pkginfo_h handle, bool *support_disable);
2026
2027 /**
2028  * @fn int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global)
2029  * @brief       This API gets whether the given package is global package or user package
2030  *
2031  * @par         This API is for package-manager client application
2032  * @par Sync (or) Async : Synchronous API
2033  *
2034  * @param[in]   handle  pointer to package info handle
2035  * @param[in]   global  pointer to hold package global value
2036  * @return      0 if success, error code(<0) if fail
2037  * @retval      PMINFO_R_OK     success
2038  * @retval      PMINFO_R_EINVAL invalid argument
2039  * @retval      PMINFO_R_ERROR  internal error
2040  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2041  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2042  * @see         pkgmgrinfo_pkginfo_get_pkgid()
2043  static int get_pkg_support_disable(const char *pkgid)
2044  {
2045          int ret = 0;
2046          bool global;
2047          pkgmgrinfo_pkginfo_h handle = NULL;
2048          ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2049          if (ret != PMINFO_R_OK)
2050                  return -1;
2051          ret = pkgmgrinfo_pkginfo_is_global(handle, &global);
2052          if (ret != PMINFO_R_OK) {
2053                  pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2054                  return -1;
2055          }
2056          printf("pkg is_global: %d\n", global);
2057          pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2058          return 0;
2059  }
2060   * @endcode
2061   */
2062 int pkgmgrinfo_pkginfo_is_global(pkgmgrinfo_pkginfo_h handle, bool *global);
2063
2064 /**
2065  * @fn int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible)
2066  * @brief       This API gets the package 'accessible' value from the package ID
2067  *
2068  * @par         This API is for package-manager client application
2069  * @par Sync (or) Async : Synchronous API
2070  *
2071  * @param[in]   handle  pointer to package info handle
2072  * @param[out] accessible       pointer to hold package accessible value
2073  * @return      0 if success, error code(<0) if fail
2074  * @retval      PMINFO_R_OK     success
2075  * @retval      PMINFO_R_EINVAL invalid argument
2076  * @retval      PMINFO_R_ERROR  internal error
2077  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2078  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2079  * @see         pkgmgrinfo_pkginfo_get_pkgid()
2080  * @see         pkgmgrinfo_pkginfo_is_readonly()
2081  * @code
2082 static int get_pkg_accessible(const char *pkgid)
2083 {
2084         int ret = 0;
2085         bool accessible;
2086         pkgmgrinfo_pkginfo_h handle;
2087         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2088         if (ret != PMINFO_R_OK)
2089                 return -1;
2090         ret = pkgmgrinfo_pkginfo_is_accessible(handle, &accessible);
2091         if (ret != PMINFO_R_OK) {
2092                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2093                 return -1;
2094         }
2095         printf("pkg accessible: %d\n", accessible);
2096         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2097         return 0;
2098 }
2099  * @endcode
2100  */
2101 int pkgmgrinfo_pkginfo_is_accessible(pkgmgrinfo_pkginfo_h handle, bool *accessible);
2102
2103 /**
2104  * @fn int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle)
2105  * @brief       This API destroys the package information handle freeing up all the resources
2106  *
2107  * @par         This API is for package-manager client application
2108  * @par Sync (or) Async : Synchronous API
2109  *
2110  * @param[in]   handle  pointer to the package info handle
2111  * @return      0 if success, error code(<0) if fail
2112  * @retval      PMINFO_R_OK     success
2113  * @retval      PMINFO_R_EINVAL invalid argument
2114  * @retval      PMINFO_R_ERROR  internal error
2115  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2116  * @post                None
2117  * @see         pkgmgrinfo_pkginfo_get_pkgid()
2118  * @see         pkgmgrinfo_pkginfo_is_removable()
2119  * @code
2120 static int get_pkg_type(const char *pkgid)
2121 {
2122         int ret = 0;
2123         char *type = NULL;
2124         pkgmgrinfo_pkginfo_h handle;
2125         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2126         if (ret != PMINFO_R_OK)
2127                 return -1;
2128         ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
2129         if (ret != PMINFO_R_OK) {
2130                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2131                 return -1;
2132         }
2133         printf("pkgtype: %s\n", type);
2134         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2135         return 0;
2136 }
2137  * @endcode
2138  */
2139 int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle);
2140
2141 /**
2142  * @fn int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle)
2143  * @brief       This API creates the package information filter handle from db.  All filter properties will be ANDed.
2144  The query will search the entire package information collected from the manifest file of all the installed packages
2145  *
2146  * @par         This API is for package-manager client application
2147  * @par Sync (or) Async : Synchronous API
2148  *
2149  * @param[out] handle           pointer to the package info filter handle.
2150  * @return      0 if success, error code(<0) if fail
2151  * @retval      PMINFO_R_OK     success
2152  * @retval      PMINFO_R_EINVAL invalid argument
2153  * @retval      PMINFO_R_ERROR  internal error
2154  * @pre         None
2155  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2156  * @see         pkgmgrinfo_pkginfo_filter_count()
2157  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2158  * @code
2159 static int get_tpk_pkg_count()
2160 {
2161         int ret = 0;
2162         int count = 0;
2163         pkgmgrinfo_pkginfo_filter_h handle;
2164         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2165         if (ret != PMINFO_R_OK)
2166                 return -1;
2167         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2168         if (ret != PMINFO_R_OK) {
2169                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2170                 return -1;
2171         }
2172         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2173         if (ret != PMINFO_R_OK) {
2174                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2175                 return -1;
2176         }
2177         printf("No of tpk pkgs: %d\n", count);
2178         pkgmgrinfo_pkginfo_filter_destroy(handle);
2179         return 0;
2180 }
2181  * @endcode
2182  */
2183 int pkgmgrinfo_pkginfo_filter_create(pkgmgrinfo_pkginfo_filter_h *handle);
2184
2185 /**
2186  * @fn int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle)
2187  * @brief       This API destroys the package information filter handle freeing up all the resources
2188  *
2189  * @par         This API is for package-manager client application
2190  * @par Sync (or) Async : Synchronous API
2191  *
2192  * @param[in] handle            pointer to the package info filter handle.
2193  * @return      0 if success, error code(<0) if fail
2194  * @retval      PMINFO_R_OK     success
2195  * @retval      PMINFO_R_EINVAL invalid argument
2196  * @retval      PMINFO_R_ERROR  internal error
2197  * @pre         pkgmgrinfo_pkginfo_filter_create()
2198  * @post                None
2199  * @see         pkgmgrinfo_pkginfo_filter_count()
2200  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2201  * @code
2202 static int get_tpk_pkg_count()
2203 {
2204         int ret = 0;
2205         int count = 0;
2206         pkgmgrinfo_pkginfo_filter_h handle;
2207         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2208         if (ret != PMINFO_R_OK)
2209                 return -1;
2210         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2211         if (ret != PMINFO_R_OK) {
2212                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2213                 return -1;
2214         }
2215         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2216         if (ret != PMINFO_R_OK) {
2217                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2218                 return -1;
2219         }
2220         printf("No of tpk pkgs: %d\n", count);
2221         pkgmgrinfo_pkginfo_filter_destroy(handle);
2222         return 0;
2223 }
2224  * @endcode
2225  */
2226 int pkgmgrinfo_pkginfo_filter_destroy(pkgmgrinfo_pkginfo_filter_h handle);
2227
2228 /**
2229  * @fn int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const bool value)
2230  * @brief       This API adds a boolean filter property to the filter handle
2231  *
2232  * @par         This API is for package-manager client application
2233  * @par Sync (or) Async : Synchronous API
2234  *
2235  * @param[in] handle            pointer to the package info filter handle.
2236  * @param[in] property          boolean property name.
2237  * @param[in] value             value corresponding to the property.
2238  * @return      0 if success, error code(<0) if fail
2239  * @retval      PMINFO_R_OK     success
2240  * @retval      PMINFO_R_EINVAL invalid argument
2241  * @retval      PMINFO_R_ERROR  internal error
2242  * @pre         pkgmgrinfo_pkginfo_filter_create()
2243  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2244  * @see         pkgmgrinfo_pkginfo_filter_count()
2245  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2246  * @code
2247 static int get_preload_pkg_count()
2248 {
2249         int ret = 0;
2250         int count = 0;
2251         pkgmgrinfo_pkginfo_filter_h handle;
2252         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2253         if (ret != PMINFO_R_OK)
2254                 return -1;
2255         ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1);
2256         if (ret != PMINFO_R_OK) {
2257                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2258                 return -1;
2259         }
2260         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2261         if (ret != PMINFO_R_OK) {
2262                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2263                 return -1;
2264         }
2265         printf("No of preload pkgs: %d\n", count);
2266         pkgmgrinfo_pkginfo_filter_destroy(handle);
2267         return 0;
2268 }
2269  * @endcode
2270  */
2271 int pkgmgrinfo_pkginfo_filter_add_bool(pkgmgrinfo_pkginfo_filter_h handle,
2272                 const char *property, const bool value);
2273
2274 /**
2275  * @fn int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const int value)
2276  * @brief       This API adds an integer filter property to the filter handle
2277  *
2278  * @par         This API is for package-manager client application
2279  * @par Sync (or) Async : Synchronous API
2280  *
2281  * @param[in] handle            pointer to the package info filter handle.
2282  * @param[in] property          integer property name.
2283  * @param[in] value             value corresponding to the property.
2284  * @return      0 if success, error code(<0) if fail
2285  * @retval      PMINFO_R_OK     success
2286  * @retval      PMINFO_R_EINVAL invalid argument
2287  * @retval      PMINFO_R_ERROR  internal error
2288  * @pre         pkgmgrinfo_pkginfo_filter_create()
2289  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2290  * @see         pkgmgrinfo_pkginfo_filter_count()
2291  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2292  * @code
2293 static int get_pkg_count()
2294 {
2295         int ret = 0;
2296         int count = 0;
2297         pkgmgrinfo_pkginfo_filter_h handle;
2298         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2299         if (ret != PMINFO_R_OK)
2300                 return -1;
2301         ret = pkgmgrinfo_pkginfo_filter_add_int(handle, PMINFO_PKGINFO_PROP_PACKAGE_SIZE, 10);
2302         if (ret != PMINFO_R_OK) {
2303                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2304                 return -1;
2305         }
2306         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2307         if (ret != PMINFO_R_OK) {
2308                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2309                 return -1;
2310         }
2311         printf("No of preload pkgs: %d\n", count);
2312         pkgmgrinfo_pkginfo_filter_destroy(handle);
2313         return 0;
2314 }
2315  * @endcode
2316  */
2317 int pkgmgrinfo_pkginfo_filter_add_int(pkgmgrinfo_pkginfo_filter_h handle,
2318                 const char *property, const int value);
2319
2320 /**
2321  * @fn int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle, const char *property, const char *value)
2322  * @brief       This API adds a string filter property to the filter handle
2323  *
2324  * @par         This API is for package-manager client application
2325  * @par Sync (or) Async : Synchronous API
2326  *
2327  * @param[in] handle            pointer to the package info filter handle.
2328  * @param[in] property          string property name.
2329  * @param[in] value             value corresponding to the property.
2330  * @return      0 if success, error code(<0) if fail
2331  * @retval      PMINFO_R_OK     success
2332  * @retval      PMINFO_R_EINVAL invalid argument
2333  * @retval      PMINFO_R_ERROR  internal error
2334  * @pre         pkgmgrinfo_pkginfo_filter_create()
2335  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2336  * @see         pkgmgrinfo_pkginfo_filter_count()
2337  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2338  * @code
2339 static int get_tpk_pkg_count()
2340 {
2341         int ret = 0;
2342         int count = 0;
2343         pkgmgrinfo_pkginfo_filter_h handle;
2344         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2345         if (ret != PMINFO_R_OK)
2346                 return -1;
2347         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2348         if (ret != PMINFO_R_OK) {
2349                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2350                 return -1;
2351         }
2352         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2353         if (ret != PMINFO_R_OK) {
2354                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2355                 return -1;
2356         }
2357         printf("No of tpk pkgs: %d\n", count);
2358         pkgmgrinfo_pkginfo_filter_destroy(handle);
2359         return 0;
2360 }
2361  * @endcode
2362  */
2363 int pkgmgrinfo_pkginfo_filter_add_string(pkgmgrinfo_pkginfo_filter_h handle,
2364                 const char *property, const char *value);
2365
2366 /**
2367  * @fn int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle, pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data)
2368  * @brief       This API executes the user supplied callback function for each package that satisfy the filter conditions
2369  *
2370  * @par         This API is for package-manager client application
2371  * @par Sync (or) Async : Synchronous API
2372  *
2373  * @param[in] handle            pointer to the package info filter handle.
2374  * @param[in] pkg_cb            callback function.
2375  * @param[in] user_data         user data to be passed to the callback function
2376  * @return      0 if success, error code(<0) if fail
2377  * @retval      PMINFO_R_OK     success
2378  * @retval      PMINFO_R_EINVAL invalid argument
2379  * @retval      PMINFO_R_ERROR  internal error
2380  * @pre         pkgmgrinfo_pkginfo_filter_create()
2381  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2382  * @see         pkgmgrinfo_pkginfo_filter_count()
2383  * @code
2384 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
2385 {
2386         char *pkgid = NULL;
2387         pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
2388         printf("pkg id : %s\n", pkgid);
2389         return 0;
2390 }
2391
2392 static int get_tpk_pkg_list()
2393 {
2394         int ret = 0;
2395         pkgmgrinfo_pkginfo_filter_h handle;
2396         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2397         if (ret != PMINFO_R_OK)
2398                 return -1;
2399         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2400         if (ret != PMINFO_R_OK) {
2401                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2402                 return -1;
2403         }
2404         ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, pkg_list_cb, NULL);
2405         if (ret != PMINFO_R_OK) {
2406                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2407                 return -1;
2408         }
2409         pkgmgrinfo_pkginfo_filter_destroy(handle);
2410         return 0;
2411 }
2412  * @endcode
2413  */
2414 int pkgmgrinfo_pkginfo_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2415                 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data);
2416 int pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(pkgmgrinfo_pkginfo_filter_h handle,
2417                 pkgmgrinfo_pkg_list_cb pkg_cb, void *user_data, uid_t uid);
2418
2419 /**
2420  * @fn int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count)
2421  * @fn int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid)
2422  * @brief       This API counts the package that satisfy the filter conditions
2423  *
2424  * @par         This API is for package-manager client application
2425  * @par Sync (or) Async : Synchronous API
2426  *
2427  * @param[in] handle            pointer to the package info filter handle.
2428  * @param[in] count             pointer to store the count value.
2429  * @param[in]   uid     the addressee user id of the instruction
2430  * @return      0 if success, error code(<0) if fail
2431  * @retval      PMINFO_R_OK     success
2432  * @retval      PMINFO_R_EINVAL invalid argument
2433  * @retval      PMINFO_R_ERROR  internal error
2434  * @pre         pkgmgrinfo_pkginfo_filter_create()
2435  * @post                pkgmgrinfo_pkginfo_filter_destroy()
2436  * @see         pkgmgrinfo_pkginfo_filter_foreach_pkginfo()
2437  * @code
2438 static int get_tpk_pkg_count()
2439 {
2440         int ret = 0;
2441         int count = 0;
2442         pkgmgrinfo_pkginfo_filter_h handle;
2443         ret = pkgmgrinfo_pkginfo_filter_create(&handle);
2444         if (ret != PMINFO_R_OK)
2445                 return -1;
2446         ret = pkgmgrinfo_pkginfo_filter_add_string(handle, PMINFO_PKGINFO_PROP_PACKAGE_TYPE, "tpk");
2447         if (ret != PMINFO_R_OK) {
2448                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2449                 return -1;
2450         }
2451         ret = pkgmgrinfo_pkginfo_filter_count(handle, &count);
2452         if (ret != PMINFO_R_OK) {
2453                 pkgmgrinfo_pkginfo_filter_destroy(handle);
2454                 return -1;
2455         }
2456         printf("No of tpk pkgs: %d\n", count);
2457         pkgmgrinfo_pkginfo_filter_destroy(handle);
2458         return 0;
2459 }
2460  * @endcode
2461  */
2462 int pkgmgrinfo_pkginfo_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count);
2463 int pkgmgrinfo_pkginfo_usr_filter_count(pkgmgrinfo_pkginfo_filter_h handle, int *count, uid_t uid);
2464
2465 /**
2466  * @fn  int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2467                         pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2468  * @brief       This API gets the list of privilege for a particular package
2469  *
2470  * @par         This API is for package-manager client application
2471  * @par Sync (or) Async : Synchronous API
2472  * @param[in]   handle          pointer to the package info handle.
2473  * @param[in]   privilege_func          callback function for list
2474  * @param[in] user_data user data to be passed to callback function
2475  * @return      0 if success, error code(<0) if fail
2476  * @retval      PMINFO_R_OK     success
2477  * @retval      PMINFO_R_EINVAL invalid argument
2478  * @retval      PMINFO_R_ERROR  internal error
2479  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2480  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2481  * @code
2482 int privilege_func(const char *name, void *user_data)
2483 {
2484         if (strcmp(name, (char *)user_data) == 0)
2485                 return -1;
2486         else
2487                 return 0;
2488 }
2489
2490 static int list_privilege(const char *package, char *privilege)
2491 {
2492         int ret = 0;
2493         pkgmgrinfo_pkginfo_h handle;
2494         ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2495         if (ret != PMINFO_R_OK)
2496                 return -1;
2497         ret = pkgmgrinfo_pkginfo_foreach_privilege(handle, privilege_func, (void *)privilege);
2498         if (ret != PMINFO_R_OK) {
2499                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2500                 return -1;
2501         }
2502         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2503         return 0;
2504 }
2505  * @endcode
2506  */
2507 int pkgmgrinfo_pkginfo_foreach_privilege(pkgmgrinfo_pkginfo_h handle,
2508                         pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
2509
2510 /**
2511  * @fn  int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2512                         pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2513  * @brief       This API gets the list of appdefined privilege for a particular package
2514  *
2515  * @par         This API is for package-manager client application
2516  * @par Sync (or) Async : Synchronous API
2517  * @param[in]   handle          pointer to the package info handle.
2518  * @param[in]   privilege_func          callback function for list
2519  * @param[in] user_data user data to be passed to callback function
2520  * @return      0 if success, error code(<0) if fail
2521  * @retval      PMINFO_R_OK     success
2522  * @retval      PMINFO_R_EINVAL invalid argument
2523  * @retval      PMINFO_R_ERROR  internal error
2524  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2525  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2526  * @code
2527 int privilege_func(const char *name, const char *license_path, void *user_data)
2528 {
2529         printf("appdefined privilege : %s", name);
2530         if (license_path)
2531                 printf("licensed privilege, lecense path : %s", license_path);
2532         return 0;
2533 }
2534
2535 static int list_appdefined_privilege(const char *package)
2536 {
2537         int ret = 0;
2538         pkgmgrinfo_pkginfo_h handle;
2539         ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2540         if (ret != PMINFO_R_OK)
2541                 return -1;
2542         ret = pkgmgrinfo_pkginfo_foreach_appdefined_privilege(handle, privilege_func, NULL);
2543         if (ret != PMINFO_R_OK) {
2544                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2545                 return -1;
2546         }
2547         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2548         return 0;
2549 }
2550  * @endcode
2551  */
2552 int pkgmgrinfo_pkginfo_foreach_appdefined_privilege(pkgmgrinfo_pkginfo_h handle,
2553                         pkgmgrinfo_pkg_appdefined_privilege_list_cb privilege_func, void *user_data);
2554
2555 /**
2556  * @fn  int pkgmgrinfo_pkginfo_foreach_plugin(pkgmgrinfo_pkginfo_h handle,
2557                         pkgmgrinfo_plugin_list_cb plugin_func, void *user_data);
2558  * @brief       This API gets the list of plugin execution info for a particular package
2559  *
2560  * @par         This API is for package-manager client application
2561  * @par Sync (or) Async : Synchronous API
2562  * @param[in]   handle          pointer to the package info handle.
2563  * @param[in]   plugin_func             callback function for list
2564  * @param[in] user_data user data to be passed to callback function
2565  * @return      0 if success, error code(<0) if fail
2566  * @retval      PMINFO_R_OK     success
2567  * @retval      PMINFO_R_EINVAL invalid argument
2568  * @retval      PMINFO_R_ERROR  internal error
2569  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2570  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2571  * @code
2572 int plugin_func(const char *pkgid, const char *appid,
2573                                 const char *plugin_type, const char *plugin_name,
2574                                 void *user_data)
2575 {
2576         printf("appid : %s, type : %s, name : %s\n", appid, plugin_type, plugin_name);
2577
2578         return 0;
2579 }
2580
2581 static int list_plugin(const char *package)
2582 {
2583         int ret = 0;
2584         pkgmgrinfo_pkginfo_h handle;
2585         ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
2586         if (ret != PMINFO_R_OK)
2587                 return -1;
2588         ret = pkgmgrinfo_pkginfo_foreach_plugin(handle, plugin_func, NULL);
2589         if (ret != PMINFO_R_OK) {
2590                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2591                 return -1;
2592         }
2593         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2594         return 0;
2595 }
2596  * @endcode
2597  */
2598 int pkgmgrinfo_pkginfo_foreach_plugin(pkgmgrinfo_pkginfo_h handle,
2599                         pkgmgrinfo_plugin_list_cb plugin_func, void *user_data);
2600
2601 /* TODO: add doxygen comment here */
2602 int pkgmgrinfo_pkginfo_is_for_all_users(pkgmgrinfo_pkginfo_h handle, bool *for_all_users);
2603
2604 /**
2605  * @fn int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone)
2606  * @brief       This API copy the application information handle
2607  *
2608  * @par         This API is for package-manager client application
2609  * @par Sync (or) Async : Synchronous API
2610  *
2611  * @param[in]   handle  pointer to the package info handle.
2612  * @param[out]  handle  pointer to the package info handle.
2613  * @return      0 if success, error code(<0) if fail
2614  * @retval      PMINFO_R_OK     success
2615  * @retval      PMINFO_R_EINVAL invalid argument
2616  * @retval      PMINFO_R_ERROR  internal error
2617  * @pre         None
2618  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
2619  * @code
2620 static int get_appinfo_clone(pkgmgrinfo_pkginfo_h handle)
2621 {
2622         int ret = 0;
2623
2624         pkgmgrinfo_pkginfo_h clone;
2625
2626         ret = pkgmgrinfo_appinfo_clone_appinfo(handle, &clone);
2627         if (ret != PMINFO_R_OK)
2628                 return -1;
2629
2630
2631         printf("package: %s\n", clone->package);
2632         pkgmgrinfo_appinfo_destroy_appinfo(clone);
2633         return 0;
2634 }
2635  * @endcode
2636  */
2637 int pkgmgrinfo_appinfo_clone_appinfo(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_pkginfo_h *clone);
2638
2639
2640 /**
2641  * @fn  int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2642  pkgmgrinfo_app_list_cb app_func, void *user_data)
2643  * @brief       This API gets list of installed applications for a particular package
2644  *
2645  * @par         This API is for package-manager client application
2646  * @par Sync (or) Async : Synchronous API
2647  * @param[in]   handle          package info handle
2648  * @param[in]   component       application component
2649  * @param[in]   app_func                iteration function for list
2650  * @param[in] user_data user data to be passed to callback function
2651  * @return      0 if success, error code(<0) if fail
2652  * @retval      PMINFO_R_OK     success
2653  * @retval      PMINFO_R_EINVAL invalid argument
2654  * @retval      PMINFO_R_ERROR  internal error
2655  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
2656  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
2657  * @code
2658 int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
2659 {
2660         char *appid = NULL;
2661         pkgmgrinfo_appinfo_get_appid(handle, &appid);
2662         printf("appid : %s\n", appid);
2663         return 0;
2664 }
2665
2666 static int list_apps(const char *pkgid)
2667 {
2668         int ret = 0;
2669         pkgmgrinfo_pkginfo_h handle;
2670         ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
2671         if (ret != PMINFO_R_OK)
2672                 return -1;
2673         ret = pkgmgrinfo_appinfo_get_list(handle, PMINFO_UI_APP, app_func, NULL);
2674         if (ret != PMINFO_R_OK) {
2675                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2676                 return -1;
2677         }
2678         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
2679         return 0;
2680 }
2681  * @endcode
2682  */
2683 int pkgmgrinfo_appinfo_get_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2684                                                         pkgmgrinfo_app_list_cb app_func, void *user_data);
2685 int pkgmgrinfo_appinfo_get_usr_list(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_app_component component,
2686                                                         pkgmgrinfo_app_list_cb app_func, void *user_data, uid_t uid);
2687
2688 /**
2689  * @fn  int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2690  * @brief       This API gets list of installed applications from all packages.
2691  *
2692  * @par         This API is for package-manager client application
2693  * @par Sync (or) Async : Synchronous API
2694  * @param[in]   app_func                iteration function for list
2695  * @param[in] user_data user data to be passed to callback function
2696  * @return      0 if success, error code(<0) if fail
2697  * @retval      PMINFO_R_OK     success
2698  * @retval      PMINFO_R_EINVAL invalid argument
2699  * @retval      PMINFO_R_ERROR  internal error
2700  * @pre         None
2701  * @post                None
2702  * @code
2703 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
2704 {
2705         char *pkgid1 = NULL;
2706         char *pkgid2 = NULL;
2707         pkgid1 = (char *)user_data;
2708         pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid2);
2709         if (strcmp(pkgid1, pkgid2) == 0) {
2710                 return -1;
2711         } else {
2712                 return 0;
2713         }
2714 }
2715
2716 static int list_apps()
2717 {
2718         int ret = 0;
2719         char *name = "helloworld";
2720         ret = pkgmgrinfo_appinfo_get_installed_list(app_list_cb, (void *)name);
2721         if (ret != PMINFO_R_OK) {
2722                 return -1;
2723         }
2724         return 0;
2725 }
2726  * @endcode
2727  */
2728 int pkgmgrinfo_appinfo_get_installed_list(pkgmgrinfo_app_list_cb app_func, void *user_data);
2729 int pkgmgrinfo_appinfo_get_usr_installed_list(pkgmgrinfo_app_list_cb app_func, uid_t uid, void *user_data);
2730
2731 /**
2732  * @fn int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2733  * @brief       This API creates the disabled application information handle from db
2734  *
2735  * @par         This API is for package-manager client application
2736  * @par Sync (or) Async : Synchronous API
2737  *
2738  * @param[in]   appid   pointer to appid
2739  * @param[out] handle           pointer to the application info handle.
2740  * @return      0 if success, error code(<0) if fail
2741  * @retval      PMINFO_R_OK     success
2742  * @retval      PMINFO_R_EINVAL invalid argument
2743  * @retval      PMINFO_R_ERROR  internal error
2744  * @pre         None
2745  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2746  * @see         pkgmgrinfo_appinfo_get_pkgid()
2747  * @see         pkgmgrinfo_appinfo_is_multiple()
2748  * @code
2749 static int get_disabled_app_type(const char *appid)
2750 {
2751         int ret = 0;
2752         char *type = NULL;
2753         pkgmgrinfo_appinfo_h handle;
2754         ret = pkgmgrinfo_appinfo_get_disabled_appinfo(appid, &handle);
2755         if (ret != PMINFO_R_OK)
2756                 return -1;
2757         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2758         if (ret != PMINFO_R_OK) {
2759                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2760                 return -1;
2761         }
2762         printf("apptype: %s\n", type);
2763         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2764         return 0;
2765 }
2766  * @endcode
2767  */
2768 int pkgmgrinfo_appinfo_get_disabled_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2769 int pkgmgrinfo_appinfo_get_usr_disabled_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2770
2771 /**
2772  * @fn int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2773  * @brief       This API creates the application information handle from db
2774  *
2775  * @par         This API is for package-manager client application
2776  * @par Sync (or) Async : Synchronous API
2777  *
2778  * @param[in]   appid   pointer to appid
2779  * @param[out] handle           pointer to the application info handle.
2780  * @return      0 if success, error code(<0) if fail
2781  * @retval      PMINFO_R_OK     success
2782  * @retval      PMINFO_R_EINVAL invalid argument
2783  * @retval      PMINFO_R_ERROR  internal error
2784  * @pre         None
2785  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2786  * @see         pkgmgrinfo_appinfo_get_pkgid()
2787  * @see         pkgmgrinfo_appinfo_is_multiple()
2788  * @code
2789 static int get_app_type(const char *appid)
2790 {
2791         int ret = 0;
2792         char *type = NULL;
2793         pkgmgrinfo_appinfo_h handle;
2794         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2795         if (ret != PMINFO_R_OK)
2796                 return -1;
2797         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2798         if (ret != PMINFO_R_OK) {
2799                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2800                 return -1;
2801         }
2802         printf("apptype: %s\n", type);
2803         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2804         return 0;
2805 }
2806  * @endcode
2807  */
2808 int pkgmgrinfo_appinfo_get_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2809 int pkgmgrinfo_appinfo_get_usr_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2810
2811 /**
2812  * @fn int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle)
2813  * @brief       This API creates the application information handle from db regardless of its disable or storage status
2814  *
2815  * @par         This API is for package-manager client application
2816  * @par Sync (or) Async : Synchronous API
2817  *
2818  * @param[in]   appid   pointer to appid
2819  * @param[out] handle           pointer to the application info handle.
2820  * @return      0 if success, error code(<0) if fail
2821  * @retval      PMINFO_R_OK     success
2822  * @retval      PMINFO_R_EINVAL invalid argument
2823  * @retval      PMINFO_R_ERROR  internal error
2824  * @pre         None
2825  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2826  * @see         pkgmgrinfo_appinfo_get_pkgid()
2827  * @see         pkgmgrinfo_appinfo_is_multiple()
2828  * @code
2829 static int get_app_type(const char *appid)
2830 {
2831         int ret = 0;
2832         char *type = NULL;
2833         pkgmgrinfo_appinfo_h handle;
2834         ret = pkgmgrinfo_appinfo_get_all_appinfo(appid, &handle);
2835         if (ret != PMINFO_R_OK)
2836                 return -1;
2837         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
2838         if (ret != PMINFO_R_OK) {
2839                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2840                 return -1;
2841         }
2842         printf("apptype: %s\n", type);
2843         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2844         return 0;
2845 }
2846  * @endcode
2847  */
2848 int pkgmgrinfo_appinfo_get_all_appinfo(const char *appid, pkgmgrinfo_appinfo_h *handle);
2849 int pkgmgrinfo_appinfo_get_usr_all_appinfo(const char *appid, uid_t uid, pkgmgrinfo_appinfo_h *handle);
2850
2851 /**
2852  * @fn int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h handle, char **appid)
2853  * @brief       This API gets the application ID
2854  *
2855  * @par         This API is for package-manager client application
2856  * @par Sync (or) Async : Synchronous API
2857  *
2858  * @param[in] handle            pointer to the application info handle.
2859  * @param[out] appid            pointer to hold appid
2860  * @return      0 if success, error code(<0) if fail
2861  * @retval      PMINFO_R_OK     success
2862  * @retval      PMINFO_R_EINVAL invalid argument
2863  * @retval      PMINFO_R_ERROR  internal error
2864  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2865  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2866  * @see         pkgmgrinfo_appinfo_get_pkgid()
2867  * @see         pkgmgrinfo_appinfo_is_multiple()
2868  * @code
2869 static int get_app_id(const char *appid)
2870 {
2871         int ret = 0;
2872         char *app_id = NULL;
2873         pkgmgrinfo_appinfo_h handle;
2874         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2875         if (ret != PMINFO_R_OK)
2876                 return -1;
2877         ret = pkgmgrinfo_appinfo_get_appid(handle, &app_id);
2878         if (ret != PMINFO_R_OK) {
2879                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2880                 return -1;
2881         }
2882         printf("app id: %s\n", app_id);
2883         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2884         return 0;
2885 }
2886  * @endcode
2887  */
2888 int pkgmgrinfo_appinfo_get_appid(pkgmgrinfo_appinfo_h  handle, char **appid);
2889
2890 /**
2891  * @fn int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h handle, char **pkg_name)
2892  * @brief       This API gets the package name of the application
2893  *
2894  * @par         This API is for package-manager client application
2895  * @par Sync (or) Async : Synchronous API
2896  *
2897  * @param[in] handle            pointer to the application info handle.
2898  * @param[out] pkg_name         pointer to hold package name
2899  * @return      0 if success, error code(<0) if fail
2900  * @retval      PMINFO_R_OK     success
2901  * @retval      PMINFO_R_EINVAL invalid argument
2902  * @retval      PMINFO_R_ERROR  internal error
2903  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2904  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2905  * @see         pkgmgrinfo_appinfo_get_appid()
2906  * @see         pkgmgrinfo_appinfo_is_multiple()
2907  * @code
2908 static int get_app_pkgname(const char *appid)
2909 {
2910         int ret = 0;
2911         char *pkgname = NULL;
2912         pkgmgrinfo_appinfo_h handle;
2913         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2914         if (ret != PMINFO_R_OK)
2915                 return -1;
2916         ret = pkgmgrinfo_appinfo_get_pkgname(handle, &pkgname);
2917         if (ret != PMINFO_R_OK) {
2918                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2919                 return -1;
2920         }
2921         printf("pkg name: %s\n", pkgname);
2922         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2923         return 0;
2924 }
2925  * @endcode
2926  */
2927 int pkgmgrinfo_appinfo_get_pkgname(pkgmgrinfo_appinfo_h  handle, char **pkg_name);
2928
2929 /**
2930  * @fn int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h handle, char **pkgid)
2931  * @brief       This API gets the package id of the application
2932  *
2933  * @par         This API is for package-manager client application
2934  * @par Sync (or) Async : Synchronous API
2935  *
2936  * @param[in] handle            pointer to the application info handle.
2937  * @param[out] pkgid            pointer to hold package id
2938  * @return      0 if success, error code(<0) if fail
2939  * @retval      PMINFO_R_OK     success
2940  * @retval      PMINFO_R_EINVAL invalid argument
2941  * @retval      PMINFO_R_ERROR  internal error
2942  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2943  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2944  * @see         pkgmgrinfo_appinfo_get_appid()
2945  * @see         pkgmgrinfo_appinfo_is_multiple()
2946  * @code
2947 static int get_app_pkgid(const char *appid)
2948 {
2949         int ret = 0;
2950         char *pkgid = NULL;
2951         pkgmgrinfo_appinfo_h handle;
2952         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2953         if (ret != PMINFO_R_OK)
2954                 return -1;
2955         ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2956         if (ret != PMINFO_R_OK) {
2957                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2958                 return -1;
2959         }
2960         printf("pkg id: %s\n", pkgid);
2961         pkgmgrinfo_appinfo_destroy_appinfo(handle);
2962         return 0;
2963 }
2964  * @endcode
2965  */
2966 int pkgmgrinfo_appinfo_get_pkgid(pkgmgrinfo_appinfo_h  handle, char **pkgid);
2967
2968 /**
2969  * @fn int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h handle, char **pkgtype)
2970  * @brief       This API gets the package type of the application
2971  *
2972  * @par         This API is for package-manager client application
2973  * @par Sync (or) Async : Synchronous API
2974  *
2975  * @param[in] handle            pointer to the application info handle.
2976  * @param[out] pkgtype          pointer to hold package type
2977  * @return      0 if success, error code(<0) if fail
2978  * @retval      PMINFO_R_OK     success
2979  * @retval      PMINFO_R_EINVAL invalid argument
2980  * @retval      PMINFO_R_ERROR  internal error
2981  * @pre         pkgmgrinfo_appinfo_get_appinfo()
2982  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
2983  * @see         pkgmgrinfo_appinfo_get_appid()
2984  * @see         pkgmgrinfo_appinfo_is_multiple()
2985  * @code
2986 static int get_app_pkgtype(const char *appid)
2987 {
2988         int ret = 0;
2989         char *pkgtype = NULL;
2990         pkgmgrinfo_appinfo_h handle = NULL;
2991         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
2992         if (ret != PMINFO_R_OK)
2993                 return -1;
2994         ret = pkgmgrinfo_appinfo_get_pkgtype(handle, &pkgtype);
2995         if (ret != PMINFO_R_OK) {
2996                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2997                 return -1;
2998         }
2999         printf("pkgtype: %s\n", pkgtype);
3000         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3001         return 0;
3002 }
3003  * @endcode
3004  */
3005 int pkgmgrinfo_appinfo_get_pkgtype(pkgmgrinfo_appinfo_h  handle, char **pkgtype);
3006
3007 /**
3008  * @fn int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h handle, char **exec)
3009  * @brief       This API gets the executable name of the application
3010  *
3011  * @par         This API is for package-manager client application
3012  * @par Sync (or) Async : Synchronous API
3013  *
3014  * @param[in] handle            pointer to the application info handle.
3015  * @param[out] exec             pointer to hold app exec name
3016  * @return      0 if success, error code(<0) if fail
3017  * @retval      PMINFO_R_OK     success
3018  * @retval      PMINFO_R_EINVAL invalid argument
3019  * @retval      PMINFO_R_ERROR  internal error
3020  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3021  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3022  * @see         pkgmgrinfo_appinfo_get_appid()
3023  * @see         pkgmgrinfo_appinfo_is_multiple()
3024  * @code
3025 static int get_app_exec(const char *appid)
3026 {
3027         int ret = 0;
3028         char *exec = NULL;
3029         pkgmgrinfo_appinfo_h handle;
3030         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3031         if (ret != PMINFO_R_OK)
3032                 return -1;
3033         ret = pkgmgrinfo_appinfo_get_exec(handle, &exec);
3034         if (ret != PMINFO_R_OK) {
3035                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3036                 return -1;
3037         }
3038         printf("exec name: %s\n", exec);
3039         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3040         return 0;
3041 }
3042  * @endcode
3043  */
3044 int pkgmgrinfo_appinfo_get_exec(pkgmgrinfo_appinfo_h  handle, char **exec);
3045
3046 /**
3047  * @fn int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3048  * @brief       This API gets the icon name of the application
3049  *
3050  * @par         This API is for package-manager client application
3051  * @par Sync (or) Async : Synchronous API
3052  *
3053  * @param[in] handle            pointer to the application info handle.
3054  * @param[out] icon             pointer to hold app icon name
3055  * @return      0 if success, error code(<0) if fail
3056  * @retval      PMINFO_R_OK     success
3057  * @retval      PMINFO_R_EINVAL invalid argument
3058  * @retval      PMINFO_R_ERROR  internal error
3059  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3060  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3061  * @see         pkgmgrinfo_appinfo_get_appid()
3062  * @see         pkgmgrinfo_appinfo_is_multiple()
3063  * @code
3064 static int get_app_icon(const char *appid)
3065 {
3066         int ret = 0;
3067         char *icon = NULL;
3068         pkgmgrinfo_appinfo_h handle;
3069         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3070         if (ret != PMINFO_R_OK)
3071                 return -1;
3072         ret = pkgmgrinfo_appinfo_get_icon(handle, &icon);
3073         if (ret != PMINFO_R_OK) {
3074                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3075                 return -1;
3076         }
3077         printf("icon name: %s\n", icon);
3078         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3079         return 0;
3080 }
3081  * @endcode
3082  */
3083 int pkgmgrinfo_appinfo_get_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
3084
3085 /**
3086  * @fn int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h handle, char **label)
3087  * @brief       This API gets the label of the application
3088  *
3089  * @par         This API is for package-manager client application
3090  * @par Sync (or) Async : Synchronous API
3091  *
3092  * @param[in] handle            pointer to the application info handle.
3093  * @param[out] label            pointer to hold app label
3094  * @return      0 if success, error code(<0) if fail
3095  * @retval      PMINFO_R_OK     success
3096  * @retval      PMINFO_R_EINVAL invalid argument
3097  * @retval      PMINFO_R_ERROR  internal error
3098  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3099  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3100  * @see         pkgmgrinfo_appinfo_get_appid()
3101  * @see         pkgmgrinfo_appinfo_is_multiple()
3102  * @code
3103 static int get_app_label(const char *appid)
3104 {
3105         int ret = 0;
3106         char *label = NULL;
3107         pkgmgrinfo_appinfo_h handle;
3108         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3109         if (ret != PMINFO_R_OK)
3110                 return -1;
3111         ret = pkgmgrinfo_appinfo_get_label(handle, &label);
3112         if (ret != PMINFO_R_OK) {
3113                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3114                 return -1;
3115         }
3116         printf("label : %s\n", label);
3117         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3118         return 0;
3119 }
3120  * @endcode
3121  */
3122 int pkgmgrinfo_appinfo_get_label(pkgmgrinfo_appinfo_h  handle, char **label);
3123
3124 /**
3125  * @fn int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label)
3126  * @brief       This API gets exactly matched label by given appid and locale
3127  *
3128  * @par         This API is for package-manager client application
3129  * @par Sync (or) Async : Synchronous API
3130  *
3131  * @param[in]   appid   pointer to appid
3132  * @param[in]   locale  pointer to locale
3133  * @param[out] label            pointer to hold app label
3134  * @return      0 if success, error code(<0) if fail
3135  * @retval      PMINFO_R_OK     success
3136  * @retval      PMINFO_R_EINVAL invalid argument
3137  * @retval      PMINFO_R_ERROR  internal error
3138  * @code
3139 static int get_localed_label(const char *appid, const char *locale)
3140 {
3141         int ret = 0;
3142         char *label = NULL;
3143
3144         ret = pkgmgrinfo_appinfo_get_localed_label(appid, locale, &label);
3145         if (ret != PMINFO_R_OK)
3146                 return -1;
3147
3148         printf("localed label: %s\n", label);
3149
3150         free(label);
3151
3152         return 0;
3153 }
3154  * @endcode
3155  */
3156 int pkgmgrinfo_appinfo_get_localed_label(const char *appid, const char *locale, char **label);
3157 int pkgmgrinfo_appinfo_usr_get_localed_label(const char *appid, const char *locale, uid_t uid, char **label);
3158
3159 /**
3160  * @fn int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value)
3161  * @brief       This API gets metadata value by given metadata key
3162  *
3163  * @par         This API is for package-manager client application
3164  * @par Sync (or) Async : Synchronous API
3165  *
3166  * @param[in]   handle  pointer to the application info handle
3167  * @param[in]   metadata_key    metadata key
3168  * @param[out] metadata_value           pointer to hold metadata value
3169  * @return      0 if success, error code(<0) if fail
3170  * @retval      PMINFO_R_OK     success
3171  * @retval      PMINFO_R_EINVAL invalid argument
3172  * @code
3173 static int get_metadata_value(const char *appid, const char *metadata_key)
3174 {
3175         int ret = 0;
3176         pkgmgrinfo_appinfo_h handle = NULL;
3177         char *metadata_value = NULL;
3178
3179         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3180         if (ret != PMINFO_R_OK)
3181                 return -1;
3182
3183         ret = pkgmgrinfo_appinfo_get_metadata_value(handle, metadata_key, &metadata_value);
3184         if (ret != PMINFO_R_OK) {
3185                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3186                 return -1;
3187         }
3188
3189         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3190         return 0;
3191 }
3192  * @endcode
3193  */
3194 int pkgmgrinfo_appinfo_get_metadata_value(pkgmgrinfo_appinfo_h handle, const char *metadata_key, char **metadata_value);
3195
3196 /**
3197  * @fn int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_component *component)
3198  * @brief       This API gets the component of the application
3199  *
3200  * @par         This API is for package-manager client application
3201  * @par Sync (or) Async : Synchronous API
3202  *
3203  * @param[in] handle            pointer to the application info handle.
3204  * @param[out] component                pointer to hold app component
3205  * @return      0 if success, error code(<0) if fail
3206  * @retval      PMINFO_R_OK     success
3207  * @retval      PMINFO_R_EINVAL invalid argument
3208  * @retval      PMINFO_R_ERROR  internal error
3209  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3210  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3211  * @see         pkgmgrinfo_appinfo_get_appid()
3212  * @see         pkgmgrinfo_appinfo_is_multiple()
3213  * @code
3214 static int get_app_component(const char *appid)
3215 {
3216         int ret = 0;
3217         pkgmgrinfo_app_component component;
3218         pkgmgrinfo_appinfo_h handle;
3219         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3220         if (ret != PMINFO_R_OK)
3221                 return -1;
3222         ret = pkgmgrinfo_appinfo_get_component(handle, &component);
3223         if (ret != PMINFO_R_OK) {
3224                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3225                 return -1;
3226         }
3227         printf("component : %s\n", component);
3228         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3229         return 0;
3230 }
3231  * @endcode
3232  */
3233 int pkgmgrinfo_appinfo_get_component(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_component *component);
3234
3235 /**
3236  * @fn int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h handle, char **app_type)
3237  * @brief       This API gets the apptype of the application
3238  *
3239  * @par         This API is for package-manager client application
3240  * @par Sync (or) Async : Synchronous API
3241  *
3242  * @param[in] handle            pointer to the application info handle.
3243  * @param[out] app_type         pointer to hold apptype
3244  * @return      0 if success, error code(<0) if fail
3245  * @retval      PMINFO_R_OK     success
3246  * @retval      PMINFO_R_EINVAL invalid argument
3247  * @retval      PMINFO_R_ERROR  internal error
3248  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3249  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3250  * @see         pkgmgrinfo_appinfo_get_appid()
3251  * @see         pkgmgrinfo_appinfo_is_multiple()
3252  * @code
3253 static int get_app_type(const char *appid)
3254 {
3255         int ret = 0;
3256         char *apptype = NULL;
3257         pkgmgrinfo_appinfo_h handle;
3258         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3259         if (ret != PMINFO_R_OK)
3260                 return -1;
3261         ret = pkgmgrinfo_appinfo_get_apptype(handle, &apptype);
3262         if (ret != PMINFO_R_OK) {
3263                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3264                 return -1;
3265         }
3266         printf("apptype : %s\n", apptype);
3267         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3268         return 0;
3269 }
3270  * @endcode
3271  */
3272 int pkgmgrinfo_appinfo_get_apptype(pkgmgrinfo_appinfo_h  handle, char **app_type);
3273
3274 /**
3275  * @fn int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h handle, char **icon)
3276  * @brief       This API gets the notification icon of the application
3277  *
3278  * @par         This API is for package-manager client application
3279  * @par Sync (or) Async : Synchronous API
3280  *
3281  * @param[in] handle            pointer to the application info handle.
3282  * @param[out] path             pointer to hold notification icon
3283  * @return      0 if success, error code(<0) if fail
3284  * @retval      PMINFO_R_OK     success
3285  * @retval      PMINFO_R_EINVAL invalid argument
3286  * @retval      PMINFO_R_ERROR  internal error
3287  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3288  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3289  * @see         pkgmgrinfo_appinfo_get_appid()
3290  * @see         pkgmgrinfo_appinfo_is_multiple()
3291  * @code
3292 static int get_app_notification_icon(const char *appid)
3293 {
3294         int ret = 0;
3295         char *notification_icon = NULL;
3296         pkgmgrinfo_appinfo_h handle;
3297         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3298         if (ret != PMINFO_R_OK)
3299                 return -1;
3300         ret = pkgmgrinfo_appinfo_get_notification_icon(handle, &notification_icon);
3301         if (ret != PMINFO_R_OK) {
3302                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3303                 return -1;
3304         }
3305         printf("notification icon : %s\n", notification_icon);
3306         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3307         return 0;
3308 }
3309  * @endcode
3310  */
3311 int pkgmgrinfo_appinfo_get_notification_icon(pkgmgrinfo_appinfo_h  handle, char **icon);
3312
3313 /**
3314  * @fn int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_recentimage *type)
3315  * @brief       This API gets the type of recent image on app-tray
3316  *
3317  * @par         This API is for package-manager client application
3318  * @par Sync (or) Async : Synchronous API
3319  *
3320  * @param[in] handle            pointer to the application info handle.
3321  * @param[out] type             pointer to hold image type
3322  * @return      0 if success, error code(<0) if fail
3323  * @retval      PMINFO_R_OK     success
3324  * @retval      PMINFO_R_EINVAL invalid argument
3325  * @retval      PMINFO_R_ERROR  internal error
3326  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3327  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3328  * @see         pkgmgrinfo_appinfo_get_appid()
3329  * @see         pkgmgrinfo_appinfo_is_multiple()
3330  * @code
3331 static int get_app_recent_image_type(const char *appid)
3332 {
3333         int ret = 0;
3334         pkgmgrinfo_app_recentimage type;
3335         pkgmgrinfo_appinfo_h handle;
3336         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3337         if (ret != PMINFO_R_OK)
3338                 return -1;
3339         ret = pkgmgrinfo_appinfo_get_recent_image_type(handle, &type);
3340         if (ret != PMINFO_R_OK) {
3341                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3342                 return -1;
3343         }
3344         printf("recent image type: %d\n", type);
3345         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3346         return 0;
3347 }
3348  * @endcode
3349  */
3350 int pkgmgrinfo_appinfo_get_recent_image_type(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_recentimage *type);
3351
3352
3353 /**
3354  * @fn int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h  handle, char **preview_img)
3355  * @brief       This API gets the preview image of application
3356  *
3357  * @par Sync (or) Async : Synchronous API
3358  *
3359  * @param[in] handle            pointer to the application info handle.
3360  * @param[out] preview_img              pointer to hold preview image path
3361  * @return      0 if success, error code(<0) if fail
3362  * @retval      PMINFO_R_OK     success
3363  * @retval      PMINFO_R_EINVAL invalid argument
3364  * @retval      PMINFO_R_ERROR  internal error
3365  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3366  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3367  * @see         pkgmgrinfo_appinfo_get_appid()
3368  * @code
3369 static int get_app_previewimage(const char *appid)
3370 {
3371         int ret = 0;
3372         char *preview = NULL;
3373         pkgmgrinfo_appinfo_h handle = NULL;
3374         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3375         if (ret != PMINFO_R_OK)
3376                 return -1;
3377         ret = pkgmgrinfo_appinfo_get_preview_image(handle, &preview);
3378         if (ret != PMINFO_R_OK) {
3379                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3380                 return -1;
3381         }
3382         printf("preview image path : %s\n", preview);
3383         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3384         return 0;
3385 }
3386  * @endcode
3387  */
3388 int pkgmgrinfo_appinfo_get_preview_image(pkgmgrinfo_appinfo_h  handle, char **preview_img);
3389
3390
3391 /**
3392  * @fn int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission)
3393  * @brief       This API gets the package permission type of the application
3394  *
3395  * @par         This API is for package-manager client application
3396  * @par Sync (or) Async : Synchronous API
3397  *
3398  * @param[in] handle            pointer to the application info handle.
3399  * @param[out] permission               pointer to hold package permission
3400  * @return      0 if success, error code(<0) if fail
3401  * @retval      PMINFO_R_OK     success
3402  * @retval      PMINFO_R_EINVAL invalid argument
3403  * @retval      PMINFO_R_ERROR  internal error
3404  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3405  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3406  * @see         pkgmgrinfo_appinfo_get_appid()
3407  * @code
3408 static int get_app_permission(const char *appid)
3409 {
3410         int ret = 0;
3411         pkgmgrinfo_permission_type permission = 0;
3412         pkgmgrinfo_appinfo_h handle;
3413
3414         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3415         if (ret != PMINFO_R_OK)
3416                 return -1;
3417         ret = pkgmgrinfo_appinfo_get_permission_type(handle, &permission);
3418         if (ret != PMINFO_R_OK) {
3419                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3420                 return -1;
3421         }
3422         printf("permission type: %d\n", permission);
3423         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3424         return 0;
3425 }
3426  * @endcode
3427  */
3428 int pkgmgrinfo_appinfo_get_permission_type(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_permission_type *permission);
3429
3430 /**
3431  * @fn int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h handle, char **component_type)
3432  * @brief       This API gets the component_type
3433  *
3434  * @par         This API is for package-manager client application
3435  * @par Sync (or) Async : Synchronous API
3436  *
3437  * @param[in] handle            pointer to the application info handle.
3438  * @param[out] component_type           pointer to hold component_type
3439  * @return      0 if success, error code(<0) if fail
3440  * @retval      PMINFO_R_OK     success
3441  * @retval      PMINFO_R_EINVAL invalid argument
3442  * @retval      PMINFO_R_ERROR  internal error
3443  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3444  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3445  * @see         pkgmgrinfo_appinfo_get_pkgid()
3446  * @see         pkgmgrinfo_appinfo_is_multiple()
3447  * @code
3448 static int get_component_type(const char *appid)
3449 {
3450         int ret = 0;
3451         char *component_type = NULL;
3452         pkgmgrinfo_appinfo_h handle;
3453         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3454         if (ret != PMINFO_R_OK)
3455                 return -1;
3456         ret = pkgmgrinfo_appinfo_get_component_type(handle, &component_type);
3457         if (ret != PMINFO_R_OK) {
3458                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3459                 return -1;
3460         }
3461         printf("component_type: %s\n", component_type);
3462         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3463         return 0;
3464 }
3465  * @endcode
3466  */
3467 int pkgmgrinfo_appinfo_get_component_type(pkgmgrinfo_appinfo_h  handle, char **component_type);
3468
3469 /**
3470  * @fn int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_app_hwacceleration *hwacceleration)
3471  * @brief       This API gets the application 'hwacceleration' value from the app ID
3472  *
3473  * @par         This API is for package-manager client application
3474  * @par Sync (or) Async : Synchronous API
3475  *
3476  * @param[in]   handle  pointer to application info handle
3477  * @param[out] hwacceleration           pointer to hold package hwacceleration value
3478  * @return      0 if success, error code(<0) if fail
3479  * @retval      PMINFO_R_OK     success
3480  * @retval      PMINFO_R_EINVAL invalid argument
3481  * @retval      PMINFO_R_ERROR  internal error
3482  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3483  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3484  * @see         pkgmgrinfo_appinfo_get_appid()
3485  * @see         pkgmgrinfo_appinfo_is_multiple()
3486  * @code
3487 static int get_app_hwacceleration(const char *appid)
3488 {
3489         int ret = 0;
3490         pkgmgrinfo_app_hwacceleration hwacceleration;
3491         pkgmgrinfo_appinfo_h handle;
3492         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3493         if (ret != PMINFO_R_OK)
3494                 return -1;
3495         ret = pkgmgrinfo_appinfo_get_hwacceleration(handle, &hwacceleration);
3496         if (ret != PMINFO_R_OK) {
3497                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3498                 return -1;
3499         }
3500         printf("app hwacceleration: %d\n", hwacceleration);
3501         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3502         return 0;
3503 }
3504  * @endcode
3505  */
3506 int pkgmgrinfo_appinfo_get_hwacceleration(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_hwacceleration *hwacceleration);
3507
3508 /**
3509  * @fn int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_screenreader *screenreader)
3510  * @brief       This API gets the application 'screenreader' value from the app ID
3511  *
3512  * @par         This API is for package-manager client application
3513  * @par Sync (or) Async : Synchronous API
3514  *
3515  * @param[in]   handle  pointer to application info handle
3516  * @param[out] screenreader             pointer to hold package accessibility value
3517  * @return      0 if success, error code(<0) if fail
3518  * @retval      PMINFO_R_OK     success
3519  * @retval      PMINFO_R_EINVAL invalid argument
3520  * @retval      PMINFO_R_ERROR  internal error
3521  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3522  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3523  * @see         pkgmgrinfo_appinfo_get_appid()
3524  * @see         pkgmgrinfo_appinfo_is_multiple()
3525  * @code
3526 static int get_app_screenreader(const char *appid)
3527 {
3528         int ret = 0;
3529         pkgmgrinfo_app_screenreader screenreader = PMINFO_USE_SYSTEM_SETTING;
3530         pkgmgrinfo_appinfo_h handle = NULL;
3531         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3532         if (ret != PMINFO_R_OK)
3533                 return -1;
3534         ret = pkgmgrinfo_appinfo_get_screenreader(handle, &screenreader);
3535         if (ret != PMINFO_R_OK) {
3536                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3537                 return -1;
3538         }
3539         printf("app screenreader: %d\n", screenreader);
3540         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3541         return 0;
3542 }
3543  * @endcode
3544  */
3545 int pkgmgrinfo_appinfo_get_screenreader(pkgmgrinfo_appinfo_h  handle, pkgmgrinfo_app_screenreader *screenreader);
3546
3547 /**
3548  * @fn int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img)
3549  * @brief       This API gets the application's landscape & portrait effect images
3550  *
3551  * @par         This API is for package-manager client application
3552  * @par Sync (or) Async : Synchronous API
3553  *
3554  * @param[in]   handle  pointer to application info handle
3555  * @param[out]  portrait_img contains portrait mode effect image
3556  * @param[out]  landscape_img contains landscape mode effect image
3557  * @return      0 if success, error code(<0) if fail
3558  * @retval      PMINFO_R_OK     success
3559  * @retval      PMINFO_R_EINVAL invalid argument
3560  * @retval      PMINFO_R_ERROR  internal error
3561  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3562  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3563  * @see         pkgmgrinfo_appinfo_get_appid()
3564  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3565  * @code
3566 static int get_app_effectimages(const char *appid)
3567 {
3568         int ret = 0;
3569         char *portraitimg = NULL;
3570         char *landscapeimg = NULL;
3571         pkgmgrinfo_appinfo_h handle;
3572         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3573         if (ret != PMINFO_R_OK)
3574                 return -1;
3575         ret = pkgmgrinfo_appinfo_get_effectimage(handle, &portraitimg, &landscapeimg);
3576         if (ret != PMINFO_R_OK) {
3577                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3578                 return -1;
3579         }
3580         printf("app effect image portrait: %s, app effect image landscape : %s\n", portraitimg, landscapeimg);
3581         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3582         return 0;
3583 }
3584  * @endcode
3585  */
3586 int pkgmgrinfo_appinfo_get_effectimage(pkgmgrinfo_appinfo_h  handle, char **portrait_img, char **landscape_img);
3587
3588 /**
3589  * @fn int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h  handle, char **effectimg_type)
3590  * @brief       This API gets the application's effect image type
3591  *
3592  * @par         This API is for package-manager client application
3593  * @par Sync (or) Async : Synchronous API
3594  *
3595  * @param[in]   handle  pointer to application info handle
3596  * @param[out]  effectimg_type contains effect image type
3597  * @return      0 if success, error code(<0) if fail
3598  * @retval      PMINFO_R_OK     success
3599  * @retval      PMINFO_R_EINVAL invalid argument
3600  * @retval      PMINFO_R_ERROR  internal error
3601  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3602  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3603  * @see         pkgmgrinfo_appinfo_get_appid()
3604  * @see         pkgmgrinfo_appinfo_is_nodisplay()
3605  * @code
3606 static int get_app_effectimage_type(const char *appid)
3607 {
3608         int ret = 0;
3609         char *effectimg_type = NULL;
3610         pkgmgrinfo_appinfo_h handle = NULL;
3611         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3612         if (ret != PMINFO_R_OK)
3613                 return -1;
3614         ret = pkgmgrinfo_appinfo_get_effectimage_type(handle, &effectimg_type);
3615         if (ret != PMINFO_R_OK) {
3616                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3617                 return -1;
3618         }
3619         printf("app effect image type: %s\n", effectimg_type);
3620         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3621         return 0;
3622 }
3623  * @endcode
3624  */
3625 int pkgmgrinfo_appinfo_get_effectimage_type(pkgmgrinfo_appinfo_h handle, char **effectimg_type);
3626
3627 /**
3628  * @fn int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h handle, char **submode_mainid)
3629  * @brief       This API gets the submode_mainid of the application
3630  *
3631  * @par         This API is for package-manager client application
3632  * @par Sync (or) Async : Synchronous API
3633  *
3634  * @param[in] handle            pointer to the application info handle.
3635  * @param[out] submode_mainid           pointer to hold package name
3636  * @return      0 if success, error code(<0) if fail
3637  * @retval      PMINFO_R_OK     success
3638  * @retval      PMINFO_R_EINVAL invalid argument
3639  * @retval      PMINFO_R_ERROR  internal error
3640  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3641  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3642  * @see         pkgmgrinfo_appinfo_get_appid()
3643  * @see         pkgmgrinfo_appinfo_is_multiple()
3644  * @code
3645 static int get_app_submode_mainid(const char *appid)
3646 {
3647         int ret = 0;
3648         char *submode_mainid = NULL;
3649         pkgmgrinfo_appinfo_h handle = NULL;
3650         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3651         if (ret != PMINFO_R_OK)
3652                 return -1;
3653         ret = pkgmgrinfo_appinfo_get_submode_mainid(handle, &submode_mainid);
3654         if (ret != PMINFO_R_OK) {
3655                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3656                 return -1;
3657         }
3658         printf("submode_mainid: %s\n", submode_mainid);
3659         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3660         return 0;
3661 }
3662  * @endcode
3663  */
3664 int pkgmgrinfo_appinfo_get_submode_mainid(pkgmgrinfo_appinfo_h  handle, char **submode_mainid);
3665
3666 /**
3667  * @fn int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3668  * @brief       This API gets the datacontrol info
3669  *
3670  * @par         This API is for package-manager client application
3671  * @par Sync (or) Async : Synchronous API
3672  *
3673  * @param[in] providerid                pointer to the providerid of dataconltrol.
3674  * @param[in] type                      pointer to the type of dataconltrol.
3675  * @param[out] appid                    pointer to hold appid, need to free after using
3676  * @param[out] access                   pointer to hold access, need to free after using
3677  * @return      0 if success, error code(<0) if fail
3678  * @retval      PMINFO_R_OK     success
3679  * @retval      PMINFO_R_EINVAL invalid argument
3680  * @retval      PMINFO_R_ERROR  internal error
3681  * @endcode
3682  */
3683 int pkgmgrinfo_appinfo_get_datacontrol_info(const char *providerid, const char *type, char **appid, char **access);
3684 int pkgmgrinfo_appinfo_usr_get_datacontrol_info(const char *providerid, const char *type, uid_t uid, char **appid, char **access);
3685
3686 /**
3687  * @fn int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3688  * @brief       This API gets the appid of datacontrol
3689  *
3690  * @par         This API is for package-manager client application
3691  * @par Sync (or) Async : Synchronous API
3692  *
3693  * @param[in] providerid                pointer to the providerid of dataconltrol.
3694  * @param[out] appid                    pointer to hold appid, need to free after using
3695  * @return      0 if success, error code(<0) if fail
3696  * @retval      PMINFO_R_OK     success
3697  * @retval      PMINFO_R_EINVAL invalid argument
3698  * @retval      PMINFO_R_ERROR  internal error
3699  * @endcode
3700  */
3701 int pkgmgrinfo_appinfo_get_datacontrol_appid(const char *providerid, char **appid);
3702 int pkgmgrinfo_appinfo_usr_get_datacontrol_appid(const char *providerid, uid_t uid, char **appid);
3703
3704 /**
3705  * @fn int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid, char **appid, bool *is_trusted);
3706  * @brief       This API gets the information about trusted datacontrol
3707  *
3708  * @par         This API is for package-manager client application
3709  * @par Sync (or) Async : Synchronous API
3710  *
3711  * @param[in] providerid                pointer to the providerid of datacontrol.
3712  * @param[out] appid                    pointer to hold appid, need to free after using
3713  * @param[out] is_trusted               pointer to hold whether it provides trusted datacontrol
3714  * @return      0 if success, error code(<0) if fail
3715  * @retval      PMINFO_R_OK     success
3716  * @retval      PMINFO_R_EINVAL invalid argument
3717  * @retval      PMINFO_R_ERROR  internal error
3718  * @endcode
3719  */
3720 int pkgmgrinfo_appinfo_get_datacontrol_trusted_info(const char *providerid,
3721                 const char *type, char **appid, bool *is_trusted);
3722 int pkgmgrinfo_appinfo_usr_get_datacontrol_trusted_info(const char *providerid,
3723                 const char *type, uid_t uid, char **appid, bool *is_trusted);
3724
3725 /**
3726  * @fn int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3727                 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3728  * @brief       This API retrieves the privileges and invokes given callback for each privilege.
3729  *
3730  * @par         This API is for package-manager client application
3731  * @par Sync (or) Async : Synchronous API
3732  *
3733  * @param[in] providerid                pointer to the providerid of datacontrol.
3734  * @param[in] type                      pointer to the type of dataconltrol.
3735  * @param[in] privilege_func            callback function for list
3736  * @param[in] user_data user data to be passed to callback function
3737  * @return      0 if success, error code(<0) if fail
3738  * @retval      PMINFO_R_OK     success
3739  * @retval      PMINFO_R_EINVAL invalid argument
3740  * @retval      PMINFO_R_ERROR  internal error
3741  */
3742 int pkgmgrinfo_appinfo_foreach_datacontrol_privileges(const char *providerid, const char *type,
3743                 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data);
3744 int pkgmgrinfo_appinfo_usr_foreach_datacontrol_privileges(const char *providerid, const char *type,
3745                 pkgmgrinfo_pkg_privilege_list_cb privilege_func, void *user_data, uid_t uid);
3746
3747 /**
3748  * @fn int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h  handle, char **alias_appid)
3749  * @brief       This API gets the alias_appid of the application
3750  *
3751  * @par         This API is for package-manager client application
3752  * @par Sync (or) Async : Synchronous API
3753  *
3754  * @param[in] handle            pointer to the application info handle.
3755  * @param[out] alias_appid              pointer to hold app alias_appid
3756  * @return      0 if success, error code(<0) if fail
3757  * @retval      PMINFO_R_OK     success
3758  * @retval      PMINFO_R_EINVAL invalid argument
3759  * @retval      PMINFO_R_ERROR  internal error
3760  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3761  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3762  * @see         pkgmgrinfo_appinfo_get_appid()
3763  * @code
3764 static int get_alias_appid(const char *appid)
3765 {
3766         int ret = 0;
3767         char *alias_appid= 0;
3768         pkgmgrinfo_appinfo_h handle = NULL;
3769         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3770         if (ret != PMINFO_R_OK)
3771                 return -1;
3772         ret = pkgmgrinfo_appinfo_get_alias_appid(handle, &alias_appid);
3773         if (ret != PMINFO_R_OK) {
3774                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3775                 return -1;
3776         }
3777         printf("alias_appid: %s\n", alias_appid);
3778         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3779         return 0;
3780 }
3781  * @endcode
3782  */
3783 int pkgmgrinfo_appinfo_get_alias_appid(pkgmgrinfo_appinfo_h handle, char **alias_appid);
3784
3785 /**
3786  * @fn int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h  handle, char **effective_appid)
3787  * @brief       This API gets the effective_appid of the application
3788  *
3789  * @par         This API is for package-manager client application
3790  * @par Sync (or) Async : Synchronous API
3791  *
3792  * @param[in] handle            pointer to the application info handle.
3793  * @param[out] effective_appid          pointer to hold app effective_appid
3794  * @return      0 if success, error code(<0) if fail
3795  * @retval      PMINFO_R_OK     success
3796  * @retval      PMINFO_R_EINVAL invalid argument
3797  * @retval      PMINFO_R_ERROR  internal error
3798  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3799  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3800  * @see         pkgmgrinfo_appinfo_get_appid()
3801  * @code
3802 static int get_effective_appid(const char *appid)
3803 {
3804         int ret = 0;
3805         char *effective_appid= 0;
3806         pkgmgrinfo_appinfo_h handle = NULL;
3807         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3808         if (ret != PMINFO_R_OK)
3809                 return -1;
3810         ret = pkgmgrinfo_appinfo_get_effective_appid(handle, &effective_appid);
3811         if (ret != PMINFO_R_OK) {
3812                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3813                 return -1;
3814         }
3815         printf("effective_appid: %s\n", effective_appid);
3816         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3817         return 0;
3818 }
3819  * @endcode
3820  */
3821 int pkgmgrinfo_appinfo_get_effective_appid(pkgmgrinfo_appinfo_h handle, char **effective_appid);
3822
3823 /**
3824  * @fn int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name)
3825  * @brief       This API gets tep(tizen expansion package) file name associated with the package which contain given application
3826  *
3827  * @par This API is for package-manager client application
3828  * @par Sync (or) Async : Synchronous API
3829  *
3830  * @param[in] handle            pointer to the appinfo handle.
3831  * @param[out] tep_name         pointer to hold tep name
3832  * @return      0 if success, error code(<0) if fail
3833  * @retval      PMINFO_R_OK success
3834  * @retval      PMINFO_R_EINVAL invalid argument
3835  * @retval      PMINFO_R_ERROR  internal error
3836  * @pre pkgmgrinfo_appinfo_get_appinfo()
3837  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3838  * @see pkgmgrinfo_appinfo_get_appid()
3839  * @code
3840 static int get_tep_name(const char *appid)
3841 {
3842         int ret = 0;
3843         char *tep_name = NULL;
3844         pkgmgrinfo_appinfo_h handle = NULL;
3845         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3846         if (ret != PMINFO_R_OK)
3847                 return -1;
3848         ret = pkgmgrinfo_appinfo_get_tep_name(handle, &tep_name);
3849         if (ret != PMINFO_R_OK) {
3850                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3851                 return -1;
3852         }
3853         printf("TEP name is: %s\n", tep_name);
3854         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3855         return 0;
3856 }
3857  * @endcode
3858  */
3859 int pkgmgrinfo_appinfo_get_tep_name(pkgmgrinfo_appinfo_h handle, char **tep_name);
3860
3861 /**
3862  * @fn int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file)
3863  * @brief       This API gets zip mount file name associated with the package which contain given application
3864  *          If package is not "mount-installed", zip_mount_file is left as NULL pointer.
3865  *
3866  * @par This API is for package-manager client application
3867  * @par Sync (or) Async : Synchronous API
3868  *
3869  * @param[in] handle            pointer to the appinfo handle.
3870  * @param[out] zip_mount_file           pointer to hold zip mount file name
3871  * @return      0 if success, error code(<0) if fail
3872  * @retval      PMINFO_R_OK success
3873  * @retval      PMINFO_R_EINVAL invalid argument
3874  * @retval      PMINFO_R_ERROR  internal error
3875  * @pre pkgmgrinfo_appinfo_get_appinfo()
3876  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
3877  * @see pkgmgrinfo_appinfo_get_appid()
3878  * @code
3879 static int get_zip_mount_file(const char *appid)
3880 {
3881         int ret = 0;
3882         char *zip_mount_file = NULL;
3883         pkgmgrinfo_appinfo_h handle = NULL;
3884         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3885         if (ret != PMINFO_R_OK)
3886                 return -1;
3887         ret = pkgmgrinfo_appinfo_get_zip_mount_file(handle, &zip_mount_file);
3888         if (ret != PMINFO_R_OK) {
3889                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3890                 return -1;
3891         }
3892         printf("Mount file name is: %s\n", zip_mount_file);
3893         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3894         return 0;
3895 }
3896  * @endcode
3897  */
3898 int pkgmgrinfo_appinfo_get_zip_mount_file(pkgmgrinfo_appinfo_h handle, char **zip_mount_file);
3899
3900 /**
3901  * @fn int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **path)
3902  * @brief       This API gets the root path of application
3903  *
3904  * @par Sync (or) Async : Synchronous API
3905  *
3906  * @param[in] handle            pointer to appinfo handle
3907  * @param[out] path             pointer to hold root path of application
3908  * @return      0 if success, error code(<0) if fail
3909  * @retval      PMINFO_R_OK     success
3910  * @retval      PMINFO_R_EINVAL invalid argument
3911  * @retval      PMINFO_R_ERROR  internal error
3912  * @code
3913 static int get_root_path(const char *appid)
3914 {
3915         int ret = 0;
3916         char *path = 0;
3917         pkgmgrinfo_appinfo_h handle;
3918         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3919         if (ret != PMINFO_R_OK)
3920                 return -1;
3921
3922         ret = pkgmgrinfo_appinfo_get_root_path(handle, &path);
3923         if (ret != PMINFO_R_OK) {
3924                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3925                 return -1;
3926         }
3927         printf("path : %s\n", path);
3928         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3929
3930         return 0;
3931 }
3932  * @endcode
3933  */
3934 int pkgmgrinfo_appinfo_get_root_path(pkgmgrinfo_appinfo_h handle, char **root_path);
3935
3936 /**
3937  * @fn int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version)
3938  * @brief       This API gets the application api_version from the application ID
3939  *
3940  * @par         This API is for package-manager client application
3941  * @par Sync (or) Async : Synchronous API
3942  *
3943  * @param[in]   handle  pointer to appinfo handle
3944  * @param[out] api_version              pointer to hold application api_version
3945  * @return      0 if success, error code(<0) if fail
3946  * @retval      PMINFO_R_OK     success
3947  * @retval      PMINFO_R_EINVAL invalid argument
3948  * @retval      PMINFO_R_ERROR  internal error
3949  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3950  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3951  * @see         pkgmgrinfo_appinfo_get_appid()
3952  * @code
3953 static int get_app_api_version(const char *appid)
3954 {
3955         int ret = 0;
3956         char *api_version = NULL;
3957         pkgmgrinfo_appinfo_h handle = NULL;
3958         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3959         if (ret != PMINFO_R_OK)
3960                 return -1;
3961         ret = pkgmgrinfo_appinfo_get_api_version(handle, &api_version);
3962         if (ret != PMINFO_R_OK) {
3963                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
3964                 return -1;
3965         }
3966         printf("app api_version: %s\n", api_version);
3967         pkgmgrinfo_appinfo_destroy_appinfo(handle);
3968         return 0;
3969 }
3970  * @endcode
3971  */
3972 int pkgmgrinfo_appinfo_get_api_version(pkgmgrinfo_appinfo_h handle, char **api_version);
3973
3974 /**
3975  * @fn int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time)
3976  * @brief       This API gets the installed_time of the application
3977  *
3978  * @par         This API is for package-manager client application
3979  * @par Sync (or) Async : Synchronous API
3980  *
3981  * @param[in] handle            pointer to the application info handle.
3982  * @param[out] installed_time           pointer to hold installed_time
3983  * @return      0 if success, error code(<0) if fail
3984  * @retval      PMINFO_R_OK     success
3985  * @retval      PMINFO_R_EINVAL invalid argument
3986  * @retval      PMINFO_R_ERROR  internal error
3987  * @pre         pkgmgrinfo_appinfo_get_appinfo()
3988  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
3989  * @see         pkgmgrinfo_appinfo_get_appid()
3990  * @see         pkgmgrinfo_appinfo_is_multiple()
3991  * @code
3992 static int get_app_installed_time(const char *appid)
3993 {
3994         int ret = 0;
3995         int installed_time = 0;
3996         pkgmgrinfo_appinfo_h handle = NULL;
3997         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
3998         if (ret != PMINFO_R_OK)
3999                 return -1;
4000         ret = pkgmgrinfo_appinfo_get_installed_time(handle, &installed_time);
4001         if (ret != PMINFO_R_OK) {
4002                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4003                 return -1;
4004         }
4005         printf("installed_time: %d\n", installed_time);
4006         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4007         return 0;
4008 }
4009  * @endcode
4010  */
4011 int pkgmgrinfo_appinfo_get_installed_time(pkgmgrinfo_appinfo_h handle, int *installed_time);
4012
4013 /**
4014  * @fn int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h  handle, int *support_mode)
4015  * @brief       This API gets the support_mode of the application
4016  *
4017  * @par         This API is for package-manager client application
4018  * @par Sync (or) Async : Synchronous API
4019  *
4020  * @param[in] handle            pointer to the application info handle.
4021  * @param[out] support_mode             pointer to hold app support_mode
4022  * @return      0 if success, error code(<0) if fail
4023  * @retval      PMINFO_R_OK     success
4024  * @retval      PMINFO_R_EINVAL invalid argument
4025  * @retval      PMINFO_R_ERROR  internal error
4026  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4027  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4028  * @see         pkgmgrinfo_appinfo_get_appid()
4029  * @code
4030 static int get_app_support_mode(const char *appid)
4031 {
4032         int ret = 0;
4033         int support_mode = 0;
4034         pkgmgrinfo_appinfo_h handle = NULL;
4035         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4036         if (ret != PMINFO_R_OK)
4037                 return -1;
4038         ret = pkgmgrinfo_appinfo_get_support_mode(handle, &support_mode);
4039         if (ret != PMINFO_R_OK) {
4040                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4041                 return -1;
4042         }
4043         printf("support_mode: %s\n", support_mode);
4044         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4045         return 0;
4046 }
4047  * @endcode
4048  */
4049 int pkgmgrinfo_appinfo_get_support_mode(pkgmgrinfo_appinfo_h handle, int *support_mode);
4050
4051
4052 /**
4053  * @fn  int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4054                         pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4055  * @brief       This API gets the list of category for a particular application
4056  *
4057  * @par         This API is for package-manager client application
4058  * @par Sync (or) Async : Synchronous API
4059  * @param[in]   handle          pointer to the application info handle.
4060  * @param[in]   category_func           callback function for list
4061  * @param[in] user_data user data to be passed to callback function
4062  * @return      0 if success, error code(<0) if fail
4063  * @retval      PMINFO_R_OK     success
4064  * @retval      PMINFO_R_EINVAL invalid argument
4065  * @retval      PMINFO_R_ERROR  internal error
4066  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4067  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4068  * @code
4069 int category_func(const char *name, void *user_data)
4070 {
4071         if (strcmp(name, (char *)user_data) == 0)
4072                 return -1;
4073         else
4074                 return 0;
4075 }
4076
4077 static int list_category(const char *appid, char *category)
4078 {
4079         int ret = 0;
4080         pkgmgrinfo_appinfo_h handle;
4081         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4082         if (ret != PMINFO_R_OK)
4083                 return -1;
4084         ret = pkgmgrinfo_appinfo_foreach_category(handle, category_func, (void *)category);
4085         if (ret != PMINFO_R_OK) {
4086                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4087                 return -1;
4088         }
4089         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4090         return 0;
4091 }
4092  * @endcode
4093  */
4094 int pkgmgrinfo_appinfo_foreach_category(pkgmgrinfo_appinfo_h handle,
4095                         pkgmgrinfo_app_category_list_cb category_func, void *user_data);
4096
4097 /**
4098  * @fn  int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4099                         pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4100  * @brief       This API gets the list of metadata for a particular application
4101  *
4102  * @par         This API is for package-manager client application
4103  * @par Sync (or) Async : Synchronous API
4104  * @param[in]   handle          pointer to the application info handle.
4105  * @param[in]   metadata_func           callback function for list
4106  * @param[in] user_data user data to be passed to callback function
4107  * @return      0 if success, error code(<0) if fail
4108  * @retval      PMINFO_R_OK     success
4109  * @retval      PMINFO_R_EINVAL invalid argument
4110  * @retval      PMINFO_R_ERROR  internal error
4111  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4112  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4113  * @code
4114 int metadata_func(const char *key, const char *value, void *user_data)
4115 {
4116         if (strcmp(key, (char *)user_data) == 0) {
4117                 printf("Value is %s\n", value);
4118                 return -1;
4119         }
4120         else
4121                 return 0;
4122 }
4123
4124 static int list_metadata(const char *appid, char *key)
4125 {
4126         int ret = 0;
4127         pkgmgrinfo_appinfo_h handle;
4128         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4129         if (ret != PMINFO_R_OK)
4130                 return -1;
4131         ret = pkgmgrinfo_appinfo_foreach_metadata(handle, metadata_func, (void *)key);
4132         if (ret != PMINFO_R_OK) {
4133                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4134                 return -1;
4135         }
4136         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4137         return 0;
4138 }
4139  * @endcode
4140  */
4141 int pkgmgrinfo_appinfo_foreach_metadata(pkgmgrinfo_appinfo_h handle,
4142                         pkgmgrinfo_app_metadata_list_cb metadata_func, void *user_data);
4143
4144 /**
4145  * @fn  int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4146  *                      const char *operation,
4147  *                      pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4148  *                      void *user_data);
4149  * @brief       This API gets the list of privileges for a particular
4150  *              appllication's app_control
4151  *
4152  * @par         This API is for package-manager client application
4153  * @par Sync (or) Async : Synchronous API
4154  * @param[in]   appid           application id
4155  * @param[in]   operation       operation of appcontrol
4156  * @param[in]   privilege_func  callback function for list
4157  * @param[in]   user_data       user data to be passed to callback function
4158  * @return      0 if success, error code(<0) if fail
4159  * @retval      PMINFO_R_OK     success
4160  * @retval      PMINFO_R_EINVAL invalid argument
4161  * @retval      PMINFO_R_ERROR  internal error
4162  */
4163 int pkgmgrinfo_appinfo_usr_foreach_appcontrol_privileges(const char *appid,
4164                 const char *operation,
4165                 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4166                 void *user_data, uid_t uid);
4167 int pkgmgrinfo_appinfo_foreach_appcontrol_privileges(const char *appid,
4168                 const char *operation,
4169                 pkgmgrinfo_pkg_privilege_list_cb privilege_func,
4170                 void *user_data);
4171
4172 /**
4173  * @fn  int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4174                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4175  * @fn  int pkgmgrinfo_usr_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4176                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data, uid_t uid);
4177  * @brief       This API gets the list of app-control for a particular application
4178  *
4179  * @par         This API is for package-manager client application
4180  * @par Sync (or) Async : Synchronous API
4181  * @param[in]   handle          pointer to the application info handle.
4182  * @param[in]   appcontrol_func         callback function for list
4183  * @param[in] user_data user data to be passed to callback function
4184  * @param[in]   uid     the addressee user id of the instruction
4185  * @return      0 if success, error code(<0) if fail
4186  * @retval      PMINFO_R_OK     success
4187  * @retval      PMINFO_R_EINVAL invalid argument
4188  * @retval      PMINFO_R_ERROR  internal error
4189  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4190  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4191  * @code
4192 int appcontrol_func(const char *operation, const char *uri, const char *mime, void *user_data)
4193 {
4194         int i = 0;
4195         char **operation;
4196         char *compare_data = (char *)user_data;
4197         if (strcmp(operation, compare_data) == 0)
4198                 return -1;
4199         else
4200           return 0;
4201 }
4202
4203 static int check_operation(const char *appid, char *operation)
4204 {
4205         int ret = 0;
4206         pkgmgrinfo_appinfo_h handle;
4207         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4208         if (ret != PMINFO_R_OK)
4209                 return -1;
4210         ret = pkgmgrinfo_appinfo_foreach_appcontrol(handle, appcontrol_func, (void *)operation);
4211         if (ret != PMINFO_R_OK) {
4212                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4213                 return -1;
4214         }
4215         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4216         return 0;
4217 }
4218  * @endcode
4219  */
4220 int pkgmgrinfo_appinfo_foreach_appcontrol(pkgmgrinfo_appinfo_h handle,
4221                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4222
4223 int pkgmgrinfo_appinfo_foreach_remote_appcontrol(pkgmgrinfo_appinfo_h handle,
4224                         pkgmgrinfo_app_control_list_cb appcontrol_func, void *user_data);
4225
4226 /**
4227  * @brief
4228  */
4229 int pkgmgrinfo_appinfo_foreach_background_category(pkgmgrinfo_appinfo_h handle,
4230                 pkgmgrinfo_app_background_category_list_cb category_func, void *user_data);
4231
4232 /**
4233  * @fn  int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4234                         pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4235  * @brief       This API gets the list of splashscreen for a particular application
4236  *
4237  * @par         This API is for package-manager client application
4238  * @par Sync (or) Async : Synchronous API
4239  * @param[in]   handle          pointer to the application info handle.
4240  * @param[in]   splash_screen_func              callback function for list
4241  * @param[in]   user_data       user data to be passed to callback function
4242  * @return      0 if success, error code(<0) if fail
4243  * @retval      PMINFO_R_OK     success
4244  * @retval      PMINFO_R_EINVAL invalid argument
4245  * @retval      PMINFO_R_ERROR  internal error
4246  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4247  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4248  * @code
4249  */
4250 int pkgmgrinfo_appinfo_foreach_splash_screen(pkgmgrinfo_appinfo_h handle,
4251                 pkgmgrinfo_app_splash_screen_list_cb splash_screen_func, void *user_data);
4252
4253 /**
4254  * @fn int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h handle, bool *nodisplay)
4255  * @brief       This API gets the application 'nodisplay' value from the app ID
4256  *
4257  * @par         This API is for package-manager client application
4258  * @par Sync (or) Async : Synchronous API
4259  *
4260  * @param[in]   handle  pointer to application info handle
4261  * @param[out] nodisplay                pointer to hold package nodisplay value
4262  * @return      0 if success, error code(<0) if fail
4263  * @retval      PMINFO_R_OK     success
4264  * @retval      PMINFO_R_EINVAL invalid argument
4265  * @retval      PMINFO_R_ERROR  internal error
4266  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4267  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4268  * @see         pkgmgrinfo_appinfo_get_appid()
4269  * @see         pkgmgrinfo_appinfo_is_multiple()
4270  * @code
4271 static int get_app_nodisplay(const char *appid)
4272 {
4273         int ret = 0;
4274         bool nodisplay;
4275         pkgmgrinfo_appinfo_h handle;
4276         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4277         if (ret != PMINFO_R_OK)
4278                 return -1;
4279         ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &nodisplay);
4280         if (ret != PMINFO_R_OK) {
4281                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4282                 return -1;
4283         }
4284         printf("app nodisplay: %d\n", nodisplay);
4285         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4286         return 0;
4287 }
4288  * @endcode
4289  */
4290 int pkgmgrinfo_appinfo_is_nodisplay(pkgmgrinfo_appinfo_h  handle, bool *nodisplay);
4291
4292 /**
4293  * @fn int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h handle, bool *multiple)
4294  * @brief       This API gets the application 'multiple' value from the app ID
4295  *
4296  * @par         This API is for package-manager client application
4297  * @par Sync (or) Async : Synchronous API
4298  *
4299  * @param[in]   handle  pointer to application info handle
4300  * @param[out] multiple         pointer to hold package multiple value
4301  * @return      0 if success, error code(<0) if fail
4302  * @retval      PMINFO_R_OK     success
4303  * @retval      PMINFO_R_EINVAL invalid argument
4304  * @retval      PMINFO_R_ERROR  internal error
4305  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4306  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4307  * @see         pkgmgrinfo_appinfo_get_appid()
4308  * @see         pkgmgrinfo_appinfo_is_nodisplay()
4309  * @code
4310 static int get_app_multiple(const char *appid)
4311 {
4312         int ret = 0;
4313         bool multiple;
4314         pkgmgrinfo_appinfo_h handle;
4315         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4316         if (ret != PMINFO_R_OK)
4317                 return -1;
4318         ret = pkgmgrinfo_appinfo_is_multiple(handle, &multiple);
4319         if (ret != PMINFO_R_OK) {
4320                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4321                 return -1;
4322         }
4323         printf("app multiple: %d\n", multiple);
4324         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4325         return 0;
4326 }
4327  * @endcode
4328  */
4329 int pkgmgrinfo_appinfo_is_multiple(pkgmgrinfo_appinfo_h  handle, bool *multiple);
4330
4331 /**
4332  * @fn int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp)
4333  * @brief       This API gets the application 'indicatordisplay' value. If true, indicator will be displayed during
4334  *              application launching effect. If fales, indicator will be hidden during application launching effect
4335  *
4336  * @par         This API is for package-manager client application
4337  * @par Sync (or) Async : Synchronous API
4338  *
4339  * @param[in]   handle  pointer to application info handle
4340  * @param[out]  indicator_disp contains indicator display status for application launching effect
4341  * @return      0 if success, error code(<0) if fail
4342  * @retval      PMINFO_R_OK     success
4343  * @retval      PMINFO_R_EINVAL invalid argument
4344  * @retval      PMINFO_R_ERROR  internal error
4345  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4346  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4347  * @see         pkgmgrinfo_appinfo_get_appid()
4348  * @see         pkgmgrinfo_appinfo_is_nodisplay()
4349  * @code
4350 static int get_app_indicator_display(const char *appid)
4351 {
4352         int ret = 0;
4353         bool indicator_disp;
4354         pkgmgrinfo_appinfo_h handle;
4355         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4356         if (ret != PMINFO_R_OK)
4357                 return -1;
4358         ret = pkgmgrinfo_appinfo_is_indicator_display_allowed(handle, &indicator_disp);
4359         if (ret != PMINFO_R_OK){
4360                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4361                 return -1;
4362         }
4363         printf("app indicator disp : %d\n", indicator_disp);
4364         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4365         return 0;
4366 }
4367  * @endcode
4368  */
4369 int pkgmgrinfo_appinfo_is_indicator_display_allowed(pkgmgrinfo_appinfo_h handle, bool *indicator_disp);
4370
4371 /**
4372  * @fn int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h handle, bool *taskmanage)
4373  * @brief       This API gets the application 'taskmanage' value from the app ID
4374  *
4375  * @par         This API is for package-manager client application
4376  * @par Sync (or) Async : Synchronous API
4377  *
4378  * @param[in]   handle  pointer to application info handle
4379  * @param[out] taskmanage               pointer to hold package taskmanage value
4380  * @return      0 if success, error code(<0) if fail
4381  * @retval      PMINFO_R_OK     success
4382  * @retval      PMINFO_R_EINVAL invalid argument
4383  * @retval      PMINFO_R_ERROR  internal error
4384  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4385  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4386  * @see         pkgmgrinfo_appinfo_get_appid()
4387  * @see         pkgmgrinfo_appinfo_is_multiple()
4388  * @code
4389 static int get_app_taskmanage(const char *appid)
4390 {
4391         int ret = 0;
4392         bool taskmanage;
4393         pkgmgrinfo_appinfo_h handle;
4394         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4395         if (ret != PMINFO_R_OK)
4396                 return -1;
4397         ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &taskmanage);
4398         if (ret != PMINFO_R_OK) {
4399                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4400                 return -1;
4401         }
4402         printf("app taskmanage: %d\n", taskmanage);
4403         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4404         return 0;
4405 }
4406  * @endcode
4407  */
4408 int pkgmgrinfo_appinfo_is_taskmanage(pkgmgrinfo_appinfo_h  handle, bool *taskmanage);
4409
4410 /**
4411  * @fn int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h handle, bool *enabled)
4412  * @brief       This API gets the application 'taskmanage' value from the app ID
4413  *
4414  * @par         This API is for package-manager client application
4415  * @par Sync (or) Async : Synchronous API
4416  *
4417  * @param[in]   handle  pointer to application info handle
4418  * @param[out] enabled          pointer to hold package enabled value
4419  * @return      0 if success, error code(<0) if fail
4420  * @retval      PMINFO_R_OK     success
4421  * @retval      PMINFO_R_EINVAL invalid argument
4422  * @retval      PMINFO_R_ERROR  internal error
4423  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4424  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4425  * @see         pkgmgrinfo_appinfo_get_appid()
4426  * @see         pkgmgrinfo_appinfo_is_multiple()
4427  * @code
4428 static int get_app_enabled(const char *appid)
4429 {
4430         int ret = 0;
4431         bool enabled;
4432         pkgmgrinfo_appinfo_h handle;
4433         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4434         if (ret != PMINFO_R_OK)
4435                 return -1;
4436         ret = pkgmgrinfo_appinfo_is_taskmanage(handle, &enabled);
4437         if (ret != PMINFO_R_OK) {
4438                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4439                 return -1;
4440         }
4441         printf("app enabled: %d\n", enabled);
4442         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4443         return 0;
4444 }
4445  * @endcode
4446  */
4447 int pkgmgrinfo_appinfo_is_enabled(pkgmgrinfo_appinfo_h  handle, bool *enabled);
4448
4449 /**
4450  * @fn int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h handle, bool *onboot)
4451  * @brief       This API gets the application 'onboot' value from the app ID
4452  *
4453  * @par         This API is for package-manager client application
4454  * @par Sync (or) Async : Synchronous API
4455  *
4456  * @param[in]   handle  pointer to application info handle
4457  * @param[out] onboot           pointer to hold package onboot value
4458  * @return      0 if success, error code(<0) if fail
4459  * @retval      PMINFO_R_OK     success
4460  * @retval      PMINFO_R_EINVAL invalid argument
4461  * @retval      PMINFO_R_ERROR  internal error
4462  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4463  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4464  * @see         pkgmgrinfo_appinfo_get_appid()
4465  * @see         pkgmgrinfo_appinfo_is_multiple()
4466  * @code
4467 static int get_app_onboot(const char *appid)
4468 {
4469         int ret = 0;
4470         bool onboot;
4471         pkgmgrinfo_appinfo_h handle;
4472         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4473         if (ret != PMINFO_R_OK)
4474                 return -1;
4475         ret = pkgmgrinfo_appinfo_is_onboot(handle, &onboot);
4476         if (ret != PMINFO_R_OK) {
4477                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4478                 return -1;
4479         }
4480         printf("app onboot: %d\n", onboot);
4481         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4482         return 0;
4483 }
4484  * @endcode
4485  */
4486 int pkgmgrinfo_appinfo_is_onboot(pkgmgrinfo_appinfo_h  handle, bool *onboot);
4487
4488 /**
4489  * @fn int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h handle, bool *autorestart)
4490  * @brief       This API gets the application 'autorestart' value from the app ID
4491  *
4492  * @par         This API is for package-manager client application
4493  * @par Sync (or) Async : Synchronous API
4494  *
4495  * @param[in]   handle  pointer to application info handle
4496  * @param[out] autorestart              pointer to hold package autorestart value
4497  * @return      0 if success, error code(<0) if fail
4498  * @retval      PMINFO_R_OK     success
4499  * @retval      PMINFO_R_EINVAL invalid argument
4500  * @retval      PMINFO_R_ERROR  internal error
4501  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4502  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4503  * @see         pkgmgrinfo_appinfo_get_appid()
4504  * @see         pkgmgrinfo_appinfo_is_multiple()
4505  * @code
4506 static int get_app_autorestart(const char *appid)
4507 {
4508         int ret = 0;
4509         bool autorestart;
4510         pkgmgrinfo_appinfo_h handle;
4511         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4512         if (ret != PMINFO_R_OK)
4513                 return -1;
4514         ret = pkgmgrinfo_appinfo_is_autorestart(handle, &autorestart);
4515         if (ret != PMINFO_R_OK) {
4516                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4517                 return -1;
4518         }
4519         printf("app autorestart: %d\n", autorestart);
4520         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4521         return 0;
4522 }
4523  * @endcode
4524  */
4525 int pkgmgrinfo_appinfo_is_autorestart(pkgmgrinfo_appinfo_h  handle, bool *autorestart);
4526
4527 /**
4528  * @fn int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainapp)
4529  * @brief       This API gets the value for given application is main app or not from handle
4530  *
4531  * @par         This API is for package-manager client application
4532  * @par Sync (or) Async : Synchronous API
4533  *
4534  * @param[in]   handle  pointer to application info handle
4535  * @param[out] mainapp          pointer to hold package mainapp is or not
4536  * @return      0 if success, error code(<0) if fail
4537  * @retval      PMINFO_R_OK     success
4538  * @retval      PMINFO_R_EINVAL invalid argument
4539  * @retval      PMINFO_R_ERROR  internal error
4540  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4541  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4542  * @see         pkgmgrinfo_appinfo_get_appid()
4543  * @see         pkgmgrinfo_appinfo_is_multiple()
4544  * @code
4545 static int get_app_mainapp(const char *appid)
4546 {
4547         int ret = 0;
4548         bool mainapp;
4549         pkgmgrinfo_appinfo_h handle;
4550         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4551         if (ret != PMINFO_R_OK)
4552                 return -1;
4553         ret = pkgmgrinfo_appinfo_is_mainapp(handle, &mainapp);
4554         if (ret != PMINFO_R_OK) {
4555                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4556                 return -1;
4557         }
4558         printf("mainapp: %d\n", mainapp);
4559         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4560         return 0;
4561 }
4562  * @endcode
4563  */
4564 int pkgmgrinfo_appinfo_is_mainapp(pkgmgrinfo_appinfo_h  handle, bool *mainapp);
4565
4566
4567 /**
4568  * @fn int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload)
4569  * @brief       This API gets the value for given application is preload or not from handle
4570  *
4571  * @par         This API is for package-manager client application
4572  * @par Sync (or) Async : Synchronous API
4573  *
4574  * @param[in]   handle  pointer to application info handle
4575  * @param[out] preload          pointer to hold preload is or not
4576  * @return      0 if success, error code(<0) if fail
4577  * @retval      PMINFO_R_OK     success
4578  * @retval      PMINFO_R_EINVAL invalid argument
4579  * @retval      PMINFO_R_ERROR  internal error
4580  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4581  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4582  * @see         pkgmgrinfo_appinfo_get_appid()
4583  * @see         pkgmgrinfo_appinfo_is_multiple()
4584  * @code
4585 static int get_app_preload(const char *appid)
4586 {
4587         int ret = 0;
4588         bool preload = 0;
4589         pkgmgrinfo_appinfo_h handle = NULL;
4590         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4591         if (ret != PMINFO_R_OK)
4592                 return -1;
4593         ret = pkgmgrinfo_appinfo_is_preload(handle, &preload);
4594         if (ret != PMINFO_R_OK) {
4595                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4596                 return -1;
4597         }
4598         printf("preload: %d\n", preload);
4599         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4600         return 0;
4601 }
4602  * @endcode
4603  */
4604 int pkgmgrinfo_appinfo_is_preload(pkgmgrinfo_appinfo_h handle, bool *preload);
4605
4606 /**
4607  * @fn int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode)
4608  * @brief       This API gets the value for given application is submode or not from handle
4609  *
4610  * @par         This API is for package-manager client application
4611  * @par Sync (or) Async : Synchronous API
4612  *
4613  * @param[in]   handle  pointer to application info handle
4614  * @param[out] submode          pointer to hold submode is or not
4615  * @return      0 if success, error code(<0) if fail
4616  * @retval      PMINFO_R_OK     success
4617  * @retval      PMINFO_R_EINVAL invalid argument
4618  * @retval      PMINFO_R_ERROR  internal error
4619  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4620  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4621  * @see         pkgmgrinfo_appinfo_get_appid()
4622  * @see         pkgmgrinfo_appinfo_is_multiple()
4623  * @code
4624 static int get_app_submode(const char *appid)
4625 {
4626         int ret = 0;
4627         bool submode = 0;
4628         pkgmgrinfo_appinfo_h handle = NULL;
4629         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4630         if (ret != PMINFO_R_OK)
4631                 return -1;
4632         ret = pkgmgrinfo_appinfo_is_submode(handle, &submode);
4633         if (ret != PMINFO_R_OK) {
4634                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4635                 return -1;
4636         }
4637         printf("submode: %d\n", submode);
4638         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4639         return 0;
4640 }
4641  * @endcode
4642  */
4643 int pkgmgrinfo_appinfo_is_submode(pkgmgrinfo_appinfo_h handle, bool *submode);
4644
4645 /**
4646  * @fn int int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool)
4647  * @brief       This API gets the value for given application is process_pool or not from handle
4648  *
4649  * @par         This API is for package-manager client application
4650  * @par Sync (or) Async : Synchronous API
4651  *
4652  * @param[in]   handle  pointer to application info handle
4653  * @param[out] process_pool             pointer to hold process_pool is or not
4654  * @return      0 if success, error code(<0) if fail
4655  * @retval      PMINFO_R_OK     success
4656  * @retval      PMINFO_R_EINVAL invalid argument
4657  * @retval      PMINFO_R_ERROR  internal error
4658  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4659  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4660  * @see         pkgmgrinfo_appinfo_get_appid()
4661  * @code
4662 static int get_app_process_pool(const char *appid)
4663 {
4664         int ret = 0;
4665         bool process_pool = 0;
4666         pkgmgrinfo_appinfo_h handle = NULL;
4667         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4668         if (ret != PMINFO_R_OK)
4669                 return -1;
4670         ret = pkgmgrinfo_appinfo_is_process_pool(handle, &process_pool);
4671         if (ret != PMINFO_R_OK) {
4672                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4673                 return -1;
4674         }
4675         printf("process_pool: %d\n", process_pool);
4676         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4677         return 0;
4678 }
4679  * @endcode
4680  */
4681 int pkgmgrinfo_appinfo_is_process_pool(pkgmgrinfo_appinfo_h handle, bool *process_pool);
4682
4683 /**
4684  * @fn int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage)
4685  * @brief       This API gets the installed storage location of the application
4686  *
4687  * @par This API is for package-manager client application
4688  * @par Sync (or) Async : Synchronous API
4689  *
4690  * @param[in] handle            pointer to the application info handle.
4691  * @param[out] app_type         pointer to hold installed storage location
4692  * @return      0 if success, error code(<0) if fail
4693  * @retval      PMINFO_R_OK success
4694  * @retval      PMINFO_R_EINVAL invalid argument
4695  * @retval      PMINFO_R_ERROR  internal error
4696  * @pre pkgmgrinfo_appinfo_get_appinfo()
4697  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4698  * @see pkgmgrinfo_appinfo_get_appid()
4699  * @code
4700 static int get_app_installed_location(const char *appid)
4701 {
4702         int ret = 0;
4703         pkgmgrinfo_installed_storage storage;
4704         pkgmgrinfo_appinfo_h handle = NULL;
4705         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4706         if (ret != PMINFO_R_OK)
4707                 return -1;
4708         ret = pkgmgrinfo_appinfo_get_installed_storage_location(handle, &storage);
4709         if (ret != PMINFO_R_OK) {
4710                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4711                 return -1;
4712         }
4713         printf("Installed storage location : %d\n", storage);
4714         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4715         return 0;
4716 }
4717  * @endcode
4718  */
4719 int pkgmgrinfo_appinfo_get_installed_storage_location(pkgmgrinfo_appinfo_h handle, pkgmgrinfo_installed_storage *storage);
4720
4721
4722 /**
4723  * @fn int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist)
4724  * @brief       This API checks if the application has the given category
4725  *
4726  * @par         This API is for package-manager client application
4727  * @par Sync (or) Async : Synchronous API
4728  *
4729  * @param[in]   handle  pointer to the application info handle
4730  * @param[in]   category        category
4731  * @param[out] exist            value Gets whether the application has the given category
4732  * @return      0 if success, error code(<0) if fail
4733  * @retval      PMINFO_R_OK     success
4734  * @retval      PMINFO_R_EINVAL invalid argument
4735  * @retval      PMINFO_R_ERROR  internal error
4736  * @code
4737 static int is_category_exist(const char *appid, const char *category)
4738 {
4739         int ret = 0;
4740         pkgmgrinfo_appinfo_h handle;
4741         bool exist = false;
4742
4743         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4744         if (ret != PMINFO_R_OK)
4745                 return -1;
4746
4747         ret = pkgmgrinfo_appinfo_is_category_exist(handle, category, &exist);
4748         if (ret != PMINFO_R_OK) {
4749                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4750                 return -1;
4751         }
4752
4753         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4754         return 0;
4755 }
4756  * @endcode
4757  */
4758 int pkgmgrinfo_appinfo_is_category_exist(pkgmgrinfo_appinfo_h handle, const char *category, bool *exist);
4759
4760 /**
4761  * @fn int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget)
4762  * @brief       This API gets the application 'ui_gadget' value from the app ID
4763  *
4764  * @par         This API is for package-manager client application
4765  * @par Sync (or) Async : Synchronous API
4766  *
4767  * @param[in]   handle  pointer to application info handle
4768  * @param[out]  ui_gadget       pointer to hold package ui_gadget value
4769  * @return      0 if success, error code(<0) if fail
4770  * @retval      PMINFO_R_OK     success
4771  * @retval      PMINFO_R_EINVAL invalid argument
4772  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4773  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4774  * @code
4775 static int get_app_ui_gadget(const char *appid)
4776 {
4777         int ret = 0;
4778         bool ui_gadget;
4779         pkgmgrinfo_appinfo_h handle = NULL;
4780         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4781         if (ret != PMINFO_R_OK)
4782                 return -1;
4783         ret = pkgmgrinfo_appinfo_is_ui_gadget(handle, &ui_gadget);
4784         if (ret != PMINFO_R_OK) {
4785                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4786                 return -1;
4787         }
4788         printf("app ui_gadget: %d\n", ui_gadget);
4789         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4790         return 0;
4791 }
4792  * @endcode
4793  */
4794 int pkgmgrinfo_appinfo_is_ui_gadget(pkgmgrinfo_appinfo_h handle, bool *ui_gadget);
4795
4796 /**
4797  * @fn int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable)
4798  * @brief       This API gets the application 'support_disable' value from the app ID
4799  *
4800  * @par         This API is for package-manager client application
4801  * @par Sync (or) Async : Synchronous API
4802  *
4803  * @param[in]   handle  pointer to application info handle
4804  * @param[out]  support_disable pointer to hold package support_disable value
4805  * @return      0 if success, error code(<0) if fail
4806  * @retval      PMINFO_R_OK     success
4807  * @retval      PMINFO_R_EINVAL invalid argument
4808  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4809  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4810  * @code
4811 static int get_app_support_disable(const char *appid)
4812 {
4813         int ret = 0;
4814         bool support_disable;
4815         pkgmgrinfo_appinfo_h handle = NULL;
4816         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4817         if (ret != PMINFO_R_OK)
4818                 return -1;
4819         ret = pkgmgrinfo_appinfo_is_support_disable(handle, &support_disable);
4820         if (ret != PMINFO_R_OK) {
4821                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4822                 return -1;
4823         }
4824         printf("app support_disable: %d\n", support_disable);
4825         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4826         return 0;
4827 }
4828  * @endcode
4829  */
4830 int pkgmgrinfo_appinfo_is_support_disable(pkgmgrinfo_appinfo_h handle, bool *support_disable);
4831
4832 /**
4833  * @fn int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable)
4834  * @brief       This API gets the application 'removable' value from the app ID
4835  *
4836  * @par         This API is for package-manager client application
4837  * @par Sync (or) Async : Synchronous API
4838  *
4839  * @param[in]   handle  pointer to application info handle
4840  * @param[out]  removable       pointer to hold package removable value
4841  * @return      0 if success, error code(<0) if fail
4842  * @retval      PMINFO_R_OK     success
4843  * @retval      PMINFO_R_EINVAL invalid argument
4844  * @retval      PMINFO_R_ERROR  internal error
4845  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4846  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4847  * @see         pkgmgrinfo_appinfo_get_appid()
4848  * @code
4849 static int get_app_removable(const char *appid)
4850 {
4851         int ret = 0;
4852         bool removable;
4853         pkgmgrinfo_appinfo_h handle = NULL;
4854         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4855         if (ret != PMINFO_R_OK)
4856                 return -1;
4857         ret = pkgmgrinfo_appinfo_is_removable(handle, &removable);
4858         if (ret != PMINFO_R_OK) {
4859                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4860                 return -1;
4861         }
4862         printf("app removable: %d\n", removable);
4863         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4864         return 0;
4865 }
4866  * @endcode
4867  */
4868 int pkgmgrinfo_appinfo_is_removable(pkgmgrinfo_appinfo_h handle, bool *removable);
4869
4870 /**
4871  * @fn int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system)
4872  * @brief       This API gets the application 'system' value from the app ID
4873  *
4874  * @par         This API is for package-manager client application
4875  * @par Sync (or) Async : Synchronous API
4876  *
4877  * @param[in]   handle  pointer to application info handle
4878  * @param[out]  system  pointer to hold package system value
4879  * @return      0 if success, error code(<0) if fail
4880  * @retval      PMINFO_R_OK     success
4881  * @retval      PMINFO_R_EINVAL invalid argument
4882  * @retval      PMINFO_R_ERROR  internal error
4883  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4884  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4885  * @see         pkgmgrinfo_appinfo_get_appid()
4886  * @code
4887 static int get_app_system(const char *appid)
4888 {
4889         int ret = 0;
4890         bool system = false;
4891         pkgmgrinfo_appinfo_h handle = NULL;
4892         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4893         if (ret != PMINFO_R_OK)
4894                 return -1;
4895         ret = pkgmgrinfo_appinfo_is_system(handle, &system);
4896         if (ret != PMINFO_R_OK) {
4897                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4898                 return -1;
4899         }
4900         printf("app system: %d\n", system);
4901         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4902         return 0;
4903 }
4904  * @endcode
4905  */
4906 int pkgmgrinfo_appinfo_is_system(pkgmgrinfo_appinfo_h handle, bool *system);
4907
4908
4909 /**
4910  * @fn int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled)
4911  * @brief       This API gets the application 'is_disable' value from the app ID
4912  *
4913  * @par         This API is for package-manager client application
4914  * @par Sync (or) Async : Synchronous API
4915  *
4916  * @param[in]   handle  pointer to application info handle
4917  * @param[out]  disabled        pointer to hold application is_disabled value
4918  * @return      0 if success, error code(<0) if fail
4919  * @retval      PMINFO_R_OK     success
4920  * @retval      PMINFO_R_EINVAL invalid argument
4921  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4922  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
4923  * @code
4924 static int get_app_is_disable(const char *appid)
4925 {
4926         int ret = 0;
4927         bool is_disable;
4928         pkgmgrinfo_appinfo_h handle = NULL;
4929         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4930         if (ret != PMINFO_R_OK)
4931                 return -1;
4932         ret = pkgmgrinfo_appinfo_is_disabled(handle, &is_disable);
4933         if (ret != PMINFO_R_OK) {
4934                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
4935                 return -1;
4936         }
4937         printf("app is_disable: %d\n", is_disable);
4938         pkgmgrinfo_appinfo_destroy_appinfo(handle);
4939         return 0;
4940 }
4941  * @endcode
4942  */
4943 int pkgmgrinfo_appinfo_is_disabled(pkgmgrinfo_appinfo_h handle, bool *disabled);
4944
4945 /**
4946  * @fn int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global)
4947  * @brief       This API gets whether the given application is global application or user application
4948  *
4949  * @par         This API is for package-manager client application
4950  * @par Sync (or) Async : Synchronous API
4951  *
4952  * @param[in]   handle  pointer to application info handle
4953  * @param[in]   global  pointer to hold application global value
4954  * @return      0 if success, error code(<0) if fail
4955  * @retval      PMINFO_R_OK     success
4956  * @retval      PMINFO_R_EINVAL invalid argument
4957  * @retval      PMINFO_R_ERROR  internal error
4958  * @pre         pkgmgrinfo_appinfo_get_appinfo()
4959  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
4960  * @see         pkgmgrinfo_appinfo_get_appid()
4961  static int get_app_is_global(const char *appid)
4962  {
4963          int ret = 0;
4964          bool global;
4965          pkgmgrinfo_appinfo_h handle = NULL;
4966          ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
4967          if (ret != PMINFO_R_OK)
4968                  return -1;
4969          ret = pkgmgrinfo_appinfo_is_global(handle, &global);
4970          if (ret != PMINFO_R_OK) {
4971                  pkgmgrinfo_appinfo_destroy_appinfo(handle);
4972                  return -1;
4973          }
4974          printf("app is_global: %d\n", global);
4975          pkgmgrinfo_appinfo_destroy_appinfo(handle);
4976          return 0;
4977  }
4978   * @endcode
4979   */
4980 int pkgmgrinfo_appinfo_is_global(pkgmgrinfo_appinfo_h handle, bool *global);
4981
4982 /**
4983  * @fn int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display)
4984  * @brief       This API gets the application 'splash_screen_display' value from the app ID
4985  *
4986  * @par         This API is for package-manager client application
4987  * @par Sync (or) Async : Synchronous API
4988  *
4989  * @param[in]   handle          pointer to application info handle
4990  * @param[out]  splash_screen_display   pointer to hold package splash_screen_display value
4991  * @return      0 if success, error code(<0) if fail
4992  * @retval      PMINFO_R_OK     success
4993  * @retval      PMINFO_R_EINVAL invalid argument
4994  * @retval      PMINFO_R_ERROR  internal error
4995  */
4996 int pkgmgrinfo_appinfo_get_splash_screen_display(pkgmgrinfo_appinfo_h handle, bool *splash_screen_display);
4997
4998 /**
4999  * @fn int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid)
5000  * @brief       This API gets the application 'setup_appid' value from the app ID
5001  *
5002  * @par         This API is for package-manager client application
5003  * @par Sync (or) Async : Synchronous API
5004  *
5005  * @param[in]   handle          pointer to application info handle
5006  * @param[out]  setup_appid     pointer to hold package setup_appid value
5007  * @return      0 if success, error code(<0) if fail
5008  * @retval      PMINFO_R_OK     success
5009  * @retval      PMINFO_R_EINVAL invalid argument
5010  * @retval      PMINFO_R_ERROR  internal error
5011  */
5012 int pkgmgrinfo_appinfo_get_setup_appid(pkgmgrinfo_appinfo_h handle, char **setup_appid);
5013
5014 /**
5015  * @fn int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient)
5016  * @brief       This API gets the application 'support_ambient' value from the app ID
5017  *
5018  * @par         This API is for package-manager client application
5019  * @par Sync (or) Async : Synchronous API
5020  *
5021  * @param[in]   handle          pointer to application info handle
5022  * @param[out]  support_ambient pointer to hold package support_ambient value
5023  * @return      0 if success, error code(<0) if fail
5024  * @retval      PMINFO_R_OK     success
5025  * @retval      PMINFO_R_EINVAL invalid argument
5026  * @retval      PMINFO_R_ERROR  internal error
5027  */
5028 int pkgmgrinfo_appinfo_is_support_ambient(pkgmgrinfo_appinfo_h handle, bool *support_ambient);
5029
5030 /**
5031  * @fn int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h handle)
5032  * @brief       This API destroys the application information handle freeing up all the resources
5033  *
5034  * @par         This API is for package-manager client application
5035  * @par Sync (or) Async : Synchronous API
5036  *
5037  * @param[in] handle            pointer to the application info handle.
5038  * @return      0 if success, error code(<0) if fail
5039  * @retval      PMINFO_R_OK     success
5040  * @retval      PMINFO_R_EINVAL invalid argument
5041  * @retval      PMINFO_R_ERROR  internal error
5042  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5043  * @post                None
5044  * @see         pkgmgrinfo_appinfo_get_pkgid()
5045  * @see         pkgmgrinfo_appinfo_is_multiple()
5046  * @code
5047 static int get_app_type(const char *appid)
5048 {
5049         int ret = 0;
5050         char *type = NULL;
5051         pkgmgrinfo_appinfo_h handle;
5052         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
5053         if (ret != PMINFO_R_OK)
5054                 return -1;
5055         ret = pkgmgrinfo_appinfo_get_apptype(handle, &type);
5056         if (ret != PMINFO_R_OK) {
5057                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
5058                 return -1;
5059         }
5060         printf("apptype: %s\n", type);
5061         pkgmgrinfo_appinfo_destroy_appinfo(handle);
5062         return 0;
5063 }
5064  * @endcode
5065  */
5066 int pkgmgrinfo_appinfo_destroy_appinfo(pkgmgrinfo_appinfo_h  handle);
5067
5068 /**
5069  * @fn int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle)
5070  * @brief       This API creates the application information filter handle from db.  All filter properties will be ANDed.
5071  The query will search the entire application information collected from the manifest file of all the installed packages
5072  *
5073  * @par         This API is for package-manager client application
5074  * @par Sync (or) Async : Synchronous API
5075  *
5076  * @param[out] handle           pointer to the application info filter handle.
5077  * @return      0 if success, error code(<0) if fail
5078  * @retval      PMINFO_R_OK     success
5079  * @retval      PMINFO_R_EINVAL invalid argument
5080  * @retval      PMINFO_R_ERROR  internal error
5081  * @pre         None
5082  * @post                pkgmgrinfo_appinfo_filter_destroy()
5083  * @see         pkgmgrinfo_appinfo_filter_count()
5084  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5085  * @code
5086 static int get_capp_count()
5087 {
5088         int ret = 0;
5089         int count = 0;
5090         pkgmgrinfo_appinfo_filter_h handle;
5091         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5092         if (ret != PMINFO_R_OK)
5093                 return -1;
5094         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5095         if (ret != PMINFO_R_OK) {
5096                 pkgmgrinfo_appinfo_filter_destroy(handle);
5097                 return -1;
5098         }
5099         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5100         if (ret != PMINFO_R_OK) {
5101                 pkgmgrinfo_appinfo_filter_destroy(handle);
5102                 return -1;
5103         }
5104         printf("No of capp: %d\n", count);
5105         pkgmgrinfo_appinfo_filter_destroy(handle);
5106         return 0;
5107 }
5108  * @endcode
5109  */
5110 int pkgmgrinfo_appinfo_filter_create(pkgmgrinfo_appinfo_filter_h *handle);
5111
5112 /**
5113  * @fn int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle)
5114  * @brief       This API destroys the application information filter handle freeing up all the resources
5115  *
5116  * @par         This API is for package-manager client application
5117  * @par Sync (or) Async : Synchronous API
5118  *
5119  * @param[in] handle            pointer to the application info filter handle.
5120  * @return      0 if success, error code(<0) if fail
5121  * @retval      PMINFO_R_OK     success
5122  * @retval      PMINFO_R_EINVAL invalid argument
5123  * @retval      PMINFO_R_ERROR  internal error
5124  * @pre         pkgmgrinfo_appinfo_filter_create()
5125  * @post                None
5126  * @see         pkgmgrinfo_appinfo_filter_count()
5127  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5128  * @code
5129 static int get_capp_count()
5130 {
5131         int ret = 0;
5132         int count = 0;
5133         pkgmgrinfo_appinfo_filter_h handle;
5134         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5135         if (ret != PMINFO_R_OK)
5136                 return -1;
5137         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5138         if (ret != PMINFO_R_OK) {
5139                 pkgmgrinfo_appinfo_filter_destroy(handle);
5140                 return -1;
5141         }
5142         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5143         if (ret != PMINFO_R_OK) {
5144                 pkgmgrinfo_appinfo_filter_destroy(handle);
5145                 return -1;
5146         }
5147         printf("No of capp: %d\n", count);
5148         pkgmgrinfo_appinfo_filter_destroy(handle);
5149         return 0;
5150 }
5151  * @endcode
5152  */
5153 int pkgmgrinfo_appinfo_filter_destroy(pkgmgrinfo_appinfo_filter_h handle);
5154
5155 /**
5156  * @fn int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle, const char *property, const bool value)
5157  * @brief       This API adds a boolean filter property to the filter handle
5158  *
5159  * @par         This API is for package-manager client application
5160  * @par Sync (or) Async : Synchronous API
5161  *
5162  * @param[in] handle            pointer to the application info filter handle.
5163  * @param[in] property          boolean property name.
5164  * @param[in] value             value corresponding to the property.
5165  * @return      0 if success, error code(<0) if fail
5166  * @retval      PMINFO_R_OK     success
5167  * @retval      PMINFO_R_EINVAL invalid argument
5168  * @retval      PMINFO_R_ERROR  internal error
5169  * @pre         pkgmgrinfo_appinfo_filter_create()
5170  * @post                pkgmgrinfo_appinfo_filter_destroy()
5171  * @see         pkgmgrinfo_appinfo_filter_count()
5172  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5173  * @code
5174 static int get_taskmanageable_app_count()
5175 {
5176         int ret = 0;
5177         int count = 0;
5178         pkgmgrinfo_appinfo_filter_h handle;
5179         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5180         if (ret != PMINFO_R_OK)
5181                 return -1;
5182         ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_TASKMANAGE, 1);
5183         if (ret != PMINFO_R_OK) {
5184                 pkgmgrinfo_appinfo_filter_destroy(handle);
5185                 return -1;
5186         }
5187         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5188         if (ret != PMINFO_R_OK) {
5189                 pkgmgrinfo_appinfo_filter_destroy(handle);
5190                 return -1;
5191         }
5192         printf("No of taskmanageable apps: %d\n", count);
5193         pkgmgrinfo_appinfo_filter_destroy(handle);
5194         return 0;
5195 }
5196  * @endcode
5197  */
5198 int pkgmgrinfo_appinfo_filter_add_bool(pkgmgrinfo_appinfo_filter_h handle,
5199                 const char *property, const bool value);
5200
5201 /**
5202  * @fn int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle, const char *property, const int value)
5203  * @brief       This API adds an integer filter property to the filter handle
5204  *
5205  * @par         This API is for package-manager client application
5206  * @par Sync (or) Async : Synchronous API
5207  *
5208  * @param[in] handle            pointer to the application info filter handle.
5209  * @param[in] property          integer property name.
5210  * @param[in] value             value corresponding to the property.
5211  * @return      0 if success, error code(<0) if fail
5212  * @retval      PMINFO_R_OK     success
5213  * @retval      PMINFO_R_EINVAL invalid argument
5214  * @retval      PMINFO_R_ERROR  internal error
5215  * @pre         pkgmgrinfo_appinfo_filter_create()
5216  * @post                pkgmgrinfo_appinfo_filter_destroy()
5217  * @see         pkgmgrinfo_appinfo_filter_count()
5218  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5219  * @code
5220 static int get_taskmanageable_app_count()
5221 {
5222         int ret = 0;
5223         int count = 0;
5224         pkgmgrinfo_appinfo_filter_h handle;
5225         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5226         if (ret != PMINFO_R_OK)
5227                 return -1;
5228         ret = pkgmgrinfo_appinfo_filter_add_bool(handle, PMINFO_APPINFO_PROP_APP_XXX, 10);
5229         if (ret != PMINFO_R_OK) {
5230                 pkgmgrinfo_appinfo_filter_destroy(handle);
5231                 return -1;
5232         }
5233         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5234         if (ret != PMINFO_R_OK) {
5235                 pkgmgrinfo_appinfo_filter_destroy(handle);
5236                 return -1;
5237         }
5238         printf("No of apps: %d\n", count);
5239         pkgmgrinfo_appinfo_filter_destroy(handle);
5240         return 0;
5241 }
5242  * @endcode
5243  */
5244 int pkgmgrinfo_appinfo_filter_add_int(pkgmgrinfo_appinfo_filter_h handle,
5245                 const char *property, const int value);
5246
5247 /**
5248  * @fn int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle, const char *property, const char *value)
5249  * @brief       This API adds a string filter property to the filter handle
5250  *
5251  * @par         This API is for package-manager client application
5252  * @par Sync (or) Async : Synchronous API
5253  *
5254  * @param[in] handle            pointer to the application info filter handle.
5255  * @param[in] property          string property name.
5256  * @param[in] value             value corresponding to the property.
5257  * @return      0 if success, error code(<0) if fail
5258  * @retval      PMINFO_R_OK     success
5259  * @retval      PMINFO_R_EINVAL invalid argument
5260  * @retval      PMINFO_R_ERROR  internal error
5261  * @pre         pkgmgrinfo_appinfo_filter_create()
5262  * @post                pkgmgrinfo_appinfo_filter_destroy()
5263  * @see         pkgmgrinfo_appinfo_filter_count()
5264  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5265  * @code
5266 static int get_capp_count()
5267 {
5268         int ret = 0;
5269         int count = 0;
5270         pkgmgrinfo_appinfo_filter_h handle;
5271         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5272         if (ret != PMINFO_R_OK)
5273                 return -1;
5274         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5275         if (ret != PMINFO_R_OK) {
5276                 pkgmgrinfo_appinfo_filter_destroy(handle);
5277                 return -1;
5278         }
5279         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5280         if (ret != PMINFO_R_OK) {
5281                 pkgmgrinfo_appinfo_filter_destroy(handle);
5282                 return -1;
5283         }
5284         printf("No of capp: %d\n", count);
5285         pkgmgrinfo_appinfo_filter_destroy(handle);
5286         return 0;
5287 }
5288  * @endcode
5289  */
5290 int pkgmgrinfo_appinfo_filter_add_string(pkgmgrinfo_appinfo_filter_h handle,
5291                 const char *property, const char *value);
5292
5293 /**
5294  * @fn int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5295  * @brief       This API executes the user supplied callback function for each application that satisfy the filter conditions
5296  *
5297  * @par         This API is for package-manager client application
5298  * @par Sync (or) Async : Synchronous API
5299  *
5300  * @param[in] handle            pointer to the application info filter handle.
5301  * @param[in] app_cb            callback function.
5302  * @param[in] user_data         user data to be passed to the callback function
5303  * @return      0 if success, error code(<0) if fail
5304  * @retval      PMINFO_R_OK     success
5305  * @retval      PMINFO_R_EINVAL invalid argument
5306  * @retval      PMINFO_R_ERROR  internal error
5307  * @pre         pkgmgrinfo_appinfo_filter_create()
5308  * @post                pkgmgrinfo_appinfo_filter_destroy()
5309  * @see         pkgmgrinfo_appinfo_filter_count()
5310  * @code
5311 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5312 {
5313         char *appid = NULL;
5314         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5315         printf("appid : %s\n", appid);
5316         return 0;
5317 }
5318
5319 static int get_capp_list()
5320 {
5321         int ret = 0;
5322         pkgmgrinfo_appinfo_filter_h handle;
5323         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5324         if (ret != PMINFO_R_OK)
5325                 return -1;
5326         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5327         if (ret != PMINFO_R_OK) {
5328                 pkgmgrinfo_appinfo_filter_destroy(handle);
5329                 return -1;
5330         }
5331         ret = pkgmgrinfo_appinfo_filter_foreach_appinfo(handle, app_list_cb, NULL);
5332         if (ret != PMINFO_R_OK) {
5333                 pkgmgrinfo_appinfo_filter_destroy(handle);
5334                 return -1;
5335         }
5336         pkgmgrinfo_appinfo_filter_destroy(handle);
5337         return 0;
5338 }
5339  * @endcode
5340  */
5341 int pkgmgrinfo_appinfo_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5342                 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5343 int pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(pkgmgrinfo_appinfo_filter_h handle,
5344                 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5345
5346 /**
5347  * @fn int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count)
5348  * @fn int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid)
5349  * @brief       This API counts the application that satisfy the filter conditions
5350  *
5351  * @par         This API is for package-manager client application
5352  * @par Sync (or) Async : Synchronous API
5353  *
5354  * @param[in] handle            pointer to the application info filter handle.
5355  * @param[in] count             pointer to store count value
5356  * @param[in]   uid     the addressee user id of the instruction
5357  * @return      0 if success, error code(<0) if fail
5358  * @retval      PMINFO_R_OK     success
5359  * @retval      PMINFO_R_EINVAL invalid argument
5360  * @retval      PMINFO_R_ERROR  internal error
5361  * @pre         pkgmgrinfo_appinfo_filter_create()
5362  * @post                pkgmgrinfo_appinfo_filter_destroy()
5363  * @see         pkgmgrinfo_appinfo_filter_foreach_appinfo()
5364  * @code
5365 static int get_capp_count()
5366 {
5367         int ret = 0;
5368         int count = 0;
5369         pkgmgrinfo_appinfo_filter_h handle;
5370         ret = pkgmgrinfo_appinfo_filter_create(&handle);
5371         if (ret != PMINFO_R_OK)
5372                 return -1;
5373         ret = pkgmgrinfo_appinfo_filter_add_string(handle, PMINFO_APPINFO_PROP_APP_TYPE, "capp");
5374         if (ret != PMINFO_R_OK) {
5375                 pkgmgrinfo_appinfo_filter_destroy(handle);
5376                 return -1;
5377         }
5378         ret = pkgmgrinfo_appinfo_filter_count(handle, &count);
5379         if (ret != PMINFO_R_OK) {
5380                 pkgmgrinfo_appinfo_filter_destroy(handle);
5381                 return -1;
5382         }
5383         printf("No of capp: %d\n", count);
5384         pkgmgrinfo_appinfo_filter_destroy(handle);
5385         return 0;
5386 }
5387  * @endcode
5388  */
5389 int pkgmgrinfo_appinfo_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count);
5390 int pkgmgrinfo_appinfo_usr_filter_count(pkgmgrinfo_appinfo_filter_h handle, int *count, uid_t uid);
5391 /**
5392  * @fn int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle)
5393  * @brief       This API creates the application's metadata  information filter handle from db.
5394  *
5395  * @par         This API is for package-manager client application
5396  * @par Sync (or) Async : Synchronous API
5397  *
5398  * @param[out] handle           pointer to the application metadata info filter handle.
5399  * @return      0 if success, error code(<0) if fail
5400  * @retval      PMINFO_R_OK     success
5401  * @retval      PMINFO_R_EINVAL invalid argument
5402  * @retval      PMINFO_R_ERROR  internal error
5403  * @pre         None
5404  * @post                pkgmgrinfo_appinfo_metadata_filter_destroy()
5405  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
5406  * @code
5407 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5408 {
5409         char *appid = NULL;
5410         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5411         printf("appid : %s\n", appid);
5412         return 0;
5413 }
5414
5415 static int get_app_list(const char *mkey, const char *mvalue)
5416 {
5417         int ret = 0;
5418         pkgmgrinfo_appinfo_metadata_filter_h handle;
5419         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5420         if (ret != PMINFO_R_OK)
5421                 return -1;
5422         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5423         if (ret != PMINFO_R_OK) {
5424                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5425                 return -1;
5426         }
5427         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5428         if (ret != PMINFO_R_OK) {
5429                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5430                 return -1;
5431         }
5432         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5433         return 0;
5434 }
5435  * @endcode
5436  */
5437 int pkgmgrinfo_appinfo_metadata_filter_create(pkgmgrinfo_appinfo_metadata_filter_h *handle);
5438
5439 /**
5440  * @fn int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle)
5441  * @brief       This API destroys the application's metadata  information filter handle.
5442  *
5443  * @par         This API is for package-manager client application
5444  * @par Sync (or) Async : Synchronous API
5445  *
5446  * @param[in] handle            pointer to the application metadata info filter handle.
5447  * @return      0 if success, error code(<0) if fail
5448  * @retval      PMINFO_R_OK     success
5449  * @retval      PMINFO_R_EINVAL invalid argument
5450  * @retval      PMINFO_R_ERROR  internal error
5451  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
5452  * @post                None
5453  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
5454  * @code
5455 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5456 {
5457         char *appid = NULL;
5458         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5459         printf("appid : %s\n", appid);
5460         return 0;
5461 }
5462
5463 static int get_app_list(const char *mkey, const char *mvalue)
5464 {
5465         int ret = 0;
5466         pkgmgrinfo_appinfo_metadata_filter_h handle;
5467         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5468         if (ret != PMINFO_R_OK)
5469                 return -1;
5470         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5471         if (ret != PMINFO_R_OK) {
5472                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5473                 return -1;
5474         }
5475         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5476         if (ret != PMINFO_R_OK) {
5477                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5478                 return -1;
5479         }
5480         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5481         return 0;
5482 }
5483  * @endcode
5484  */
5485 int pkgmgrinfo_appinfo_metadata_filter_destroy(pkgmgrinfo_appinfo_metadata_filter_h handle);
5486
5487 /**
5488  * @fn int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle, const char *key, const char *value)
5489  * @brief       This API adds filter condition for the query API.  The query will search the entire application metadata  information collected from
5490  * the manifest file of all the installed packages. You can specify value as NULL to search based on key only.
5491  *
5492  * @par         This API is for package-manager client application
5493  * @par Sync (or) Async : Synchronous API
5494  *
5495  * @param[in] handle            pointer to the application metadata info filter handle.
5496  * @param[in] key                       pointer to metadata key
5497  * @param[in] value                     pointer to metadata value
5498  * @return      0 if success, error code(<0) if fail
5499  * @retval      PMINFO_R_OK     success
5500  * @retval      PMINFO_R_EINVAL invalid argument
5501  * @retval      PMINFO_R_ERROR  internal error
5502  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
5503  * @post                pkgmgrinfo_appinfo_metadata_filter_foreach(), pkgmgrinfo_appinfo_metadata_filter_destroy()
5504  * @see         pkgmgrinfo_appinfo_metadata_filter_foreach()
5505  * @code
5506 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5507 {
5508         char *appid = NULL;
5509         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5510         printf("appid : %s\n", appid);
5511         return 0;
5512 }
5513
5514 static int get_app_list(const char *mkey, const char *mvalue)
5515 {
5516         int ret = 0;
5517         pkgmgrinfo_appinfo_metadata_filter_h handle;
5518         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5519         if (ret != PMINFO_R_OK)
5520                 return -1;
5521         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5522         if (ret != PMINFO_R_OK) {
5523                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5524                 return -1;
5525         }
5526         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5527         if (ret != PMINFO_R_OK) {
5528                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5529                 return -1;
5530         }
5531         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5532         return 0;
5533 }
5534  * @endcode
5535  */
5536 int pkgmgrinfo_appinfo_metadata_filter_add(pkgmgrinfo_appinfo_metadata_filter_h handle,
5537                 const char *key, const char *value);
5538
5539 /**
5540  * @fn int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data)
5541  * @fn int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle, pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid)
5542  * @brief       This API executes the filter query. The query will search the entire application metadata  information collected from
5543  * the manifest file of all the installed packages. For each application returned by the query, the callback will be called. If callback returns
5544  * negative value, no more callbacks will be called and API will return.
5545  *
5546  * @par         This API is for package-manager client application
5547  * @par Sync (or) Async : Synchronous API
5548  *
5549  * @param[in] handle            pointer to the application metadata info filter handle.
5550  * @param[in] app_cb            function pointer to callback
5551  * @param[in] user_data         pointer to user data
5552  * @param[in]   uid     the addressee user id of the instruction
5553  * @return      0 if success, error code(<0) if fail
5554  * @retval      PMINFO_R_OK     success
5555  * @retval      PMINFO_R_EINVAL invalid argument
5556  * @retval      PMINFO_R_ERROR  internal error
5557  * @pre         pkgmgrinfo_appinfo_metadata_filter_create()
5558  * @post                pkgmgrinfo_appinfo_metadata_filter_destroy()
5559  * @code
5560 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
5561 {
5562         char *appid = NULL;
5563         pkgmgrinfo_appinfo_get_appid(handle, &appid);
5564         printf("appid : %s\n", appid);
5565         return 0;
5566 }
5567
5568 static int get_app_list(const char *mkey, const char *mvalue)
5569 {
5570         int ret = 0;
5571         pkgmgrinfo_appinfo_metadata_filter_h handle;
5572         ret = pkgmgrinfo_appinfo_metadata_filter_create(&handle);
5573         if (ret != PMINFO_R_OK)
5574                 return -1;
5575         ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, mkey, mvalue);
5576         if (ret != PMINFO_R_OK) {
5577                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5578                 return -1;
5579         }
5580         ret = pkgmgrinfo_appinfo_metadata_filter_foreach(handle, app_list_cb, NULL);
5581         if (ret != PMINFO_R_OK) {
5582                 pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5583                 return -1;
5584         }
5585         pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
5586         return 0;
5587 }
5588  * @endcode
5589  */
5590 int pkgmgrinfo_appinfo_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5591                 pkgmgrinfo_app_list_cb app_cb, void *user_data);
5592 int pkgmgrinfo_appinfo_usr_metadata_filter_foreach(pkgmgrinfo_appinfo_metadata_filter_h handle,
5593                 pkgmgrinfo_app_list_cb app_cb, void *user_data, uid_t uid);
5594
5595 /**
5596  * @fn  int pkgmgrinfo_appinfo_foreach_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5597                         pkgmgrinfo_app_control_list_cb_v2 appcontrol_func, void *user_data);
5598  * @fn  int pkgmgrinfo_appinfo_foreach_remote_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5599                         pkgmgrinfo_app_control_list_cb_v2 appcontrol_func, void *user_data);
5600  * @brief       This API gets the list of app-control for a particular application
5601  *
5602  * @par         This API is for package-manager client application
5603  * @par Sync (or) Async : Synchronous API
5604  * @param[in]   handle          pointer to the application info handle.
5605  * @param[in]   appcontrol_func callback function for list
5606  * @param[in]   user_data       user data to be passed to callback function
5607  * @return      0 if success, error code(<0) if fail
5608  * @retval      PMINFO_R_OK     success
5609  * @retval      PMINFO_R_EINVAL invalid argument
5610  * @retval      PMINFO_R_ERROR  internal error
5611  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5612  * @post        pkgmgrinfo_appinfo_destroy_appinfo()
5613  */
5614 int pkgmgrinfo_appinfo_foreach_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5615                 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func,
5616                 void *user_data);
5617 int pkgmgrinfo_appinfo_foreach_remote_appcontrol_v2(pkgmgrinfo_appinfo_h handle,
5618                 pkgmgrinfo_app_control_list_cb_v2 appcontrol_func,
5619                 void *user_data);
5620 /**
5621  * @fn int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle)
5622  * @brief       This API creates the package cert information handle to get data from db.
5623  *
5624  * @par         This API is for package-manager client application
5625  * @par Sync (or) Async : Synchronous API
5626  *
5627  * @param[out] handle           pointer to the package cert handle.
5628  * @return      0 if success, error code(<0) if fail
5629  * @retval      PMINFO_R_OK     success
5630  * @retval      PMINFO_R_EINVAL invalid argument
5631  * @retval      PMINFO_R_ERROR  internal error
5632  * @pre         None
5633  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
5634  * @see         pkgmgrinfo_pkginfo_get_cert_value()
5635  * @see         pkgmgrinfo_pkginfo_load_certinfo()
5636  * @code
5637 static int get_cert_info(const char *pkgid)
5638 {
5639         int ret = 0;
5640         pkgmgrinfo_certinfo_h handle;
5641         char *auth_cert = NULL;
5642         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5643         if (ret != PMINFO_R_OK)
5644                 return -1;
5645         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5646         if (ret != PMINFO_R_OK) {
5647                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5648                 return -1;
5649         }
5650         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5651         if (ret != PMINFO_R_OK) {
5652                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5653                 return -1;
5654         }
5655         printf("Author root certificate: %s\n", auth_root);
5656         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5657         return 0;
5658 }
5659  * @endcode
5660  */
5661 int pkgmgrinfo_pkginfo_create_certinfo(pkgmgrinfo_certinfo_h *handle);
5662
5663 /**
5664  * @fn int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle)
5665  * @brief       This API loads the package cert information handle with data from db.
5666  *
5667  * @par         This API is for package-manager client application
5668  * @par Sync (or) Async : Synchronous API
5669  *
5670  * @param[in] pkgid             pointer to the package ID.
5671  * @param[in] handle            pointer to the package cert handle.
5672  * @return      0 if success, error code(<0) if fail
5673  * @retval      PMINFO_R_OK     success
5674  * @retval      PMINFO_R_EINVAL invalid argument
5675  * @retval      PMINFO_R_ERROR  internal error
5676  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
5677  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
5678  * @see         pkgmgrinfo_pkginfo_get_cert_value()
5679  * @code
5680 static int get_cert_info(const char *pkgid)
5681 {
5682         int ret = 0;
5683         pkgmgrinfo_certinfo_h handle;
5684         char *auth_cert = NULL;
5685         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5686         if (ret != PMINFO_R_OK)
5687                 return -1;
5688         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5689         if (ret != PMINFO_R_OK) {
5690                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5691                 return -1;
5692         }
5693         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5694         if (ret != PMINFO_R_OK) {
5695                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5696                 return -1;
5697         }
5698         printf("Author root certificate: %s\n", auth_root);
5699         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5700         return 0;
5701 }
5702  * @endcode
5703  */
5704 int pkgmgrinfo_pkginfo_load_certinfo(const char *pkgid, pkgmgrinfo_certinfo_h handle, uid_t uid);
5705
5706 /**
5707  * @fn int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value)
5708  * @brief       This API gets the package cert information from the handle
5709  *
5710  * @par         This API is for package-manager client application
5711  * @par Sync (or) Async : Synchronous API
5712  *
5713  * @param[in] handle            pointer to the package cert handle.
5714  * @param[in] cert_type         certificate type
5715  * @param[out] cert_value       pointer to hold certificate value
5716  * @return      0 if success, error code(<0) if fail
5717  * @retval      PMINFO_R_OK     success
5718  * @retval      PMINFO_R_EINVAL invalid argument
5719  * @retval      PMINFO_R_ERROR  internal error
5720  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
5721  * @post                pkgmgrinfo_pkginfo_destroy_certinfo()
5722  * @see         pkgmgrinfo_pkginfo_load_certinfo()
5723  * @code
5724 static int get_cert_info(const char *pkgid)
5725 {
5726         int ret = 0;
5727         pkgmgrinfo_certinfo_h handle;
5728         char *auth_cert = NULL;
5729         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5730         if (ret != PMINFO_R_OK)
5731                 return -1;
5732         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5733         if (ret != PMINFO_R_OK) {
5734                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5735                 return -1;
5736         }
5737         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5738         if (ret != PMINFO_R_OK) {
5739                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5740                 return -1;
5741         }
5742         printf("Author root certificate: %s\n", auth_root);
5743         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5744         return 0;
5745 }
5746  * @endcode
5747  */
5748 int pkgmgrinfo_pkginfo_get_cert_value(pkgmgrinfo_certinfo_h handle, pkgmgrinfo_cert_type cert_type, const char **cert_value);
5749
5750 /**
5751  * @fn int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle)
5752  * @brief       This API destroys the package cert information handle freeing up all the resources
5753  *
5754  * @par         This API is for package-manager client application
5755  * @par Sync (or) Async : Synchronous API
5756  *
5757  * @param[in] handle            pointer to the package cert handle.
5758  * @return      0 if success, error code(<0) if fail
5759  * @retval      PMINFO_R_OK     success
5760  * @retval      PMINFO_R_EINVAL invalid argument
5761  * @retval      PMINFO_R_ERROR  internal error
5762  * @pre         pkgmgrinfo_pkginfo_create_certinfo()
5763  * @post                None
5764  * @see         pkgmgrinfo_pkginfo_load_certinfo()
5765  * @code
5766 static int get_cert_info(const char *pkgid)
5767 {
5768         int ret = 0;
5769         pkgmgrinfo_certinfo_h handle;
5770         char *auth_cert = NULL;
5771         ret = pkgmgrinfo_pkginfo_create_certinfo(&handle);
5772         if (ret != PMINFO_R_OK)
5773                 return -1;
5774         ret = pkgmgrinfo_pkginfo_load_certinfo(pkgid, handle);
5775         if (ret != PMINFO_R_OK) {
5776                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5777                 return -1;
5778         }
5779         ret = pkgmgrinfo_pkginfo_get_cert_value(handle, PMINFO_AUTHOR_ROOT_CERT, &auth_cert);
5780         if (ret != PMINFO_R_OK) {
5781                 pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5782                 return -1;
5783         }
5784         printf("Author root certificate: %s\n", auth_root);
5785         pkgmgrinfo_pkginfo_destroy_certinfo(handle);
5786         return 0;
5787 }
5788  * @endcode
5789  */
5790 int pkgmgrinfo_pkginfo_destroy_certinfo(pkgmgrinfo_certinfo_h handle);
5791
5792 /**
5793  * @fn int pkgmgrinfo_delete_certinfo(const char *pkgid)
5794  * @brief       This API deletes the package cert information from DB
5795  *
5796  * @par         This API is for package-manager client application
5797  * @par Sync (or) Async : Synchronous API
5798  *
5799  * @param[in] pkgid             pointer to the package ID.
5800  * @return      0 if success, error code(<0) if fail
5801  * @retval      PMINFO_R_OK     success
5802  * @retval      PMINFO_R_EINVAL invalid argument
5803  * @retval      PMINFO_R_ERROR  internal error
5804  * @pre         None
5805  * @post                None
5806  * @code
5807 static int delete_cert_info(const char *pkgid)
5808 {
5809         int ret = 0;
5810         ret = pkgmgrinfo_delete_certinfo(pkgid);
5811         if (ret != PMINFO_R_OK)
5812                 return -1;
5813         return 0;
5814 }
5815  * @endcode
5816  */
5817 int pkgmgrinfo_delete_certinfo(const char *pkgid);
5818 int pkgmgrinfo_delete_usr_certinfo(const char *pkgid, uid_t uid);
5819
5820 /**
5821  * @fn int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle)
5822  * @brief       This API creates the package cert information handle to set data in db.
5823  *
5824  * @par         This API is for package-manager client application
5825  * @par Sync (or) Async : Synchronous API
5826  *
5827  * @param[out] handle           pointer to the package cert handle.
5828  * @return      0 if success, error code(<0) if fail
5829  * @retval      PMINFO_R_OK     success
5830  * @retval      PMINFO_R_EINVAL invalid argument
5831  * @retval      PMINFO_R_ERROR  internal error
5832  * @pre         None
5833  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
5834  * @see         pkgmgrinfo_set_cert_value()
5835  * @see         pkgmgrinfo_save_certinfo()
5836  * @code
5837 static int set_cert_in_db(const char *pkgid)
5838 {
5839         int ret = 0;
5840         pkgmgrinfo_instcertinfo_h handle;
5841         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5842         if (ret != PMINFO_R_OK)
5843                 return -1;
5844         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5845         if (ret != PMINFO_R_OK) {
5846                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5847                 return -1;
5848         }
5849         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5850         if (ret != PMINFO_R_OK) {
5851                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5852                 return -1;
5853         }
5854         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5855         return 0;
5856 }
5857  * @endcode
5858  */
5859 int pkgmgrinfo_create_certinfo_set_handle(pkgmgrinfo_instcertinfo_h *handle);
5860
5861 /**
5862  * @fn int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value)
5863  * @brief       This API sets the package cert information in the handle.
5864  *
5865  * @par         This API is for package-manager client application
5866  * @par Sync (or) Async : Synchronous API
5867  *
5868  * @param[in] handle            pointer to the package cert handle.
5869  * @param[in] cert_type         certificate type.
5870  * @param[in] cert_value        certificate value.
5871  * @return      0 if success, error code(<0) if fail
5872  * @retval      PMINFO_R_OK     success
5873  * @retval      PMINFO_R_EINVAL invalid argument
5874  * @retval      PMINFO_R_ERROR  internal error
5875  * @pre         pkgmgrinfo_create_certinfo_set_handle()
5876  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
5877  * @see         pkgmgrinfo_save_certinfo()
5878  * @code
5879 static int set_cert_in_db(const char *pkgid)
5880 {
5881         int ret = 0;
5882         pkgmgrinfo_instcertinfo_h handle;
5883         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5884         if (ret != PMINFO_R_OK)
5885                 return -1;
5886         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5887         if (ret != PMINFO_R_OK) {
5888                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5889                 return -1;
5890         }
5891         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5892         if (ret != PMINFO_R_OK) {
5893                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5894                 return -1;
5895         }
5896         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5897         return 0;
5898 }
5899  * @endcode
5900  */
5901 int pkgmgrinfo_set_cert_value(pkgmgrinfo_instcertinfo_h handle, pkgmgrinfo_instcert_type cert_type, char *cert_value);
5902
5903 /**
5904  * @fn int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle)
5905  * @brief       This API saves the package cert information in the DB.
5906  *
5907  * @par         This API is for package-manager client application
5908  * @par Sync (or) Async : Synchronous API
5909  *
5910  * @param[in] pkgid             pointer to the package ID.
5911  * @param[in] handle            pointer to the package cert handle.
5912  * @return      0 if success, error code(<0) if fail
5913  * @retval      PMINFO_R_OK     success
5914  * @retval      PMINFO_R_EINVAL invalid argument
5915  * @retval      PMINFO_R_ERROR  internal error
5916  * @pre         pkgmgrinfo_create_certinfo_set_handle()
5917  * @post                pkgmgrinfo_destroy_certinfo_set_handle()
5918  * @see         pkgmgrinfo_save_certinfo()
5919  * @code
5920 static int set_cert_in_db(const char *pkgid)
5921 {
5922         int ret = 0;
5923         pkgmgrinfo_instcertinfo_h handle;
5924         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5925         if (ret != PMINFO_R_OK)
5926                 return -1;
5927         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5928         if (ret != PMINFO_R_OK) {
5929                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5930                 return -1;
5931         }
5932         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5933         if (ret != PMINFO_R_OK) {
5934                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5935                 return -1;
5936         }
5937         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5938         return 0;
5939 }
5940  * @endcode
5941  */
5942 int pkgmgrinfo_save_certinfo(const char *pkgid, pkgmgrinfo_instcertinfo_h handle, uid_t uid);
5943
5944 /**
5945  * @fn int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle)
5946  * @brief       This API destroys the package cert information handle freeing up all the resources.
5947  *
5948  * @par         This API is for package-manager client application
5949  * @par Sync (or) Async : Synchronous API
5950  *
5951  * @param[in] handle            pointer to the package cert handle.
5952  * @return      0 if success, error code(<0) if fail
5953  * @retval      PMINFO_R_OK     success
5954  * @retval      PMINFO_R_EINVAL invalid argument
5955  * @retval      PMINFO_R_ERROR  internal error
5956  * @pre         pkgmgrinfo_create_certinfo_set_handle()
5957  * @post                None
5958  * @see         pkgmgrinfo_save_certinfo()
5959  * @code
5960 static int set_cert_in_db(const char *pkgid)
5961 {
5962         int ret = 0;
5963         pkgmgrinfo_instcertinfo_h handle;
5964         ret = pkgmgrinfo_create_certinfo_set_handle(&handle);
5965         if (ret != PMINFO_R_OK)
5966                 return -1;
5967         ret = pkgmgrinfo_set_cert_value(handle, PMINFO_SET_AUTHOR_ROOT_CERT, "author root certificate");
5968         if (ret != PMINFO_R_OK) {
5969                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5970                 return -1;
5971         }
5972         ret = pkgmgrinfo_save_certinfo(pkgid, handle);
5973         if (ret != PMINFO_R_OK) {
5974                 pkgmgrinfo_destroy_certinfo_set_handle(handle);
5975                 return -1;
5976         }
5977         pkgmgrinfo_destroy_certinfo_set_handle(handle);
5978         return 0;
5979 }
5980  * @endcode
5981  */
5982 int pkgmgrinfo_destroy_certinfo_set_handle(pkgmgrinfo_instcertinfo_h handle);
5983
5984 /**
5985  * @fn int pkgmgrinfo_appinfo_is_guestmode_appstatus(pkgmgrinfo_appinfo_h handle, bool *status)
5986  * @brief       This API gets the application 'guest mode visibility' value from the DB
5987  *
5988  * @par         This API is for package-manager client application
5989  * @par Sync (or) Async : Synchronous API
5990  *
5991  * @param[in]   handle  pointer to application info handle
5992  * @param[out] status           pointer to hold app guest mode visibility value
5993  * @return      0 if success, error code(<0) if fail
5994  * @retval      PMINFO_R_OK     success
5995  * @retval      PMINFO_R_EINVAL invalid argument
5996  * @retval      PMINFO_R_ERROR  internal error
5997  * @pre         pkgmgrinfo_appinfo_get_appinfo()
5998  * @post                pkgmgrinfo_appinfo_destroy_appinfo()
5999  * @see         pkgmgrinfo_appinfo_get_appid()
6000  * @see         pkgmgrinfo_appinfo_is_multiple()
6001  * @code
6002 static int get_app_guestmode_visibility(const char *appid)
6003 {
6004         int ret = 0;
6005         bool status;
6006         pkgmgrinfo_appinfo_h handle;
6007         ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
6008         if (ret != PMINFO_R_OK)
6009                 return -1;
6010         ret = pkgmgrinfo_appinfo_is_guestmode_visibility(handle, &status);
6011         if (ret != PMINFO_R_OK) {
6012                 pkgmgrinfo_appinfo_destroy_appinfo(handle);
6013                 return -1;
6014         }
6015         printf("app guest mode visibility: %d\n", status);
6016         pkgmgrinfo_appinfo_destroy_appinfo(handle);
6017         return 0;
6018 }
6019  * @endcode
6020  */
6021 int pkgmgrinfo_appinfo_is_guestmode_visibility(pkgmgrinfo_appinfo_h handle, bool *status);
6022
6023 /**
6024 * @fn int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location)
6025 * @brief         This API sets the package 'installed_storage' value in db
6026 *
6027 * @par  This API is for package-manager client application
6028 * @par Sync (or) Async : Synchronous API
6029 *
6030 * @param[in] pkgid              pointer to the package ID.
6031 * @param[in] location  package install location
6032 * @param[in] external_pkg_path  image path if pkg has installed at external storage
6033 * @return  0 if success, error code(<0) if fail
6034 * @retval  PMINFO_R_OK success
6035 * @retval  PMINFO_R_EINVAL       invalid argument
6036 * @retval  PMINFO_R_ERROR internal error
6037 * @code
6038 static int set_app_installed_storage(const char *appid, INSTALL_LOCATION location)
6039 {
6040         int ret = 0;
6041
6042         ret = pkgmgrinfo_pkginfo_set_installed_storage(handle, INSTALL_EXTERNAL);
6043         if (ret != PMINFO_R_OK) {
6044                 return -1;
6045         }
6046         return 0;
6047 }
6048 * @endcode
6049 */
6050 int pkgmgrinfo_pkginfo_set_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path);
6051 int pkgmgrinfo_pkginfo_set_usr_installed_storage(const char *pkgid, INSTALL_LOCATION location, const char *external_pkg_path, uid_t uid);
6052
6053 /* version compare */
6054 int pkgmgrinfo_compare_package_version(const char *current_version,
6055                 const char *target_version, pkgmgrinfo_version_compare_type *res);
6056
6057 /**
6058  * @fn  int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
6059                         pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6060                         void *user_data);
6061  * @brief       This API gets the list of dependency of a particular package
6062  *
6063  * @par         This API is for package-manager client application
6064  * @par Sync (or) Async : Synchronous API
6065  * @param[in]   handle          pointer to the package info handle.
6066  * @param[in]   dependency_cb           callback function for list
6067  * @param[in] user_data user data to be passed to callback function
6068  * @return      0 if success, error code(<0) if fail
6069  * @retval      PMINFO_R_OK     success
6070  * @retval      PMINFO_R_EINVAL invalid argument
6071  * @retval      PMINFO_R_ERROR  internal error
6072  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
6073  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
6074  * @code
6075 int dependency_cb(const char *from const char *to, const char *type,
6076                 const char *required_version,void *user_data)
6077 {
6078         printf("this package %s %s", type, to);
6079         if (required_version)
6080                 printf("required version : %s", required_version);
6081         return 0;
6082 }
6083
6084 static int list_dependency(const char *package)
6085 {
6086         int ret = 0;
6087         pkgmgrinfo_pkginfo_h handle;
6088         ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6089         if (ret != PMINFO_R_OK)
6090                 return -1;
6091         ret = pkgmgrinfo_pkginfo_foreach_dependency(handle, dependency_cb, NULL);
6092         if (ret != PMINFO_R_OK) {
6093                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6094                 return -1;
6095         }
6096         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6097         return 0;
6098 }
6099  * @endcode
6100  */
6101 int pkgmgrinfo_pkginfo_foreach_dependency(pkgmgrinfo_pkginfo_h handle,
6102                 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6103                 void *user_data);
6104
6105 /**
6106  * @fn  int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
6107                         pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6108                         void *user_data);
6109  * @brief       This API gets the list of packages which has dependency directly
6110  *              and indirectly of a particular package
6111  *
6112  * @par         This API is for package-manager client application
6113  * @par Sync (or) Async : Synchronous API
6114  * @param[in]   handle          pointer to the package info handle.
6115  * @param[in]   dependency_cb           callback function for list
6116  * @param[in] user_data user data to be passed to callback function
6117  * @return      0 if success, error code(<0) if fail
6118  * @retval      PMINFO_R_OK     success
6119  * @retval      PMINFO_R_EINVAL invalid argument
6120  * @retval      PMINFO_R_ERROR  internal error
6121  * @pre         pkgmgrinfo_pkginfo_get_pkginfo()
6122  * @post                pkgmgrinfo_pkginfo_destroy_pkginfo()
6123  * @code
6124 int dependency_cb(const char *from, const char *to, const char *type,
6125                 const char *required_version,void *user_data)
6126 {
6127         printf("%s %s %s package", from, to, type);
6128         if (required_version)
6129                 printf("required version : %s", required_version);
6130         return 0;
6131 }
6132
6133 static int list_depends_on(const char *package)
6134 {
6135         int ret = 0;
6136         pkgmgrinfo_pkginfo_h handle;
6137         ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
6138         if (ret != PMINFO_R_OK)
6139                 return -1;
6140         ret = pkgmgrinfo_pkginfo_foreach_depends_on(handle, dependency_cb, NULL);
6141         if (ret != PMINFO_R_OK) {
6142                 pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6143                 return -1;
6144         }
6145         pkgmgrinfo_pkginfo_destroy_pkginfo(handle);
6146         return 0;
6147 }
6148  * @endcode
6149  */
6150 int pkgmgrinfo_pkginfo_foreach_depends_on(pkgmgrinfo_pkginfo_h handle,
6151                 pkgmgrinfo_pkg_dependency_list_cb dependency_cb,
6152                 void *user_data);
6153
6154 /**
6155  * @fn  int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb, int flag, void *user_data)
6156  * @brief       This API gets list of installed packages using flag that used for masking package's information
6157  *
6158  * @par         This API is for package-manager client application
6159  * @par Sync (or) Async : Synchronous API
6160  * @param[in]   pkg_list_cb     iteration function for list
6161  * @param[in]   flag    enum value of pkgmgrinfo_pkginfo_get_option used for masking package's information
6162  * @param[in]   user_data       user data to be passed to callback function
6163  * @return      0 if success, error code(<0) if fail
6164  * @retval      PMINFO_R_OK     success
6165  * @retval      PMINFO_R_EINVAL invalid argument
6166  * @retval      PMINFO_R_ERROR  internal error
6167  * @pre         None
6168  * @post        None
6169  * @see         pkgmgrinfo_pkginfo_get_option
6170  * @code
6171 int pkg_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
6172 {
6173         char *label1 = NULL;
6174         char *label2 = NULL;
6175         label1 = (char *)user_data;
6176         pkgmgrinfo_pkginfo_get_label(handle, &label2);
6177         if (strcmp(label1, label2) == 0)
6178                 return -1;
6179         else
6180                 return 0;
6181 }
6182
6183 static int list_pkgs()
6184 {
6185         int ret = 0;
6186         char *label = "helloworld";
6187         ret = pkgmgrinfo_pkginfo_get_list_full(pkg_list_cb, PMINFO_PKGINFO_GET_LABEL, (void *)name);
6188         if (ret != PMINFO_R_OK)
6189                 return -1;
6190         return 0;
6191 }
6192  * @endcode
6193  */
6194 int pkgmgrinfo_pkginfo_get_usr_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6195                 int flag, void *user_data, uid_t uid);
6196 int pkgmgrinfo_pkginfo_get_list_full(pkgmgrinfo_pkg_list_cb pkg_list_cb,
6197                 int flag, void *user_data);
6198
6199 /**
6200  * @fn  int pkgmgrinfo_appinfo_get_installed_list_full(pkgmgrinfo_app_list_cb app_func, int flag, void *user_data)
6201  * @brief       This API gets list of installed applications from all packages using flag that used for masking application's information
6202  *
6203  * @par         This API is for package-manager client application
6204  * @par Sync (or) Async : Synchronous API
6205  * @param[in]   app_func        iteration function for list
6206  * @param[in]   flag    enum value of pkgmgrinfo_appinfo_get_option used for masking application's information
6207  * @param[in]   user_data       user data to be passed to callback function
6208  * @return      0 if success, error code(<0) if fail
6209  * @retval      PMINFO_R_OK     success
6210  * @retval      PMINFO_R_EINVAL invalid argument
6211  * @retval      PMINFO_R_ERROR  internal error
6212  * @pre         None
6213  * @post        None
6214  * @see         pkgmgrinfo_appinfo_get_option
6215  * @code
6216 int app_list_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
6217 {
6218         int ret = 0;
6219         char *label1 = NULL;
6220         char *label2 = NULL;
6221         label1 = (char *)user_data;
6222         ret = pkgmgrinfo_appinfo_get_label(handle, &label2);
6223         if (ret != PMINFO_R_OK) {
6224                 printf("pkgmgrinfo_appinfo_get_label fail");
6225                 return -1;
6226         }
6227         if (strcmp(label1, label2) == 0)
6228                 return -1;
6229         else
6230                 return 0;
6231 }
6232
6233 static int list_apps()
6234 {
6235         int ret = 0;
6236         char *label = "helloworld";
6237         ret = pkgmgrinfo_appinfo_get_installed_list_full(app_list_cb, PMINFO_APPINFO_GET_LABEL, (void *)label);
6238         if (ret != PMINFO_R_OK)
6239                 return -1;
6240         return 0;
6241 }
6242  * @endcode
6243  */
6244 int pkgmgrinfo_appinfo_get_usr_installed_list_full(
6245                 pkgmgrinfo_app_list_cb app_func, uid_t uid, int flag,
6246                 void *user_data);
6247 int pkgmgrinfo_appinfo_get_installed_list_full(
6248                 pkgmgrinfo_app_list_cb app_func, int flag, void *user_data);
6249
6250 /**
6251  * @fn int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path, pkgmgrinfo_archiveinfo_h *handle)
6252  * @brief       This API creates the package archive information handle from given path
6253  *
6254  * @par         This API is for package-manager client application
6255  * @par Sync (or) Async : Synchronous API
6256  *
6257  * @param[in]   path    path of package archive
6258  * @param[out]  handle  pointer to the package archive info handle
6259  * @return      0 if success, error code(<0) if fail
6260  * @retval      PMINFO_R_OK     success
6261  * @retval      PMINFO_R_EINVAL invalid argument
6262  * @retval      PMINFO_R_ERROR  internal error
6263  * @pre         None
6264  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6265  * @code
6266 static int get_pkg_archive_type(const char *path)
6267 {
6268         int ret = 0;
6269         char *type = NULL;
6270         pkgmgrinfo_archiveinfo_h handle;
6271         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6272         if (ret != PMINFO_R_OK)
6273                 return -1;
6274         ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6275         if (ret != PMINFO_R_OK) {
6276                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6277                 return -1;
6278         }
6279         printf("pkg archive type: %s\n", type);
6280         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6281         return 0;
6282 }
6283  * @endcode
6284  */
6285 int pkgmgrinfo_archiveinfo_get_archiveinfo(const char *path,
6286                 pkgmgrinfo_archiveinfo_h *handle);
6287
6288 /**
6289  * @fn int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle)
6290  * @brief       This API destroys the package archive information handle freeing up all the resources
6291  *
6292  * @par         This API is for package-manager client application
6293  * @par Sync (or) Async : Synchronous API
6294  *
6295  * @param[in]   handle  pointer to the package archive info handle
6296  * @return      0 if success, error code(<0) if fail
6297  * @retval      PMINFO_R_OK     success
6298  * @retval      PMINFO_R_EINVAL invalid argument
6299  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6300  * @post        None
6301  * @code
6302 static int get_pkg_archive_type(const char *path)
6303 {
6304         int ret = 0;
6305         char *type = NULL;
6306         pkgmgrinfo_archiveinfo_h handle;
6307         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6308         if (ret != PMINFO_R_OK)
6309                 return -1;
6310         ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6311         if (ret != PMINFO_R_OK) {
6312                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6313                 return -1;
6314         }
6315         printf("pkg archive type: %s\n", type);
6316         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6317         return 0;
6318 }
6319  * @endcode
6320  */
6321 int pkgmgrinfo_archiveinfo_destroy_archiveinfo(pkgmgrinfo_archiveinfo_h handle);
6322
6323 /**
6324  * @fn int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle, char **pkgid)
6325  * @brief       This API gets the package id from the package archive info handle
6326  *
6327  * @par         This API is for package-manager client application
6328  * @par Sync (or) Async : Synchronous API
6329  *
6330  * @param[in]   handle  pointer to package archive info handle
6331  * @param[out]  pkgid   pointer to hold package id
6332  * @return      0 if success, error code(<0) if fail
6333  * @retval      PMINFO_R_OK     success
6334  * @retval      PMINFO_R_EINVAL invalid argument
6335  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6336  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6337  * @code
6338 static int get_pkg_archive_id(const char *path)
6339 {
6340         int ret = 0;
6341         char *pkg_id = NULL;
6342         pkgmgrinfo_archiveinfo_h handle;
6343         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6344         if (ret != PMINFO_R_OK)
6345                 return -1;
6346         ret = pkgmgrinfo_archiveinfo_get_pkgid(handle, &pkg_id);
6347         if (ret != PMINFO_R_OK) {
6348                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6349                 return -1;
6350         }
6351         printf("pkg archive id: %s\n", pkg_id);
6352         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6353         return 0;
6354 }
6355  * @endcode
6356  */
6357 int pkgmgrinfo_archiveinfo_get_pkgid(pkgmgrinfo_archiveinfo_h handle,
6358                 const char **pkgid);
6359
6360 /**
6361  * @fn int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle, char **type)
6362  * @brief       This API gets the package type from the package archive info handle
6363  *
6364  * @par         This API is for package-manager client application
6365  * @par Sync (or) Async : Synchronous API
6366  *
6367  * @param[in]   handle  pointer to package archive info handle
6368  * @param[out]  type    pointer to hold package type
6369  * @return      0 if success, error code(<0) if fail
6370  * @retval      PMINFO_R_OK     success
6371  * @retval      PMINFO_R_EINVAL invalid argument
6372  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6373  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6374  * @code
6375 static int get_pkg_archive_type(const char *path)
6376 {
6377         int ret = 0;
6378         char *type = NULL;
6379         pkgmgrinfo_archiveinfo_h handle;
6380         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6381         if (ret != PMINFO_R_OK)
6382                 return -1;
6383         ret = pkgmgrinfo_archiveinfo_get_type(handle, &type);
6384         if (ret != PMINFO_R_OK) {
6385                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6386                 return -1;
6387         }
6388         printf("pkg archive type: %s\n", type);
6389         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6390         return 0;
6391 }
6392  * @endcode
6393  */
6394 int pkgmgrinfo_archiveinfo_get_type(pkgmgrinfo_archiveinfo_h handle,
6395                 const char **type);
6396
6397 /**
6398  * @fn int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle, char **version)
6399  * @brief       This API gets the package version from the package archive info handle
6400  *
6401  * @par         This API is for package-manager client application
6402  * @par Sync (or) Async : Synchronous API
6403  *
6404  * @param[in]   handle  pointer to package archive info handle
6405  * @param[out]  version pointer to hold package version
6406  * @return      0 if success, error code(<0) if fail
6407  * @retval      PMINFO_R_OK     success
6408  * @retval      PMINFO_R_EINVAL invalid argument
6409  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6410  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6411  * @code
6412 static int get_pkg_archive_version(const char *path)
6413 {
6414         int ret = 0;
6415         char *version = NULL;
6416         pkgmgrinfo_archiveinfo_h handle;
6417         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6418         if (ret != PMINFO_R_OK)
6419                 return -1;
6420         ret = pkgmgrinfo_archiveinfo_get_version(handle, &version);
6421         if (ret != PMINFO_R_OK) {
6422                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6423                 return -1;
6424         }
6425         printf("pkg archive version: %s\n", version);
6426         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6427         return 0;
6428 }
6429  * @endcode
6430  */
6431 int pkgmgrinfo_archiveinfo_get_version(pkgmgrinfo_archiveinfo_h handle,
6432                 const char **version);
6433
6434 /**
6435  * @fn int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle, char **api_version)
6436  * @brief       This API gets the package api version from the package archive info handle
6437  *
6438  * @par         This API is for package-manager client application
6439  * @par Sync (or) Async : Synchronous API
6440  *
6441  * @param[in]   handle  pointer to package archive info handle
6442  * @param[out]  api_version     pointer to hold package api_version
6443  * @return      0 if success, error code(<0) if fail
6444  * @retval      PMINFO_R_OK     success
6445  * @retval      PMINFO_R_EINVAL invalid argument
6446  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6447  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6448  * @code
6449 static int get_pkg_archive_api_version(const char *path)
6450 {
6451         int ret = 0;
6452         char *api_version = NULL;
6453         pkgmgrinfo_archiveinfo_h handle;
6454         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6455         if (ret != PMINFO_R_OK)
6456                 return -1;
6457         ret = pkgmgrinfo_archiveinfo_get_api_version(handle, &api_version);
6458         if (ret != PMINFO_R_OK) {
6459                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6460                 return -1;
6461         }
6462         printf("pkg archive api_version: %s\n", api_version);
6463         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6464         return 0;
6465 }
6466  * @endcode
6467  */
6468 int pkgmgrinfo_archiveinfo_get_api_version(pkgmgrinfo_archiveinfo_h handle,
6469                 const char **api_version);
6470
6471 /**
6472  * @fn int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle, char **description)
6473  * @brief       This API gets the package description from the package archive info handle
6474  *
6475  * @par         This API is for package-manager client application
6476  * @par Sync (or) Async : Synchronous API
6477  *
6478  * @param[in]   handle  pointer to package archive info handle
6479  * @param[out]  description     pointer to hold package description
6480  * @return      0 if success, error code(<0) if fail
6481  * @retval      PMINFO_R_OK     success
6482  * @retval      PMINFO_R_EINVAL invalid argument
6483  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6484  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6485  * @code
6486 static int get_pkg_archive_description(const char *path)
6487 {
6488         int ret = 0;
6489         char *description = NULL;
6490         pkgmgrinfo_archiveinfo_h handle;
6491         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6492         if (ret != PMINFO_R_OK)
6493                 return -1;
6494         ret = pkgmgrinfo_archiveinfo_get_description(handle, &description);
6495         if (ret != PMINFO_R_OK) {
6496                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6497                 return -1;
6498         }
6499         printf("pkg archive description: %s\n", description);
6500         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6501         return 0;
6502 }
6503  * @endcode
6504  */
6505 int pkgmgrinfo_archiveinfo_get_description(pkgmgrinfo_archiveinfo_h handle,
6506                 const char **description);
6507
6508 /**
6509  * @fn int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle, char **label)
6510  * @brief       This API gets the package label from the package archive info handle
6511  *
6512  * @par         This API is for package-manager client application
6513  * @par Sync (or) Async : Synchronous API
6514  *
6515  * @param[in]   handle  pointer to package archive info handle
6516  * @param[out]  label   pointer to hold package label
6517  * @return      0 if success, error code(<0) if fail
6518  * @retval      PMINFO_R_OK     success
6519  * @retval      PMINFO_R_EINVAL invalid argument
6520  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6521  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6522  * @code
6523 static int get_pkg_archive_label(const char *path)
6524 {
6525         int ret = 0;
6526         char *label = NULL;
6527         pkgmgrinfo_archiveinfo_h handle;
6528         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6529         if (ret != PMINFO_R_OK)
6530                 return -1;
6531         ret = pkgmgrinfo_archiveinfo_get_label(handle, &label);
6532         if (ret != PMINFO_R_OK) {
6533                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6534                 return -1;
6535         }
6536         printf("pkg archive label: %s\n", label);
6537         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6538         return 0;
6539 }
6540  * @endcode
6541  */
6542 int pkgmgrinfo_archiveinfo_get_label(pkgmgrinfo_archiveinfo_h handle,
6543                 const char **label);
6544
6545 /**
6546  * @fn int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle, char **author)
6547  * @brief       This API gets the package author from the package archive info handle
6548  *
6549  * @par         This API is for package-manager client application
6550  * @par Sync (or) Async : Synchronous API
6551  *
6552  * @param[in]   handle  pointer to package archive info handle
6553  * @param[out]  author  pointer to hold package author
6554  * @return      0 if success, error code(<0) if fail
6555  * @retval      PMINFO_R_OK     success
6556  * @retval      PMINFO_R_EINVAL invalid argument
6557  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6558  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6559  * @code
6560 static int get_pkg_archive_author(const char *path)
6561 {
6562         int ret = 0;
6563         char *author = NULL;
6564         pkgmgrinfo_archiveinfo_h handle;
6565         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6566         if (ret != PMINFO_R_OK)
6567                 return -1;
6568         ret = pkgmgrinfo_archiveinfo_get_author(handle, &author);
6569         if (ret != PMINFO_R_OK) {
6570                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6571                 return -1;
6572         }
6573         printf("pkg archive author: %s\n", author);
6574         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6575         return 0;
6576 }
6577  * @endcode
6578  */
6579 int pkgmgrinfo_archiveinfo_get_author(pkgmgrinfo_archiveinfo_h handle,
6580                 const char **author);
6581
6582 /**
6583  * @fn int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle, const unsigned char **icon, size_t *size)
6584  * @brief       This API gets the package icon and size from the package archive info handle
6585  *
6586  * @par         This API is for package-manager client application
6587  * @par Sync (or) Async : Synchronous API
6588  *
6589  * @param[in]   handle  pointer to package archive info handle
6590  * @param[out]  icon    pointer to hold package icon
6591  * @param[out]  size    pointer to hold size of package icon
6592  * @return      0 if success, error code(<0) if fail
6593  * @retval      PMINFO_R_OK     success
6594  * @retval      PMINFO_R_EINVAL invalid argument
6595  * @retval      PMINFO_R_ENOENT no result
6596  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6597  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6598  * @code
6599 static int get_pkg_archive_icon(const char *path)
6600 {
6601         int ret = 0;
6602         unsigned char *icon = NULL;
6603         size_t icon_size = 0;
6604         pkgmgrinfo_archiveinfo_h handle;
6605         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6606         if (ret != PMINFO_R_OK)
6607                 return -1;
6608         ret = pkgmgrinfo_archiveinfo_get_icon(handle, &icon, &icon_size);
6609         if (ret != PMINFO_R_OK) {
6610                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6611                 return -1;
6612         }
6613         printf("pkg archive icon size : %zu\n", icon_size);
6614         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6615         return 0;
6616 }
6617  * @endcode
6618  */
6619 int pkgmgrinfo_archiveinfo_get_icon(pkgmgrinfo_archiveinfo_h handle,
6620                 const unsigned char **icon, size_t *size);
6621
6622 /**
6623  * @fn int pkgmgrinfo_archiveinfo_foreach_dependency(pkgmgrinfo_archiveinfo_h handle, pkgmgrinfo_dependency_cb callback, void *user_data)
6624  * @brief       This API retrieve the dependency information and invoke given callback for it.
6625  *
6626  * @par         This API is for package-manager client application
6627  * @par Sync (or) Async : Synchronous API
6628  *
6629  * @param[in]   handle  pointer to package archive info handle
6630  * @param[in]   callback        callback to be invoked for each retrieved dependency information
6631  * @param[in]   user_data       user data to be passed to callback
6632  * @return      0 if success, error code(<0) if fail
6633  * @retval      PMINFO_R_OK     success
6634  * @retval      PMINFO_R_EINVAL invalid argument
6635  * @retval      PMINFO_R_ERROR  internal error
6636  * @pre         pkgmgrinfo_archiveinfo_get_archiveinfo()
6637  * @post        pkgmgrinfo_archiveinfo_destroy_archiveinfo()
6638  * @code
6639 static int get_pkg_archive_dependency(const char *path, pkgmgrinfo_pkg_dependency_list_cb callback)
6640 {
6641         int ret = 0;
6642         size_t icon_size = 0;
6643         pkgmgrinfo_archiveinfo_h handle;
6644         ret = pkgmgrinfo_archiveinfo_get_archiveinfo(path, &handle);
6645         if (ret != PMINFO_R_OK)
6646                 return -1;
6647         ret = pkgmgrinfo_archiveinfo_foreach_dependency(handle, callback, NULL);
6648         if (ret != PMINFO_R_OK) {
6649                 pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6650                 return -1;
6651         }
6652         pkgmgrinfo_archiveinfo_destroy_archiveinfo(handle);
6653         return 0;
6654 }
6655  * @endcode
6656  */
6657 int pkgmgrinfo_archiveinfo_foreach_dependency(pkgmgrinfo_archiveinfo_h handle,
6658                 pkgmgrinfo_pkg_dependency_list_cb callback, void *user_data);
6659
6660 /**
6661  * @pkgmgrinfo client API end
6662 **/
6663
6664
6665 /** @} */
6666 #ifdef __cplusplus
6667 }
6668 #endif
6669 #endif                          /* __PKG_INFO_H__ */
6670 /**
6671  * @}
6672  * @}
6673  */
6674