4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
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.
25 #ifndef __AIL_PRIVATE_H__
26 #define __AIL_PRIVATE_H__
32 #define EXPORT_API __attribute__ ((visibility("default")))
40 #define _E(fmt, arg...) LOGE("[%s,%d] "fmt,__FUNCTION__,__LINE__,##arg)
41 #define _D(fmt, arg...) LOGD("[%s,%d] "fmt,__FUNCTION__,__LINE__,##arg)
44 #define _E(fmt, arg...) fprintf(stderr, "[%s,%d] "fmt,__FUNCTION__,__LINE__,##arg)
45 #define _D(fmt, arg...) fprintf(stderr, "[%s,%d] "fmt,__FUNCTION__,__LINE__,##arg)
48 #define retv_if(expr, val) do { \
50 _E("(%s) -> %s() return\n", #expr, __FUNCTION__); \
55 #define SAFE_FREE_AND_STRDUP(from, to) do { \
60 #define SAFE_FREE(ptr) do { \
89 #define ELEMENT_INT(e) ((struct element_int *)(e))
90 #define ELEMENT_STR(e) ((struct element_str *)(e))
91 #define ELEMENT_BOOL(e) ((struct element_bool *)(e))
93 #define AIL_SQL_QUERY_MAX_LEN 2048
94 #define APP_INFO_DB "/opt/dbspace/.app_info.db"
96 #define ELEMENT_TYPE(e, t) do { \
97 if(e->prop >= E_AIL_PROP_STR_MIN && e->prop <= E_AIL_PROP_STR_MAX) t= (int)VAL_TYPE_STR; \
98 else if (e->prop >= E_AIL_PROP_INT_MIN && e->prop <= E_AIL_PROP_INT_MAX) t= (int)VAL_TYPE_INT; \
99 else if (e->prop >= E_AIL_PROP_BOOL_MIN && e->prop <= E_AIL_PROP_BOOL_MAX) t= (int)VAL_TYPE_BOOL; \
104 #define PROP_TYPE(p, t) do { \
105 if(p >= E_AIL_PROP_STR_MIN && p <= E_AIL_PROP_STR_MAX) t= (int)VAL_TYPE_STR; \
106 else if (p >= E_AIL_PROP_INT_MIN && p <= E_AIL_PROP_INT_MAX) t= (int)VAL_TYPE_INT; \
107 else if (p >= E_AIL_PROP_BOOL_MIN && p <= E_AIL_PROP_BOOL_MAX) t= (int)VAL_TYPE_BOOL; \
113 * @brief string type properties
116 E_AIL_PROP_STR_MIN = 0,
117 E_AIL_PROP_PACKAGE_STR = E_AIL_PROP_STR_MIN,
122 E_AIL_PROP_CATEGORIES_STR,
123 E_AIL_PROP_VERSION_STR,
124 E_AIL_PROP_MIMETYPE_STR,
125 E_AIL_PROP_X_SLP_SERVICE_STR,
126 E_AIL_PROP_X_SLP_PACKAGETYPE_STR,
127 E_AIL_PROP_X_SLP_PACKAGECATEGORIES_STR,
128 E_AIL_PROP_X_SLP_PACKAGEID_STR,
129 E_AIL_PROP_X_SLP_URI_STR,
130 E_AIL_PROP_X_SLP_SVC_STR,
131 E_AIL_PROP_X_SLP_EXE_PATH,
132 E_AIL_PROP_X_SLP_APPID_STR,
133 E_AIL_PROP_X_SLP_PKGID_STR,
134 E_AIL_PROP_X_SLP_DOMAIN_STR,
135 E_AIL_PROP_STR_MAX = E_AIL_PROP_X_SLP_DOMAIN_STR,
140 * @brief integer type properties
143 E_AIL_PROP_INT_MIN = E_AIL_PROP_STR_MAX + 1,
144 E_AIL_PROP_X_SLP_TEMP_INT = E_AIL_PROP_INT_MIN,
145 E_AIL_PROP_X_SLP_INSTALLEDTIME_INT,
146 E_AIL_PROP_INT_MAX = E_AIL_PROP_X_SLP_INSTALLEDTIME_INT,
151 * @brief boolean type properties
154 E_AIL_PROP_BOOL_MIN = E_AIL_PROP_INT_MAX + 1,
155 E_AIL_PROP_NODISPLAY_BOOL = E_AIL_PROP_BOOL_MIN,
156 E_AIL_PROP_X_SLP_TASKMANAGE_BOOL,
157 E_AIL_PROP_X_SLP_MULTIPLE_BOOL,
158 E_AIL_PROP_X_SLP_REMOVABLE_BOOL,
159 E_AIL_PROP_X_SLP_ISHORIZONTALSCALE_BOOL,
160 E_AIL_PROP_X_SLP_INACTIVATED_BOOL,
161 E_AIL_PROP_BOOL_MAX = E_AIL_PROP_X_SLP_INACTIVATED_BOOL,
164 #define NUM_OF_PROP E_AIL_PROP_BOOL_MAX + 1