navit
0.5.3-trunk
|
#include "config.h"
#include "ezxml.h"
Go to the source code of this file.
Data Structures | |
struct | object_func |
Basic functions for Navit objects. More... | |
struct | navit_object |
Macros | |
#define | USE_EZXML 1 |
#define | XML_ATTR_DISTANCE 2 |
#define | G_MARKUP_ERROR 0 |
#define | G_MARKUP_ERROR_INVALID_CONTENT 0 |
#define | G_MARKUP_ERROR_PARSE 0 |
#define | G_MARKUP_ERROR_UNKNOWN_ELEMENT 0 |
#define | HAS_OBJECT_FUNC(x) ((x) == attr_map || (x) == attr_mapset || (x) == attr_navit || (x) == attr_osd || (x) == attr_trackingo || (x) == attr_vehicle || (x) == attr_maps || (x) == attr_layout || (x) == attr_roadprofile || (x) == attr_vehicleprofile || (x) == attr_layer || (x) == attr_config || (x) == attr_profile_option || (x) == attr_script || (x) == attr_log || (x) == attr_speech || (x) == attr_navigation || (x) == attr_route || (x) == attr_traffic) |
#define | NAVIT_OBJECT struct object_func *func; int refcount; struct attr **attrs; |
Typedefs | |
typedef void * | xml_context |
typedef void *(* | object_func_new) (struct attr *parent, struct attr **attrs) |
typedef int(* | object_func_get_attr) (void *, enum attr_type type, struct attr *attr, struct attr_iter *iter) |
typedef struct attr_iter *(* | object_func_iter_new) (void *) |
typedef void(* | object_func_iter_destroy) (struct attr_iter *) |
typedef int(* | object_func_set_attr) (void *, struct attr *attr) |
typedef int(* | object_func_add_attr) (void *, struct attr *attr) |
typedef int(* | object_func_remove_attr) (void *, struct attr *attr) |
typedef int(* | object_func_init) (void *) |
typedef void(* | object_func_destroy) (void *) |
typedef void *(* | object_func_dup) (void *) |
typedef void *(* | object_func_ref) (void *) |
typedef void *(* | object_func_unref) (void *) |
typedef GError | xmlerror |
Functions | |
int | navit_object_set_methods (void *in, int in_size, void *out, int out_size) |
struct navit_object * | navit_object_new (struct attr **attrs, struct object_func *func, int size) |
struct navit_object * | navit_object_ref (struct navit_object *obj) |
void * | navit_object_unref (struct navit_object *obj) |
struct attr_iter * | navit_object_attr_iter_new (void *unused) |
void | navit_object_attr_iter_destroy (struct attr_iter *iter) |
int | navit_object_get_attr (struct navit_object *obj, enum attr_type type, struct attr *attr, struct attr_iter *iter) |
Generic get function. More... | |
void | navit_object_callbacks (struct navit_object *obj, struct attr *attr) |
int | navit_object_set_attr (struct navit_object *obj, struct attr *attr) |
int | navit_object_add_attr (struct navit_object *obj, struct attr *attr) |
int | navit_object_remove_attr (struct navit_object *obj, struct attr *attr) |
void | navit_object_destroy (struct navit_object *obj) |
struct object_func * | object_func_lookup (enum attr_type type) |
int | xml_parse_file (char *filename, void *data, void(*start)(xml_context *, const char *, const char **, const char **, void *, GError **), void(*end)(xml_context *, const char *, void *, GError **), void(*text)(xml_context *, const char *, gsize, void *, GError **)) |
Parses an XML file. More... | |
int | xml_parse_text (const char *document, void *data, void(*start)(xml_context *, const char *, const char **, const char **, void *, GError **), void(*end)(xml_context *, const char *, void *, GError **), void(*text)(xml_context *, const char *, gsize, void *, GError **)) |
Parses XML text. More... | |
gboolean | config_load (const char *filename, xmlerror **error) |
#define G_MARKUP_ERROR 0 |
#define G_MARKUP_ERROR_INVALID_CONTENT 0 |
#define G_MARKUP_ERROR_PARSE 0 |
#define G_MARKUP_ERROR_UNKNOWN_ELEMENT 0 |
#define HAS_OBJECT_FUNC | ( | x | ) | ((x) == attr_map || (x) == attr_mapset || (x) == attr_navit || (x) == attr_osd || (x) == attr_trackingo || (x) == attr_vehicle || (x) == attr_maps || (x) == attr_layout || (x) == attr_roadprofile || (x) == attr_vehicleprofile || (x) == attr_layer || (x) == attr_config || (x) == attr_profile_option || (x) == attr_script || (x) == attr_log || (x) == attr_speech || (x) == attr_navigation || (x) == attr_route || (x) == attr_traffic) |
#define NAVIT_OBJECT struct object_func *func; int refcount; struct attr **attrs; |
#define USE_EZXML 1 |
Navit, a modular navigation system. Copyright (C) 2005-2008 Navit Team
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define XML_ATTR_DISTANCE 2 |
typedef void(* object_func_destroy) (void *) |
typedef void*(* object_func_dup) (void *) |
typedef int(* object_func_get_attr) (void *, enum attr_type type, struct attr *attr, struct attr_iter *iter) |
typedef int(* object_func_init) (void *) |
typedef void(* object_func_iter_destroy) (struct attr_iter *) |
typedef struct attr_iter*(* object_func_iter_new) (void *) |
typedef void*(* object_func_ref) (void *) |
typedef void*(* object_func_unref) (void *) |
typedef void* xml_context |
typedef GError xmlerror |
gboolean config_load | ( | const char * | filename, |
xmlerror ** | error | ||
) |
filename | FQFN of the file |
error | ptr to error details, if any |
References attr_create_hash(), attr_destroy_hash(), dbg, xmlstate::document, xmlstate::element, filename, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, xmldocument::href, initStatic(), item_create_hash(), item_destroy_hash(), lvl_debug, parse_file(), and xmldocument::user_data.
Referenced by config_load_py(), and main_real().
int navit_object_add_attr | ( | struct navit_object * | obj, |
struct attr * | attr | ||
) |
References attr_generic_add_attr(), attr_generic_prepend_attr(), attr_to_name(), attr::callback, attr::callback_list, callback_list_add(), callback_list_call_attr_2, callback_list_new(), cbl, attr::data, dbg, lvl_debug, attr::type, and attr::u.
Referenced by config_add_attr().
void navit_object_attr_iter_destroy | ( | struct attr_iter * | iter | ) |
References attr_iter::iter.
Referenced by config_attr_iter_destroy().
struct attr_iter* navit_object_attr_iter_new | ( | void * | unused | ) |
Referenced by config_attr_iter_new().
void navit_object_callbacks | ( | struct navit_object * | obj, |
struct attr * | attr | ||
) |
References callback_list_call_attr_2, attr::data, attr::type, and attr::u.
Referenced by navigation_set_turnaround(), and navit_object_set_attr().
void navit_object_destroy | ( | struct navit_object * | obj | ) |
References attr_list_free().
Referenced by speech_destroy(), and traffic_new().
int navit_object_get_attr | ( | struct navit_object * | obj, |
enum attr_type | type, | ||
struct attr * | attr, | ||
struct attr_iter * | iter | ||
) |
Generic get function.
This function searches an attribute list for an attribute of a given type and stores it in the
parameter. Internally it calls attr_generic_get_attr(struct attr **, struct attr **, enum attr_type, struct attr *, struct attr_iter *) to retrieve the attribute; see its documentation for details.
Searching for attr_any or attr_any_xml is supported.
An iterator can be specified to get multiple attributes of the same type: The first call will return the first match; each subsequent call with the same iterator will return the next match. If no more matching attributes are found in either of them, false is returned.
obj | The object to return an attribute for. This can be any Navit object type, but the parameter should be cast to struct navit_object *
|
type | The attribute type to search for. Searching for attr_any
attr_any_xml
|
attr | Points to a struct attr
|
iter | An iterator to receive multiple attributes of the same type with subsequent calls. If NULL
|
References attr_generic_get_attr(), attr_iter::iter, and type.
Referenced by navigation_get_attr(), navit_get_attr(), and osd_get_attr().
struct navit_object* navit_object_new | ( | struct attr ** | attrs, |
struct object_func * | func, | ||
int | size | ||
) |
References attr_list_dup(), navit_object_ref(), and size.
Referenced by navigation_new(), speech_new(), and traffic_new().
struct navit_object* navit_object_ref | ( | struct navit_object * | obj | ) |
References attr_to_name(), dbg, and lvl_debug.
Referenced by layer_new(), layer_set_attr_do(), layout_new(), log_new(), map_new(), mapset_new(), navit_new(), navit_object_new(), osd_new(), profile_option_new(), roadprofile_new(), route_dup(), route_get_map_helper(), route_new(), script_new(), tracking_new(), vehicle_new(), and vehicleprofile_new().
int navit_object_remove_attr | ( | struct navit_object * | obj, |
struct attr * | attr | ||
) |
References attr_generic_remove_attr(), attr::callback, callback_list_call_attr_2, callback_list_remove(), attr::data, attr::type, and attr::u.
Referenced by config_remove_attr().
int navit_object_set_attr | ( | struct navit_object * | obj, |
struct attr * | attr | ||
) |
References attr_generic_set_attr(), attr_to_name(), dbg, lvl_debug, navit_object_callbacks(), and attr::type.
Referenced by config_set_attr(), graphics_android_new(), navigation_set_attr(), navit_set_attr_do(), and osd_set_attr().
int navit_object_set_methods | ( | void * | in, |
int | in_size, | ||
void * | out, | ||
int | out_size | ||
) |
References size.
Referenced by osd_set_methods().
void* navit_object_unref | ( | struct navit_object * | obj | ) |
References attr_to_name(), dbg, and lvl_debug.
Referenced by layer_set_attr_do().
struct object_func* object_func_lookup | ( | enum attr_type | type | ) |
References config_func, layer_func, layout_func, log_func, map_func, maps_func, mapset_func, navigation_func, navit_func, object_funcs, osd_func, profile_option_func, roadprofile_func, route_func, script_func, speech_func, tracking_func, traffic_func, type, vehicle_func, and vehicleprofile_func.
Referenced by command_call_function(), command_evaluate_single(), command_object_add_attr(), command_object_get_attr(), command_object_remove_attr(), command_register_callbacks(), command_saved_callbacks_changed(), command_set_attr(), eval_postfix(), gui_internal_menu_destroy(), gui_internal_set_refresh_callback(), and start_element().
int xml_parse_file | ( | char * | filename, |
void * | data, | ||
void(*)(xml_context *, const char *, const char **, const char **, void *, GError **) | start, | ||
void(*)(xml_context *, const char *, void *, GError **) | end, | ||
void(*)(xml_context *, const char *, gsize, void *, GError **) | text | ||
) |
Parses an XML file.
filename | The XML file to parse |
data | Points to a user-defined data structure which will be passed to each of the callbacks passed in the following arguments |
start | Callback which will be called when an open tag is encountered |
end | Callback which will be called when a close tag is encountered |
text | Callback which will be called when character data is encountered |
References data, dbg, filename, lvl_debug, lvl_error, parse_node_text(), attr::text, and xml_parse_text().
Referenced by traffic_get_messages_from_xml_file().
int xml_parse_text | ( | const char * | document, |
void * | data, | ||
void(*)(xml_context *, const char *, const char **, const char **, void *, GError **) | start, | ||
void(*)(xml_context *, const char *, void *, GError **) | end, | ||
void(*)(xml_context *, const char *, gsize, void *, GError **) | text | ||
) |
Parses XML text.
document | The XML data to parse |
data | Points to a user-defined data structure which will be passed to each of the callbacks passed in the following arguments |
start | Callback which will be called when an open tag is encountered |
end | Callback which will be called when a close tag is encountered |
text | Callback which will be called when character data is encountered |
References context, data, dbg, lvl_error, parse_node_text(), attr::str, and attr::text.
Referenced by gui_internal_html_parse_text(), traffic_get_messages_from_xml_string(), and xml_parse_file().
Referenced by object_func_lookup(), and traffic_new().