2 * Navit, a modular navigation system.
3 * Copyright (C) 2005-2008 Navit Team
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.
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.
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.
28 #define ITEM2(x,y) type_##y=x,
29 #define ITEM(x) type_##x,
38 /* NOTE: we treat districts as towns for now, since
39 a) navit does not implement district search yet
40 b) OSM "place=suburb" maps to type_district in osm2navit. with the OSM USA maps,
41 there are many "suburbs" that users will consider towns (not districts/counties);
42 we want navit's town search to find them
44 #define item_is_town(item) ((item).type >= type_town_label && (item).type <= type_district_label_1e7)
45 #define item_is_street(item) ((item).type >= type_street_nopass && (item).type <= type_ferry)
47 #define item_is_equal_id(a,b) ((a).id_hi == (b).id_hi && (a).id_lo == (b).id_lo)
48 #define item_is_equal(a,b) (item_is_equal_id(a,b) && (a).map == (b).map)
53 void (*item_coord_rewind)(void *priv_data);
54 int (*item_coord_get)(void *priv_data, struct coord *c, int count);
55 void (*item_attr_rewind)(void *priv_data);
56 int (*item_attr_get)(void *priv_data, enum attr_type attr_type, struct attr *attr);
57 int (*item_coord_is_segment)(void *priv_data);
65 struct item_methods *meth;
76 void item_coord_rewind(struct item *it);
77 int item_coord_get(struct item *it, struct coord *c, int count);
78 /* does the next returned coordinate mark a segment */
79 int item_coord_is_segment(struct item *it);
80 void item_attr_rewind(struct item *it);
81 int item_attr_get(struct item *it, enum attr_type attr_type, struct attr *attr);
82 struct item *item_new(char *type, int zoom);
83 enum item_type item_from_name(const char *name);
84 char *item_to_name(enum item_type item);
85 struct item_hash *item_hash_new(void);
86 void item_hash_insert(struct item_hash *h, struct item *item, void *val);
87 int item_hash_remove(struct item_hash *h, struct item *item);
88 void *item_hash_lookup(struct item_hash *h, struct item *item);
89 void item_hash_destroy(struct item_hash *h);
90 /* end of prototypes */