void xml_node_attribute_insert (xml_GNode* node,
gchar* key, gchar* value)
{
if (! key) return;
___ xml_AttrList* list = node->attributes;
if (! list)
{
node->attributes = xml_attr_list_new0 (key, value);
return;
} |
next:
___ int cmp = strcmp (list->data->name, key);
if (cmp < 0)
{
if (list->next) { list = list->next; goto next; } |
list->next = xml_attr_list_new0 (key, value);
list->next->prev = list;
return;
} |
if (cmp == 0)
{
g_free (key);
g_free (list->data->value);
list->data->value = value;
return;
} |
____;
node->attributes = xml_attr_list_insert_before (node->attributes,
list, xml_attr_data_new0 (key, value));
____;
} |
|