Release Tizen2.0 beta
[framework/location/location-module.git] / modules / osm / osm-http.h
1 /*
2  * location-module
3  *
4  * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Youngae Kang <youngae.kang@samsung.com>, Yunhan Kim <yhan.kim@samsung.com>,
7  *          Genie Kim <daejins.kim@samsung.com>, Minjune Kim <sena06.kim@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 #ifndef __OSM_HTTP_H__
23 #define __OSM_HTTP_H__
24
25 #include <location-map-types.h>
26
27 typedef struct {
28         gpointer handle;
29         LocationPosition *origin;
30         LocationPosition *dest;
31         GList *waypoint;
32         LocationRouteCB route_cb;
33         gpointer user_data;
34 } osm_data_t;
35
36 #define CURL_MUTEX_LOCK(x)      MOD_LOGW ("Try to lock mutex[%p]", x);  \
37                                                         pthread_mutex_lock (x);
38
39 #define CURL_MUTEX_UNLOCK(x)    MOD_LOGW ("Try to unlock mutex[%p]", x);        \
40                                                         pthread_mutex_unlock (x);
41
42 int curl_request_route_async(const char *url, osm_data_t *data, guint *req_id);
43
44 int curl_cancel_route_request (guint req_id);
45
46 #endif /* __OSM_HTTP_H__ */