/** * Move the current xml to its next sibling, return NULL and move to parent * at the end of the list * @param xml The xml document * @return The current xml tag name or NULL * @ingroup EXML_Traversal_Group */ char *exml_next_nomove(EXML *xml) { Ecore_List *p_list; EXML_Node *parent, *cur; CHECK_PARAM_POINTER_RETURN("xml", xml, NULL); if (xml->current) { cur = xml->current; parent = cur->parent; if (parent) { p_list = parent->children; ecore_list_goto( p_list, xml->current ); ecore_list_next( p_list ); if ((xml->current = ecore_list_current(p_list)) == NULL) { xml->current = cur; return NULL; } } else xml->current = NULL; } return xml->current ? xml->current->tag : NULL; }
/** * Remove the current node from the document * @param xml The xml document to modify * @return @c TRUE if successful, @c FALSE if an error occurs. * @ingroup EXML_Modfiy_Element_Group */ int exml_tag_remove(EXML *xml) { EXML_Node *n_cur; CHECK_PARAM_POINTER_RETURN("xml", xml, FALSE); n_cur = xml->current; if (!n_cur) return FALSE; n_cur = n_cur->parent; if (n_cur) { EXML_Node *c_parent = n_cur; Ecore_List *c_list = c_parent->children; ecore_list_goto( c_list, xml->current ); ecore_list_remove_destroy( c_list ); if ((n_cur = ecore_list_current( c_list )) == NULL) if ((n_cur = ecore_list_last_goto( c_list )) == NULL) n_cur = c_parent; } else { /* we're removing the top level node */ xml->top = NULL; _exml_node_destroy( xml->current ); } xml->current = n_cur; return TRUE; }
/** * Move the current xml document pointer to the indicated node * @param xml The xml document * @param node The position within the document to move to * @return The current xml tag name * @ingroup EXML_Traversal_Group */ char *exml_goto_node(EXML *xml, EXML_Node *node) { Ecore_List *stack; EXML_Node *n, *l; CHECK_PARAM_POINTER_RETURN("xml", xml, NULL); stack = ecore_list_new(); n = node; while( n->parent != NULL ) { ecore_list_prepend(stack, n); n = n->parent; } l = xml->top; if (n != l) return NULL; while( (n = ecore_list_first_remove(stack)) ) { l = ecore_list_goto(l->children, n); if (!l) return NULL; } xml->current = node; return xml->current ? xml->current->tag : NULL; }
static void MenuDestroy(Menu * m) { if (!m) return; if (!ecore_list_goto(menu_list, m)) return; MenuHide(m); MenuEmpty(m, 1); if (m->ref_count) return; ecore_list_node_remove(menu_list, m); if (m->win) EDestroyWindow(m->win); Efree(m->name); Efree(m->alias); Efree(m->title); Efree(m->data); Efree(m); }
/** * Free memory allocated by a call to exml_transform_mem_write * @param xsl The xml stylesheet * @param ptr The xslt buffer * @return nothing * @ingroup EXML_XSLT_Group */ void exml_transform_mem_free( EXML_XSL *xsl, void *ptr ) { CHECK_PARAM_POINTER("xsl", xsl); /** * xmlFree as destroy cb will take care of business for us */ if( ecore_list_goto(xsl->buffers, ptr) == ptr ) ecore_list_remove_destroy(ptr); }