81ae5239c99e9a5ca3cc67f6323696af205ef7d5
[platform/core/api/package-manager.git] / src / package_manager_internal.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __TIZEN_APPFW_PACKAGE_MANAGER_INTERNAL_H__
18 #define __TIZEN_APPFW_PACKAGE_MANAGER_INTERNAL_H__
19
20 #include <dlog.h>
21 #include <pkgmgr-info.h>
22 #include "package_manager.h"
23
24 #ifndef API
25 #define API __attribute__ ((visibility("default")))
26 #endif
27
28 #ifdef LOG_TAG
29 #undef LOG_TAG
30 #endif
31
32 #define LOG_TAG "CAPI_APPFW_PACKAGE_MANAGER"
33
34 #define _LOGE(fmt, arg...) LOGE(fmt, ##arg)
35 #define _LOGD(fmt, arg...) LOGD(fmt, ##arg)
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 typedef enum {
42         PRIVILEGE_PACKAGE_MANAGER_INFO,
43         PRIVILEGE_PACKAGE_MANAGER_ADMIN,
44         PRIVILEGE_PACKAGE_MANAGER_CACHE
45 } privilege_type;
46
47 int check_privilege(privilege_type type);
48
49 int package_manager_error(package_manager_error_e error, const char *function, const char *description);
50
51 int package_info_get_package_info(const char *package, package_info_h *package_info);
52
53 int package_info_foreach_package_info(package_manager_package_info_cb callback, void *user_data);
54
55 int package_info_filter_foreach_package_info(pkgmgrinfo_pkginfo_filter_h handle, package_manager_package_info_cb callback, void *user_data);
56
57 int package_info_create_with_pkginfo(pkgmgrinfo_pkginfo_h pkg_handle, package_info_h *package_info);
58
59 int package_info_destroy_handle(package_info_h handle);
60
61 #ifdef __cplusplus
62 }
63 #endif
64
65 #endif /* __TIZEN_APPFW_PACKAGE_MANAGER_INTERNAL_H__ */