Contents Previous Next

mxmlLoadFd()


Description

Load a file descriptor into an XML node tree. The nodes in the specified file are added to the specified top node. If no top node is provided, the XML file MUST be well-formed with a single parent node like <?xml> for the entire file. The callback function returns the value type that should be used for child nodes. If MXML_NO_CALLBACK is specified then all child nodes will be either MXML_ELEMENT or MXML_TEXT nodes. The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK, MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loading child nodes of the specified type.

Syntax

mxml_node_t *
mxmlLoadFd(
    mxml_node_t * top,
    int fd,
    mxml_type_t (*cb)(mxml_node_t *node));

Arguments

NameDescription
topTop node
fdFile descriptor to read from
(*cb)(mxml_node_t *node)Callback function or MXML_NO_CALLBACK

Returns

First node or NULL if the file could not be read.


Contents Previous Next