1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _MAPQUEST_QUEUE_H_
#define _MAPQUEST_QUEUE_H_
#include <glib.h>
#include "mapquest_server_private.h"
typedef struct {
mapquest_req_type type;
void *request;
} mapquest_request_s;
typedef struct {
mapquest_geocode_req_s *req_details;
int requestId;
mapquest_geocode_cb geocode_cb;
void *user_data;
} mapquest_geocode_req;
typedef struct {
mapquest_revgeocode_req_s *req_details;
int requestId;
mapquest_reverse_geocode_cb revgeocode_cb;
void *user_data;
} mapquest_revgeocode_req;
typedef struct {
mapquest_route_req_s *req_details;
mapquest_route_cb route_cb;
int requestId;
void *user_data;
} mapquest_route_req;
typedef struct {
mapquest_search_req_s *req_details;
mapquest_place_search_cb search_place_cb;
int requestId;
void *user_data;
} mapquest_search_place_req;
int add_to_geocode_list(mapquest_geocode_req_s *req_details, mapquest_geocode_cb callback, int request_id, void *user_data);
int add_to_revgeocode_list(mapquest_revgeocode_req_s *req_details, mapquest_reverse_geocode_cb callback, int request_id, void *user_data);
int add_to_route_list(mapquest_route_req_s *req_details, mapquest_route_cb callback, int request_id, void *user_data);
int add_to_places_list(mapquest_search_req_s *req_details, mapquest_place_search_cb callback, int request_id, void *user_data);
int remove_from_request_list(int request_id);
int start_geocode_service(mapquest_geocode_req_s *req_details, mapquest_geocode_cb callback, int request_id, void *user_data);
int start_reversegeocode_service(mapquest_revgeocode_req_s *req_details, mapquest_reverse_geocode_cb callback, int request_id, void *user_data);
int start_route_service(mapquest_route_req_s *req_details, mapquest_route_cb callback, int request_id, void *user_data);
int start_places_service(mapquest_search_req_s *req_details, mapquest_place_search_cb callback, int request_id, void *user_data);
int mapquest_init_queue();
int mapquest_deinit_queue();
int mapquest_push_to_queue(mapquest_resp_type type, gpointer data);
#endif /* _MAPQUEST_QUEUE_H_ */
|