XMLAPI int xml_is (XML * xml, const char * name)
{
if (!xml) return 0;
if (!xml->name) return 0;
if (!strcmp (xml->name, name)) return 1;
return 0;
}
XMLAPI int xml_is_element (XML * xml)
{
if (!xml) return 0;
if (!xml->name) return 0;
return 1;
}
|
XMLAPI const char * xml_name (XML * xml)
{
if (!xml) return 0;
return xml->name;
}
|
XMLAPI XML * xml_parent (XML * xml)
{
if (!xml) return 0;
return xml->parent; /* Null if none, guaranteed. */
}
|
XMLAPI void * xml_getbin (XML * xml)
{
if (!xml) return 0;
return xml->extra;
}
XMLAPI void xml_setbin (XML * xml, void * bin, void (*cleanup) (void *))
{
if (!xml) return;
xml->extra = bin;
xml->cleanup = cleanup;
}
|
XMLAPI void xml_rename (XML * xml, const char * name)
{
if (!xml) return;
if (!name) return;
free (xml->name);
xml->name = strdup (name);
}
|
| This code and documentation are released under the terms of the GNU license. They are copyright (c) 2000-2003, Vivtek. All rights reserved except those explicitly granted under the terms of the GNU license. This presentation was created using LPML. |