4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #ifndef __CORETPK_INSTALLER_TYPE_H_
23 #define __CORETPK_INSTALLER_TYPE_H_
25 /* For multi-user support */
26 #include <tzplatform_config.h>
27 #include <pkgmgr-info.h>
30 #include "rpm-installer-util.h"
34 #endif /* __cplusplus */
36 #define CORETPK_INSTALL "coretpk-install"
37 #define CORETPK_UNINSTALL "coretpk-uninstall"
38 #define CORETPK_DIRECTORY_INSTALL "coretpk-directory-install"
39 #define CORETPK_MOVE "coretpk-move"
40 #define CORETPK_REINSTALL "coretpk-reinstall"
41 #define MAX_BUF_SIZE 4096
43 #define TEMP_DIR tzplatform_mkpath(TZ_USER_HOME, ".rpminstaller")
44 #define TEMP_XML_DIR "/tmp/rpminstaller"
45 #define CORETPK_XML "tizen-manifest.xml"
46 #define USR_APPS tzplatform_getenv(TZ_SYS_RO_APP)
47 #define OPT_USR_APPS tzplatform_getenv(TZ_USER_APP)
48 #define USR_SHARE_PACKAGES tzplatform_getenv(TZ_SYS_RO_PACKAGES)
49 #define OPT_SHARE_PACKAGES getUserManifestPath(getuid())
50 #define CORETPK_RO_XML_CONVERTER "/usr/bin/coretpk_ro_xml_converter.sh"
51 #define CORETPK_RW_XML_CONVERTER "/usr/bin/coretpk_rw_xml_converter.sh"
52 #define CORETPK_CATEGORY_CONVERTER "/usr/bin/coretpk_category_converter.sh"
54 #define SIGNATURE1_XML "signature1.xml"
55 #define AUTHOR_SIGNATURE_XML "author-signature.xml"
56 #define APP_OWNER_ID 5000
57 #define APP_GROUP_ID 5000
58 #define PERM_BASE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) // 0644
59 #define PERM_EXECUTE (S_IXUSR | S_IXGRP | S_IXOTH)
60 #define PERM_WRITE (S_IWUSR | S_IWGRP | S_IWOTH)
61 #define CORETPK_CONFIG_PATH "/usr/etc/coretpk-installer-config.ini"
62 #define INCLUDE_ABSOLUTE_PATH 44
63 #define OPT_STORAGE_SDCARD "/opt/storage/sdcard/"
64 #define OPT_STORAGE_SDCARD_APP_ROOT "/opt/storage/sdcard/apps"
65 #define INI_VALUE_MAKE_EXT_DIRECTORY "make-ext-directory"
66 #define INI_VALUE_SIGNATURE "signature"
67 #define INI_VALUE_AUTHOR_SIGNATURE "author-signature"
68 #define RDS_DELTA_FILE ".rds_delta"
69 #define RDS_DELTA_ADD "#add"
70 #define RDS_DELTA_DELETE "#delete"
71 #define RDS_DELTA_MODIFY "#modify"
82 REQUEST_TYPE_UNINSTALL,
86 #define _LOGL(message, error) \
87 char exception[BUF_SIZE] = {'\0'}; \
89 ret = strerror_r(error, exception, BUF_SIZE); \
90 if (ret) strcpy(exception, ret); \
91 _LOGP("@%s failed[%s]. func:[%s] line:[%d]\n", message, exception, __FUNCTION__, __LINE__)
93 #define ret_if(expr) do { \
95 _LOGE("(%s) ", #expr); \
100 #define retm_if(expr, fmt, arg...) do { \
102 _LOGE("(%s) "fmt, #expr, ##arg); \
107 #define retv_if(expr, val) do { \
109 _LOGE("(%s) ", #expr); \
114 #define retvm_if(expr, val, fmt, arg...) do { \
116 _LOGE("(%s) "fmt, #expr, ##arg); \
121 #define tryvm_if(expr, val, fmt, arg...) do { \
123 _LOGE("(%s) "fmt, #expr, ##arg); \
131 #endif /* __cplusplus */
132 #endif /* __CORETPK_INSTALLER_TYPE_H_ */