2017-01-27 18:16:33 -05:00
|
|
|
#ifndef __MXML_COMPAT_H__
|
|
|
|
#define __MXML_COMPAT_H__
|
|
|
|
|
|
|
|
/* For compability with mxml 2.6 */
|
|
|
|
#ifndef HAVE_MXMLGETTEXT
|
2017-01-27 18:45:44 -05:00
|
|
|
__attribute__((unused)) static const char * /* O - Text string or NULL */
|
2017-01-27 18:16:33 -05:00
|
|
|
mxmlGetText(mxml_node_t *node, /* I - Node to get */
|
|
|
|
int *whitespace) /* O - 1 if string is preceded by whitespace, 0 otherwise */
|
|
|
|
{
|
|
|
|
if (node->type == MXML_TEXT)
|
|
|
|
return (node->value.text.string);
|
|
|
|
else if (node->type == MXML_ELEMENT &&
|
|
|
|
node->child &&
|
|
|
|
node->child->type == MXML_TEXT)
|
|
|
|
return (node->child->value.text.string);
|
|
|
|
else
|
|
|
|
return (NULL);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_MXMLGETOPAQUE
|
2017-01-27 18:45:44 -05:00
|
|
|
__attribute__((unused)) static const char * /* O - Opaque string or NULL */
|
2017-01-27 18:16:33 -05:00
|
|
|
mxmlGetOpaque(mxml_node_t *node) /* I - Node to get */
|
|
|
|
{
|
|
|
|
if (!node)
|
|
|
|
return (NULL);
|
|
|
|
|
|
|
|
if (node->type == MXML_OPAQUE)
|
|
|
|
return (node->value.opaque);
|
|
|
|
else if (node->type == MXML_ELEMENT &&
|
|
|
|
node->child &&
|
|
|
|
node->child->type == MXML_OPAQUE)
|
|
|
|
return (node->child->value.opaque);
|
|
|
|
else
|
|
|
|
return (NULL);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_MXMLGETFIRSTCHILD
|
2017-01-27 18:45:44 -05:00
|
|
|
__attribute__((unused)) static mxml_node_t * /* O - First child or NULL */
|
2017-01-27 18:16:33 -05:00
|
|
|
mxmlGetFirstChild(mxml_node_t *node) /* I - Node to get */
|
|
|
|
{
|
|
|
|
if (!node || node->type != MXML_ELEMENT)
|
|
|
|
return (NULL);
|
|
|
|
|
|
|
|
return (node->child);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_MXMLGETTYPE
|
2017-01-27 18:45:44 -05:00
|
|
|
__attribute__((unused)) static mxml_type_t /* O - Type of node */
|
2017-01-27 18:16:33 -05:00
|
|
|
mxmlGetType(mxml_node_t *node) /* I - Node to get */
|
|
|
|
{
|
|
|
|
return (node->type);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* !__MXML_COMPAT_H__ */
|