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