Moved load of filters or messages files after GTK has entered its main loop to avoid issue when reloading files!
Excluded "MESSAGES_ID_MAX" message from filter. Removed unused function "ui_callback_on_tree_view_select". Change logging level of some logs. git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4321 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -42,12 +42,12 @@ static int parse_attribute_name(xmlNode *node, types_t *type, int mandatory) {
|
||||
xmlAttrPtr node_attribute;
|
||||
if ((node_attribute = xmlHasProp (node, (xmlChar *) "name")) == NULL) {
|
||||
if (mandatory) {
|
||||
PARSER_ERROR("cannot retrieve name attribute in node %s, %s:%ld\n",
|
||||
PARSER_ERROR("cannot retrieve name attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
PARSER_DEBUG("cannot retrieve name attribute in node %s, %s:%ld\n",
|
||||
PARSER_DEBUG("cannot retrieve name attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
return 0;
|
||||
}
|
||||
@@ -59,7 +59,7 @@ static int parse_attribute_name(xmlNode *node, types_t *type, int mandatory) {
|
||||
static int parse_attribute_id(xmlNode *node, types_t *type) {
|
||||
xmlAttrPtr node_attribute;
|
||||
if ((node_attribute = xmlHasProp (node, (xmlChar *) "id")) == NULL) {
|
||||
PARSER_ERROR("cannot retrieve id attribute in node %s, %s:%ld\n",
|
||||
PARSER_ERROR("cannot retrieve id attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
return -1;
|
||||
}
|
||||
@@ -71,13 +71,13 @@ static int parse_attribute_size(xmlNode *node, types_t *type, int mandatory) {
|
||||
xmlAttrPtr node_attribute;
|
||||
if ((node_attribute = xmlHasProp (node, (xmlChar *) "size")) == NULL) {
|
||||
if (mandatory) {
|
||||
PARSER_ERROR("cannot retrieve size attribute in node %s, %s:%ld\n",
|
||||
PARSER_ERROR("cannot retrieve size attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->size = -1;
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
PARSER_DEBUG("cannot retrieve size attribute in node %s, %s:%ld\n",
|
||||
PARSER_DEBUG("cannot retrieve size attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->size = -1;
|
||||
return 0;
|
||||
@@ -91,13 +91,13 @@ static int parse_attribute_align(xmlNode *node, types_t *type, int mandatory) {
|
||||
xmlAttrPtr node_attribute;
|
||||
if ((node_attribute = xmlHasProp (node, (xmlChar *) "align")) == NULL) {
|
||||
if (mandatory) {
|
||||
PARSER_ERROR("cannot retrieve align attribute in node %s, %s:%ld\n",
|
||||
PARSER_ERROR("cannot retrieve align attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->align = -1;
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
PARSER_DEBUG("cannot retrieve align attribute in node %s, %s:%ld\n",
|
||||
PARSER_DEBUG("cannot retrieve align attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->align = -1;
|
||||
return 0;
|
||||
@@ -131,7 +131,7 @@ static int parse_attribute_context(xmlNode *node, types_t *type, int mandatory)
|
||||
xmlAttrPtr node_attribute;
|
||||
if ((node_attribute = xmlHasProp (node, (xmlChar *) "context")) == NULL) {
|
||||
if (mandatory) {
|
||||
PARSER_ERROR("cannot retrieve context attribute in node %s, %s:%ld\n",
|
||||
PARSER_ERROR("cannot retrieve context attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->context = -1;
|
||||
return -1;
|
||||
@@ -148,7 +148,7 @@ static int parse_attribute_context(xmlNode *node, types_t *type, int mandatory)
|
||||
static int parse_attribute_artificial(xmlNode *node, types_t *type) {
|
||||
xmlAttrPtr node_attribute;
|
||||
if ((node_attribute = xmlHasProp (node, (xmlChar *) "artificial")) == NULL) {
|
||||
PARSER_DEBUG("cannot retrieve artificial attribute in node %s, %s:%ld\n",
|
||||
PARSER_DEBUG("cannot retrieve artificial attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->artificial = -1;
|
||||
return 0;
|
||||
@@ -160,7 +160,7 @@ static int parse_attribute_artificial(xmlNode *node, types_t *type) {
|
||||
static int parse_attribute_init(xmlNode *node, types_t *type) {
|
||||
xmlAttrPtr node_attribute;
|
||||
if ((node_attribute = xmlHasProp (node, (xmlChar *) "init")) == NULL) {
|
||||
PARSER_ERROR("cannot retrieve init attribute in node %s, %s:%ld\n",
|
||||
PARSER_ERROR("cannot retrieve init attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->init_value = -1;
|
||||
return 0;
|
||||
@@ -173,13 +173,13 @@ static int parse_attribute_members(xmlNode *node, types_t *type, int mandatory)
|
||||
xmlAttrPtr node_attribute;
|
||||
if ((node_attribute = xmlHasProp (node, (xmlChar *) "members")) == NULL) {
|
||||
if (mandatory) {
|
||||
PARSER_ERROR("cannot retrieve members attribute in node %s, %s:%ld\n",
|
||||
PARSER_ERROR("cannot retrieve members attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->members = 0;
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
PARSER_DEBUG("cannot retrieve members attribute in node %s, %s:%ld\n",
|
||||
PARSER_DEBUG("cannot retrieve members attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->members = 0;
|
||||
return 0;
|
||||
@@ -193,13 +193,13 @@ static int parse_attribute_mangled(xmlNode *node, types_t *type, int mandatory)
|
||||
xmlAttrPtr node_attribute;
|
||||
if ((node_attribute = xmlHasProp (node, (xmlChar *) "mangled")) == NULL) {
|
||||
if (mandatory) {
|
||||
PARSER_ERROR("cannot retrieve mangled attribute in node %s, %s:%ld\n",
|
||||
PARSER_ERROR("cannot retrieve mangled attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->mangled = 0;
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
PARSER_DEBUG("cannot retrieve mangled attribute in node %s, %s:%ld\n",
|
||||
PARSER_DEBUG("cannot retrieve mangled attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->mangled = 0;
|
||||
return 0;
|
||||
@@ -213,13 +213,13 @@ static int parse_attribute_demangled(xmlNode *node, types_t *type, int mandatory
|
||||
xmlAttrPtr node_attribute;
|
||||
if ((node_attribute = xmlHasProp (node, (xmlChar *) "mangled")) == NULL) {
|
||||
if (mandatory) {
|
||||
PARSER_ERROR("cannot retrieve demangled attribute in node %s, %s:%ld\n",
|
||||
PARSER_ERROR("cannot retrieve demangled attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->demangled = 0;
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
PARSER_DEBUG("cannot retrieve demangled attribute in node %s, %s:%ld\n",
|
||||
PARSER_DEBUG("cannot retrieve demangled attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->demangled = 0;
|
||||
return 0;
|
||||
@@ -233,13 +233,13 @@ static int parse_attribute_offset(xmlNode *node, types_t *type, int mandatory) {
|
||||
xmlAttrPtr node_attribute;
|
||||
if ((node_attribute = xmlHasProp (node, (xmlChar *) "offset")) == NULL) {
|
||||
if (mandatory) {
|
||||
PARSER_ERROR("cannot retrieve offset attribute in node %s, %s:%ld\n",
|
||||
PARSER_ERROR("cannot retrieve offset attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->offset = -1;
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
PARSER_DEBUG("cannot retrieve offset attribute in node %s, %s:%ld\n",
|
||||
PARSER_DEBUG("cannot retrieve offset attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->offset = -1;
|
||||
return 0;
|
||||
@@ -253,13 +253,13 @@ static int parse_attribute_bits(xmlNode *node, types_t *type, int mandatory) {
|
||||
xmlAttrPtr node_attribute;
|
||||
if ((node_attribute = xmlHasProp (node, (xmlChar *) "bits")) == NULL) {
|
||||
if (mandatory) {
|
||||
PARSER_ERROR("cannot retrieve bits attribute in node %s, %s:%ld\n",
|
||||
PARSER_ERROR("cannot retrieve bits attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->bits = -1;
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
PARSER_DEBUG("cannot retrieve bits attribute in node %s, %s:%ld\n",
|
||||
PARSER_DEBUG("cannot retrieve bits attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->bits = -1;
|
||||
return 0;
|
||||
@@ -273,13 +273,13 @@ static int parse_attribute_type(xmlNode *node, types_t *type, int mandatory) {
|
||||
xmlAttrPtr node_attribute;
|
||||
if ((node_attribute = xmlHasProp (node, (xmlChar *) "type")) == NULL) {
|
||||
if (mandatory) {
|
||||
PARSER_ERROR("cannot retrieve type attribute in node %s, %s:%ld\n",
|
||||
PARSER_ERROR("cannot retrieve type attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->type_xml = 0;
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
PARSER_DEBUG("cannot retrieve type attribute in node %s, %s:%ld\n",
|
||||
PARSER_DEBUG("cannot retrieve type attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->type_xml = 0;
|
||||
return 0;
|
||||
@@ -293,13 +293,13 @@ static int parse_attribute_min(xmlNode *node, types_t *type, int mandatory) {
|
||||
xmlAttrPtr node_attribute;
|
||||
if ((node_attribute = xmlHasProp (node, (xmlChar *) "min")) == NULL) {
|
||||
if (mandatory) {
|
||||
PARSER_ERROR("cannot retrieve min attribute in node %s, %s:%ld\n",
|
||||
PARSER_ERROR("cannot retrieve min attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->min = 0;
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
PARSER_DEBUG("cannot retrieve min attribute in node %s, %s:%ld\n",
|
||||
PARSER_DEBUG("cannot retrieve min attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->min = 0;
|
||||
return 0;
|
||||
@@ -313,13 +313,13 @@ static int parse_attribute_max(xmlNode *node, types_t *type, int mandatory) {
|
||||
xmlAttrPtr node_attribute;
|
||||
if ((node_attribute = xmlHasProp (node, (xmlChar *) "max")) == NULL) {
|
||||
if (mandatory) {
|
||||
PARSER_ERROR("cannot retrieve max attribute in node %s, %s:%ld\n",
|
||||
PARSER_ERROR("cannot retrieve max attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->max = 0;
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
PARSER_DEBUG("cannot retrieve max attribute in node %s, %s:%ld\n",
|
||||
PARSER_DEBUG("cannot retrieve max attribute in node %s, %s:%ld",
|
||||
(char *)node->name, node->doc->URL, XML_GET_LINE(node));
|
||||
type->max = 0;
|
||||
return 0;
|
||||
@@ -660,7 +660,7 @@ int xml_parse_buffer(const char *xml_buffer, const int size) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
g_debug("Parsing XML definition from buffer");
|
||||
g_message("Parsing XML definition from buffer ...");
|
||||
|
||||
/* This initialize the library and check potential ABI mismatches
|
||||
* between the version it was compiled for and the actual shared
|
||||
@@ -695,7 +695,7 @@ int xml_parse_file(const char *filename) {
|
||||
doc = xmlReadFile (filename, NULL, 0);
|
||||
|
||||
if (doc == NULL) {
|
||||
g_warning("Failed to parse %s\n", filename);
|
||||
g_warning("Failed to parse %s", filename);
|
||||
// ui_notification_dialog(DIALOG_WARNING, "Failed to parse file %s", filename);
|
||||
return RC_FAIL;
|
||||
}
|
||||
@@ -713,8 +713,12 @@ static int update_filters() {
|
||||
{
|
||||
types = types->child;
|
||||
|
||||
while (types != NULL) {
|
||||
ui_filters_add(FILTER_MESSAGES, types->init_value, types->name);
|
||||
while (types != NULL)
|
||||
{
|
||||
if (strcmp (types->name, "MESSAGES_ID_MAX") != 0)
|
||||
{
|
||||
ui_filters_add (FILTER_MESSAGES, types->init_value, types->name);
|
||||
}
|
||||
types = types->next;
|
||||
}
|
||||
}
|
||||
@@ -789,6 +793,9 @@ static int xml_parse_doc(xmlDocPtr doc) {
|
||||
}
|
||||
|
||||
fclose (dissect_file);
|
||||
|
||||
g_message("Parsed XML definition");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -801,7 +808,7 @@ int dissect_signal(buffer_t *buffer, ui_set_signal_text_cb_t ui_set_signal_text_
|
||||
}
|
||||
|
||||
if (buffer == NULL) {
|
||||
g_error("Failed buffer is NULL\n");
|
||||
g_error("Failed buffer is NULL");
|
||||
return RC_FAIL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user