* Eet: Add a clean way to create struct child.

SVN revision: 41053
This commit is contained in:
Cedric BAIL 2009-06-15 16:48:31 +00:00
parent 0839ec65ea
commit e0c6b0df8d
2 changed files with 17 additions and 0 deletions

View File

@ -1376,6 +1376,7 @@ eet_dictionary_string_check * example: values), and @p type is the basic data
EAPI Eet_Node *eet_node_var_array_new(const char *name, Eina_List *nodes);
EAPI Eet_Node *eet_node_hash_new(const char *name, const char *key, Eet_Node *node);
EAPI Eet_Node *eet_node_struct_new(const char *name, Eina_List *nodes);
EAPI Eet_Node *eet_node_struct_child_new(const char *parent, Eet_Node *child);
EAPI void eet_node_del(Eet_Node *n);
EAPI void *eet_data_node_encode_cipher(Eet_Node *node, const char *key, int *size_ret);

View File

@ -160,6 +160,22 @@ eet_node_struct_new(const char *name, Eina_List *nodes)
return n;
}
Eet_Node *
eet_node_struct_child_new(const char *parent, Eet_Node *child)
{
Eet_Node *n;
if (child->type != EET_G_UNKNOWN)
return child;
n = _eet_node_new(parent, EET_G_UNKNOWN);
if (!n) return NULL;
_eet_node_append(n, eina_list_prepend(NULL, child));
return n;
}
void
eet_node_del(Eet_Node *n)
{