Tizen 2.1 base
[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 #define API __attribute__ ((visibility("default")))
32 #define DEBUG_ERR       0x0001
33 #define DEBUG_INFO      0x0002
34 #define DEBUG_RESULT    0x0004
35 #define LIBRPM_LOG      1
36 #define LIBRPM_SUCCESS  0
37 #define LIBRPM_ERROR    -1
38
39 #define BLOCK_SIZE      4096 /*in bytes*/
40 #define LIKELY(expr) __builtin_expect((expr), 1)
41 #define UNLIKELY(expr) __builtin_expect((expr), 0)
42
43 void _librpm_print_msg(int type, int exetype, char *format, ...);
44 #define _librpm_print(type, fmtstr, args...) { \
45 _librpm_print_msg(type, LIBRPM_LOG, "%s():%d: " fmtstr, \
46 __func__, __LINE__, ##args); \
47 }
48
49 int _librpm_get_package_header_info(char *pkg_path,
50                         package_manager_pkg_detail_info_t *pkg_detail_info);
51 int _librpm_get_installed_package_info(char *pkgid,
52                         package_manager_pkg_detail_info_t *pkg_detail_info);
53 int _librpm_app_is_installed(char *pkgid);
54 long long _librpm_calculate_dir_size(char *dirname);
55
56 #ifdef __cplusplus
57 }
58 #endif                  /* __cplusplus */