Added error strings for return code.
Added a function to free previous message definitions. Added some asserts. fixed a warning issue. Added an error notification when message definitions parse failed. git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4507 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include "logs.h"
|
||||
#include "rc.h"
|
||||
|
||||
#include "types.h"
|
||||
@@ -12,19 +13,20 @@
|
||||
#include "locate_root.h"
|
||||
#include "xml_parse.h"
|
||||
|
||||
types_t *messages_id_enum = NULL;
|
||||
types_t *lte_time_type = NULL;
|
||||
types_t *lte_time_frame_type = NULL;
|
||||
types_t *lte_time_slot_type = NULL;
|
||||
types_t *origin_task_id_type = NULL;
|
||||
types_t *destination_task_id_type = NULL;
|
||||
types_t *instance_type = NULL;
|
||||
types_t *message_header_type = NULL;
|
||||
types_t *message_type = NULL;
|
||||
types_t *message_size_type = NULL;
|
||||
types_t *messages_id_enum;
|
||||
types_t *lte_time_type;
|
||||
types_t *lte_time_frame_type;
|
||||
types_t *lte_time_slot_type;
|
||||
types_t *origin_task_id_type;
|
||||
types_t *destination_task_id_type;
|
||||
types_t *instance_type;
|
||||
types_t *message_header_type;
|
||||
types_t *message_type;
|
||||
types_t *message_size_type;
|
||||
|
||||
int locate_root(const char *root_name, types_t *head, types_t **root_elm) {
|
||||
types_t *next_type;
|
||||
int next_counter = 0;
|
||||
|
||||
/* The root element is for example : MessageDef.
|
||||
* This element is the entry for other sub-types.
|
||||
@@ -49,13 +51,17 @@ int locate_root(const char *root_name, types_t *head, types_t **root_elm) {
|
||||
/* Matching reference */
|
||||
break;
|
||||
}
|
||||
next_counter ++;
|
||||
}
|
||||
g_info("locate_root: %s %d", root_name, next_counter);
|
||||
|
||||
*root_elm = next_type;
|
||||
return (next_type == NULL) ? -2 : 0;
|
||||
}
|
||||
|
||||
int locate_type(const char *type_name, types_t *head, types_t **type) {
|
||||
types_t *next_type;
|
||||
int next_counter = 0;
|
||||
|
||||
/* The root element is for example : MessageDef.
|
||||
* This element is the entry for other sub-types.
|
||||
@@ -76,7 +82,10 @@ int locate_type(const char *type_name, types_t *head, types_t **type) {
|
||||
/* Matching reference */
|
||||
break;
|
||||
}
|
||||
next_counter ++;
|
||||
}
|
||||
g_info("locate_type: %s %d", type_name, next_counter);
|
||||
|
||||
if (type)
|
||||
*type = next_type;
|
||||
return (next_type == NULL) ? RC_FAIL : RC_OK;
|
||||
|
||||
Reference in New Issue
Block a user