fixed 64bit build
[platform/core/api/geocoder.git] / include / geocoder_private.h
1 /*
2  * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __TIZEN_LOCATION_GEOCODER_PRIVATE_H__
18 #define __TIZEN_LOCATION_GEOCODER_PRIVATE_H__
19
20 #include <location/location.h>
21 #include <location/location-map-service.h>
22 #include <geocoder.h>
23 #include <dlog.h>
24
25 #ifdef LOG_TAG
26 #undef LOG_TAG
27 #endif
28 #define LOG_TAG "CAPI_LOCATION_GEOCODER"
29
30 /*
31 * Internal Macros
32 */
33 #define GEOCODER_LOGD(fmt,args...)  LOGD(fmt, ##args)
34 #define GEOCODER_LOGW(fmt,args...)  LOGW(fmt, ##args)
35 #define GEOCODER_LOGI(fmt,args...)  LOGI(fmt, ##args)
36 #define GEOCODER_LOGE(fmt,args...)  LOGE(fmt, ##args)
37
38 #define GEOCODER_CHECK_CONDITION(condition, error, msg) \
39         do { \
40                 if (condition) { \
41                 } else { \
42                         GEOCODER_LOGE("%s(0x%08x)", msg, error); \
43                         return error; \
44                 } \
45         } while (0)
46
47 #define GEOCODER_NULL_ARG_CHECK(arg)    \
48         GEOCODER_CHECK_CONDITION(arg != NULL,GEOCODER_ERROR_INVALID_PARAMETER,"GEOCODER_ERROR_INVALID_PARAMETER")
49
50 #define GEOCODER_PRINT_ERROR_CODE_RETURN(code) \
51         do{ \
52                 GEOCODER_LOGE("%s(0x%08x)", #code, code); \
53                 return code;    \
54         } while (0)
55
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59
60
61 typedef enum {
62         _GEOCODER_CB_ADDRESS_FROM_POSITION,
63         _GEOCODER_CB_POSITION_FROM_ADDRESS,
64         _GEOCODER_CB_TYPE_NUM
65 }_geocoder_cb_e;
66
67 typedef struct _geocoder_s{
68         LocationMapObject* object;
69         geocoder_preference_h preference;
70 } geocoder_s;
71
72 typedef struct _geocoder_preference_s{
73         LocationGeocodePreference *pref;
74 } geocoder_preference_s;
75
76 #ifdef __cplusplus
77 }
78 #endif
79
80 #endif //__TIZEN_LOCATION_GEOCODER_PRIVATE_H__