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__
30 #include <tzplatform_config.h>
33 #define EXPORT_API __attribute__ ((visibility("default")))
41 #define _E(fmt, arg...) LOGE("[%s,%d] "fmt,__FUNCTION__,__LINE__,##arg)
42 #define _D(fmt, arg...) LOGD("[%s,%d] "fmt,__FUNCTION__,__LINE__,##arg)
45 #define _E(fmt, arg...) fprintf(stderr, "[%s,%d] "fmt,__FUNCTION__,__LINE__,##arg)
46 #define _D(fmt, arg...) fprintf(stderr, "[%s,%d] "fmt,__FUNCTION__,__LINE__,##arg)
49 #define retv_if(expr, val) do { \
51 _E("(%s) -> %s() return\n", #expr, __FUNCTION__); \
56 #define SAFE_FREE_AND_STRDUP(from, to) do { \
61 #define SAFE_FREE(ptr) do { \
90 #define ELEMENT_INT(e) ((struct element_int *)(e))
91 #define ELEMENT_STR(e) ((struct element_str *)(e))
92 #define ELEMENT_BOOL(e) ((struct element_bool *)(e))
94 #define AIL_SQL_QUERY_MAX_LEN 2048
95 #define APP_INFO_DB tzplatform_mkpath(TZ_SYS_DB,".app_info.db")
97 #define ELEMENT_TYPE(e, t) do { \
98 if(e->prop >= E_AIL_PROP_STR_MIN && e->prop <= E_AIL_PROP_STR_MAX) t= (int)VAL_TYPE_STR; \
99 else if (e->prop >= E_AIL_PROP_INT_MIN && e->prop <= E_AIL_PROP_INT_MAX) t= (int)VAL_TYPE_INT; \
100 else if (e->prop >= E_AIL_PROP_BOOL_MIN && e->prop <= E_AIL_PROP_BOOL_MAX) t= (int)VAL_TYPE_BOOL; \
105 #define PROP_TYPE(p, t) do { \
106 if(p >= E_AIL_PROP_STR_MIN && p <= E_AIL_PROP_STR_MAX) t= (int)VAL_TYPE_STR; \
107 else if (p >= E_AIL_PROP_INT_MIN && p <= E_AIL_PROP_INT_MAX) t= (int)VAL_TYPE_INT; \
108 else if (p >= E_AIL_PROP_BOOL_MIN && p <= E_AIL_PROP_BOOL_MAX) t= (int)VAL_TYPE_BOOL; \
114 * @brief string type properties
117 E_AIL_PROP_STR_MIN = 0,
118 E_AIL_PROP_PACKAGE_STR = E_AIL_PROP_STR_MIN,
123 E_AIL_PROP_CATEGORIES_STR,
124 E_AIL_PROP_VERSION_STR,
125 E_AIL_PROP_MIMETYPE_STR,
126 E_AIL_PROP_X_SLP_SERVICE_STR,
127 E_AIL_PROP_X_SLP_PACKAGETYPE_STR,
128 E_AIL_PROP_X_SLP_PACKAGECATEGORIES_STR,
129 E_AIL_PROP_X_SLP_PACKAGEID_STR,
130 E_AIL_PROP_X_SLP_URI_STR,
131 E_AIL_PROP_X_SLP_SVC_STR,
132 E_AIL_PROP_X_SLP_EXE_PATH,
133 E_AIL_PROP_X_SLP_APPID_STR,
134 E_AIL_PROP_X_SLP_PKGID_STR,
135 E_AIL_PROP_X_SLP_DOMAIN_STR,
136 E_AIL_PROP_X_SLP_SUBMODEMAINID_STR,
137 E_AIL_PROP_X_SLP_INSTALLEDSTORAGE_STR,
138 E_AIL_PROP_STR_MAX = E_AIL_PROP_X_SLP_INSTALLEDSTORAGE_STR,
143 * @brief integer type properties
146 E_AIL_PROP_INT_MIN = E_AIL_PROP_STR_MAX + 1,
147 E_AIL_PROP_X_SLP_TEMP_INT = E_AIL_PROP_INT_MIN,
148 E_AIL_PROP_X_SLP_INSTALLEDTIME_INT,
149 E_AIL_PROP_INT_MAX = E_AIL_PROP_X_SLP_INSTALLEDTIME_INT,
154 * @brief boolean type properties
157 E_AIL_PROP_BOOL_MIN = E_AIL_PROP_INT_MAX + 1,
158 E_AIL_PROP_NODISPLAY_BOOL = E_AIL_PROP_BOOL_MIN,
159 E_AIL_PROP_X_SLP_TASKMANAGE_BOOL,
160 E_AIL_PROP_X_SLP_MULTIPLE_BOOL,
161 E_AIL_PROP_X_SLP_REMOVABLE_BOOL,
162 E_AIL_PROP_X_SLP_ISHORIZONTALSCALE_BOOL,
163 E_AIL_PROP_X_SLP_ENABLED_BOOL,
164 E_AIL_PROP_X_SLP_SUBMODE_BOOL,
165 E_AIL_PROP_BOOL_MAX = E_AIL_PROP_X_SLP_SUBMODE_BOOL,
168 #define NUM_OF_PROP E_AIL_PROP_BOOL_MAX + 1