| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 1.91

 

xml_free

#include "sflxml.h"
void
xml_free (
    XML_ITEM *item)

Synopsis

Frees all memory used by an XML_ITEM item and its children.

Source Code - (sflxml.c)

{
    ASSERT (item);

    /*  Free attribute nodes for the item                                    */
    while (!list_empty (&item-> attrs))
        xml free attr (item-> attrs.next);

    /*  Free child nodes for the item                                        */
    while (!list_empty (&item-> children))
        xml free (item-> children.next);

    /*  Now free this item itself                                            */
    list unlink (item);                 /*  Unlink from its parent list      */
    mem_strfree (&item-> name);         /*  Free strings, if not null        */
    mem_strfree (&item-> value);
    mem_free    (item);                 /*  And free the item itself         */
}

| << | < | > | >> iMatix Copyright © 1996-98 iMatix