summaryrefslogtreecommitdiff
path: root/navit/xmlconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'navit/xmlconfig.c')
-rw-r--r--navit/xmlconfig.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/navit/xmlconfig.c b/navit/xmlconfig.c
index fccf94ca3..00ce94325 100644
--- a/navit/xmlconfig.c
+++ b/navit/xmlconfig.c
@@ -118,7 +118,7 @@ static struct attr ** convert_to_attrs(struct xmlstate *state, struct attr_fixme
if (! strcmp(name, attr_fixme[0])) {
name=attr_fixme[1];
if (fixme_count++ < 10)
- dbg(0,"Please change attribute '%s' to '%s' in <%s />\n", attr_fixme[0], attr_fixme[1], fixme->element);
+ dbg(lvl_error,"Please change attribute '%s' to '%s' in <%s />\n", attr_fixme[0], attr_fixme[1], fixme->element);
break;
}
attr_fixme+=2;
@@ -128,12 +128,12 @@ static struct attr ** convert_to_attrs(struct xmlstate *state, struct attr_fixme
if (ret[count])
count++;
else if (strcmp(*attribute_name,"enabled") && strcmp(*attribute_name,"xmlns:xi"))
- dbg(0,"failed to create attribute '%s' with value '%s'\n", *attribute_name,*attribute_value);
+ dbg(lvl_error,"failed to create attribute '%s' with value '%s'\n", *attribute_name,*attribute_value);
attribute_name++;
attribute_value++;
}
ret[count]=NULL;
- dbg(3,"ret=%p\n", ret);
+ dbg(lvl_debug,"ret=%p\n", ret);
return ret;
}
@@ -209,7 +209,7 @@ xmlconfig_announce(struct xmlstate *state)
if (itype!=type_none) {
navigation_set_announce(state->parent->element_attr.u.data, itype, level);
} else {
- dbg(0, "Invalid type for announcement: %s\n",tok);
+ dbg(lvl_error, "Invalid type for announcement: %s\n",tok);
}
str=NULL;
}
@@ -586,7 +586,7 @@ start_element(xml_context *context,
const char *parent_name=NULL;
char *s,*sep="",*possible_parents;
struct attr *parent_attr;
- dbg(2,"name='%s' parent='%s'\n", element_name, *parent ? (*parent)->element:NULL);
+ dbg(lvl_info,"name='%s' parent='%s'\n", element_name, *parent ? (*parent)->element:NULL);
if (!strcmp(element_name,"xml"))
return;
@@ -604,7 +604,7 @@ start_element(xml_context *context,
if (!strcmp(element_name,element_fixme[0])) {
element_name=element_fixme[1];
if (fixme_count++ < 10)
- dbg(0,"Please change <%s /> to <%s /> in config file\n", element_fixme[0], element_fixme[1]);
+ dbg(lvl_error,"Please change <%s /> to <%s /> in config file\n", element_fixme[0], element_fixme[1]);
}
element_fixme+=2;
}
@@ -676,7 +676,7 @@ start_element(xml_context *context,
return;
new->element_attr.type=attr_from_name(element_name);
if (new->element_attr.type == attr_none)
- dbg(0,"failed to create object of type '%s'\n", element_name);
+ dbg(lvl_error,"failed to create object of type '%s'\n", element_name);
if (new->element_attr.type == attr_tracking)
new->element_attr.type=attr_trackingo;
if (new->parent && new->parent->object_func && new->parent->object_func->add_attr)
@@ -697,7 +697,7 @@ end_element (xml_context *context,
if (!strcmp(element_name,"xml"))
return;
- dbg(2,"name='%s'\n", element_name);
+ dbg(lvl_info,"name='%s'\n", element_name);
curr=*state;
if (curr->object_func && curr->object_func->init)
curr->object_func->init(curr->element_attr.u.data);
@@ -752,27 +752,27 @@ xinclude(xml_context *context, const gchar **attribute_names, const gchar **attr
doc_new.level=doc_old->level+1;
doc_new.user_data=doc_old->user_data;
if (! href) {
- dbg(1,"no href, using '%s'\n", doc_old->href);
+ dbg(lvl_warning,"no href, using '%s'\n", doc_old->href);
doc_new.href=doc_old->href;
if (file_exists(doc_new.href)) {
parse_file(&doc_new, error);
} else {
- dbg(0,"Unable to include %s\n",doc_new.href);
+ dbg(lvl_error,"Unable to include %s\n",doc_new.href);
}
} else {
- dbg(1,"expanding '%s'\n", href);
+ dbg(lvl_warning,"expanding '%s'\n", href);
we=file_wordexp_new(href);
we_files=file_wordexp_get_array(we);
count=file_wordexp_get_count(we);
- dbg(1,"%d results\n", count);
+ dbg(lvl_warning,"%d results\n", count);
if (file_exists(we_files[0])) {
for (i = 0 ; i < count ; i++) {
- dbg(1,"result[%d]='%s'\n", i, we_files[i]);
+ dbg(lvl_warning,"result[%d]='%s'\n", i, we_files[i]);
doc_new.href=we_files[i];
parse_file(&doc_new, error);
}
} else {
- dbg(0,"Unable to include %s\n",we_files[0]);
+ dbg(lvl_error,"Unable to include %s\n",we_files[0]);
}
file_wordexp_destroy(we);
@@ -787,7 +787,7 @@ strncmp_len(const char *s1, int s1len, const char *s2)
char c[s1len+1];
strncpy(c, s1, s1len);
c[s1len]='\0';
- dbg(0,"'%s' vs '%s'\n", c, s2);
+ dbg(lvl_error,"'%s' vs '%s'\n", c, s2);
#endif
ret=strncmp(s1, s2, s1len);
@@ -832,7 +832,7 @@ xpointer_test(const char *test, int len, struct xistate *elem)
strncpy(test2, test, len);
test2[len]='\0';
- dbg(0,"%s\n", test2);
+ dbg(lvl_error,"%s\n", test2);
#endif
if (!len)
return 0;
@@ -886,7 +886,7 @@ xpointer_xpointer_match(const char *xpointer, int len, struct xistate *first)
{
const char *c;
int s;
- dbg(2,"%s\n", xpointer);
+ dbg(lvl_info,"%s\n", xpointer);
if (xpointer[0] != '/')
return 0;
c=xpointer+1;
@@ -1067,12 +1067,12 @@ xml_parse_text(const char *document, void *data,
context = g_markup_parse_context_new (&parser, 0, data, NULL);
if (!document){
- dbg(0, "FATAL: No XML data supplied (looks like incorrect configuration for internal GUI).\n");
+ dbg(lvl_error, "FATAL: No XML data supplied (looks like incorrect configuration for internal GUI).\n");
exit(1);
}
result = g_markup_parse_context_parse (context, document, strlen(document), NULL);
if (!result){
- dbg(0, "FATAL: Cannot parse data as XML: '%s'\n", document);
+ dbg(lvl_error, "FATAL: Cannot parse data as XML: '%s'\n", document);
exit(1);
}
g_markup_parse_context_free (context);
@@ -1115,7 +1115,7 @@ parse_file(struct xmldocument *document, xmlerror **error)
gboolean result;
char *xmldir,*newxmldir,*xmlfile,*newxmlfile,*sep;
- dbg(1,"enter filename='%s'\n", document->href);
+ dbg(lvl_warning,"enter filename='%s'\n", document->href);
#if GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 12
#define G_MARKUP_TREAT_CDATA_AS_TEXT 0
#endif
@@ -1159,7 +1159,7 @@ parse_file(struct xmldocument *document, xmlerror **error)
unsetenv("XMLFILE");
g_free(newxmldir);
g_free(newxmlfile);
- dbg(1,"return %d\n", result);
+ dbg(lvl_warning,"return %d\n", result);
return result;
}
@@ -1219,7 +1219,7 @@ gboolean config_load(const char *filename, xmlerror **error)
item_create_hash();
initStatic();
- dbg(1,"enter filename='%s'\n", filename);
+ dbg(lvl_warning,"enter filename='%s'\n", filename);
memset(&document, 0, sizeof(document));
document.href=filename;
document.user_data=&curr;
@@ -1230,7 +1230,7 @@ gboolean config_load(const char *filename, xmlerror **error)
}
attr_destroy_hash();
item_destroy_hash();
- dbg(1,"return %d\n", result);
+ dbg(lvl_warning,"return %d\n", result);
return result;
}
@@ -1264,7 +1264,7 @@ struct navit_object *
navit_object_ref(struct navit_object *obj)
{
obj->refcount++;
- dbg(1,"refcount %s %p %d\n",attr_to_name(obj->func->type),obj,obj->refcount);
+ dbg(lvl_warning,"refcount %s %p %d\n",attr_to_name(obj->func->type),obj,obj->refcount);
return obj;
}
@@ -1273,7 +1273,7 @@ navit_object_unref(struct navit_object *obj)
{
if (obj) {
obj->refcount--;
- dbg(1,"refcount %s %p %d\n",attr_to_name(obj->func->type),obj,obj->refcount);
+ dbg(lvl_warning,"refcount %s %p %d\n",attr_to_name(obj->func->type),obj,obj->refcount);
if (obj->refcount <= 0 && obj->func && obj->func->destroy)
obj->func->destroy(obj);
}