Update source from tizen 2.3
[platform/core/base/rpm-installer.git] / backend-lib / inc / librpminternals.h
1 /*
2  * rpm-installer
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 #include <package-manager-plugin.h>
25 #include <unistd.h>
26 #include <vconf.h>
27 #include <stdlib.h>
28 #include <sys/types.h>
29 #include <dirent.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif                          /* __cplusplus */
34
35 #define API __attribute__ ((visibility("default")))
36 #define DEBUG_ERR       0x0001
37 #define DEBUG_INFO      0x0002
38 #define DEBUG_RESULT    0x0004
39 #define LIBRPM_LOG      1
40 #define LIBRPM_SUCCESS  0
41 #define LIBRPM_ERROR    -1
42
43 #define BLOCK_SIZE      4096 /*in bytes*/
44 #define LIKELY(expr) __builtin_expect((expr), 1)
45 #define UNLIKELY(expr) __builtin_expect((expr), 0)
46
47 int _librpm_get_package_header_info(const char *pkg_path,
48                         package_manager_pkg_detail_info_t *pkg_detail_info);
49 int _librpm_get_installed_package_info(const char *pkgid,
50                         package_manager_pkg_detail_info_t *pkg_detail_info);
51 int _librpm_app_is_installed(const char *pkgid);
52 long long _librpm_calculate_dir_size(const char *dirname);
53
54 #ifdef __cplusplus
55 }
56 #endif                  /* __cplusplus */