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.
20 #ifndef NAVIT_XMLCONFIG_H
21 #define NAVIT_XMLCONFIG_H
27 typedef void *(*object_func_new)(struct attr *parent, struct attr **attrs);
28 typedef int (*object_func_get_attr)(void *, enum attr_type type, struct attr *attr, struct attr_iter *iter);
29 typedef struct attr_iter *(*object_func_iter_new)(void *);
30 typedef void (*object_func_iter_destroy)(struct attr_iter *);
31 typedef int (*object_func_set_attr)(void *, struct attr *attr);
32 typedef int (*object_func_add_attr)(void *, struct attr *attr);
33 typedef int (*object_func_remove_attr)(void *, struct attr *attr);
34 typedef int (*object_func_init)(void *);
35 typedef void (*object_func_destroy)(void *);
36 typedef void *(*object_func_dup)(void *);
37 typedef void *(*object_func_ref)(void *);
38 typedef void *(*object_func_unref)(void *);
43 void *(*create)(struct attr *parent, struct attr **attrs);
44 int (*get_attr)(void *, enum attr_type type, struct attr *attr, struct attr_iter *iter);
45 struct attr_iter *(*iter_new)(void *);
46 void (*iter_destroy)(struct attr_iter *);
47 int (*set_attr)(void *, struct attr *attr);
48 int (*add_attr)(void *, struct attr *attr);
49 int (*remove_attr)(void *, struct attr *attr);
51 void (*destroy)(void *);
54 void *(*unref)(void *);
57 extern struct object_func map_func, mapset_func, navit_func, tracking_func, vehicle_func, maps_func, layout_func;
59 #define HAS_OBJECT_FUNC(x) ((x) == attr_map || (x) == attr_mapset || (x) == attr_navit || (x) == attr_trackingo || (x) == attr_vehicle)
62 struct object_func *func;
67 typedef GError xmlerror;
69 extern const int xml_attr_distance;
73 struct object_func *object_func_lookup(enum attr_type type);
74 void xml_parse_text(const char *document, void *data, void (*start)(void *, const char *, const char **, const char **, void *, void *), void (*end)(void *, const char *, void *, void *), void (*text)(void *, const char *, int, void *, void *));
75 gboolean config_load(const char *filename, xmlerror **error);
76 //static void xinclude(GMarkupParseContext *context, const gchar **attribute_names, const gchar **attribute_values, struct xmldocument *doc_old, xmlerror **error);
78 /* end of prototypes */