Fix:Core:Correct attribute alloc and free
[navit-package] / navit / search.h
1 /**
2  * Navit, a modular navigation system.
3  * Copyright (C) 2005-2008 Navit Team
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public License
7  * version 2 as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA  02110-1301, USA.
18  */
19
20 #ifndef NAVIT_SEARCH_H
21 #define NAVIT_SEARCH_H
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 struct search_list_common {
27         struct item unique,item;
28         int selected;
29         struct pcoord *c;
30         char *town_name;
31         char *district_name;
32         char *postal;
33         char *postal_mask;
34 };
35
36 struct search_list_country {
37         struct search_list_common common;
38         char *car;
39         char *iso2;
40         char *iso3;
41         char *name;
42         char *flag;
43 };
44
45 struct search_list_town {
46         struct search_list_common common;
47         struct item itemt;
48         char *name;
49         char *district;
50 };
51
52 struct search_list_street {
53         struct search_list_common common;
54         char *name;
55 };
56
57 struct search_list_house_number {
58         struct search_list_common common;
59         char *house_number;
60 };
61
62 struct search_list_result {
63         int id;
64         struct pcoord *c;
65         struct search_list_country *country;
66         struct search_list_town *town;
67         struct search_list_street *street;
68         struct search_list_house_number *house_number;
69 };
70
71 /* prototypes */
72 struct attr;
73 struct mapset;
74 struct search_list;
75 struct search_list_result;
76 struct search_list *search_list_new(struct mapset *ms);
77 void search_list_search(struct search_list *this_, struct attr *search_attr, int partial);
78 struct search_list_common *search_list_select(struct search_list *this_, enum attr_type attr_type, int id, int mode);
79 struct search_list_result *search_list_get_result(struct search_list *this_);
80 void search_list_destroy(struct search_list *this_);
81 void search_init(void);
82 /* end of prototypes */
83 #ifdef __cplusplus
84 }
85 #endif
86
87 #endif
88