⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reference.html

📁 MINIXml 具有 解析、查找、生成、遍历 功能,一般不是太复杂的应用足够了。可贵的是全部实现是标准c,移植很容易。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlNewOpaque(    <a href='#mxml_node_t'>mxml_node_t</a> * parent,    const char * opaque);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>parent</tt></td><td>Parent node or MXML_NO_PARENT</td></tr><tr><td><tt>opaque</tt></td><td>Opaque string</td></tr></tbody></table></div><h4>Returns</h4><p>New node</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlNewReal'>mxmlNewReal()</a></h3><h4>Description</h4><p>Create a new real number node.<p>The new real number node is added to the end of the specified parent'schild list. The constant MXML_NO_PARENT can be used to specify thatthe new real number node has no parent.<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlNewReal(    <a href='#mxml_node_t'>mxml_node_t</a> * parent,    double real);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>parent</tt></td><td>Parent node or MXML_NO_PARENT</td></tr><tr><td><tt>real</tt></td><td>Real number value</td></tr></tbody></table></div><h4>Returns</h4><p>New node</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlNewText'>mxmlNewText()</a></h3><h4>Description</h4><p>Create a new text fragment node.<p>The new text node is added to the end of the specified parent's childlist. The constant MXML_NO_PARENT can be used to specify that the newtext node has no parent. The whitespace parameter is used to specifywhether leading whitespace is present before the node. The textstring must be nul-terminated and is copied into the new node.<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlNewText(    <a href='#mxml_node_t'>mxml_node_t</a> * parent,    int whitespace,    const char * string);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>parent</tt></td><td>Parent node or MXML_NO_PARENT</td></tr><tr><td><tt>whitespace</tt></td><td>1 = leading whitespace, 0 = no whitespace</td></tr><tr><td><tt>string</tt></td><td>String</td></tr></tbody></table></div><h4>Returns</h4><p>New node</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlNewTextf'>mxmlNewTextf()</a></h3><h4>Description</h4><p>Create a new formatted text fragment node.<p>The new text node is added to the end of the specified parent's childlist. The constant MXML_NO_PARENT can be used to specify that the newtext node has no parent. The whitespace parameter is used to specifywhether leading whitespace is present before the node. The formatstring must be nul-terminated and is formatted into the new node.<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlNewTextf(    <a href='#mxml_node_t'>mxml_node_t</a> * parent,    int whitespace,    const char * format,    ...);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>parent</tt></td><td>Parent node or MXML_NO_PARENT</td></tr><tr><td><tt>whitespace</tt></td><td>1 = leading whitespace, 0 = no whitespace</td></tr><tr><td><tt>format</tt></td><td>Printf-style frmat string</td></tr><tr><td><tt>...</tt></td><td>Additional args as needed</td></tr></tbody></table></div><h4>Returns</h4><p>New node</p><!-- NEW PAGE --><h3 class='title'><span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span><a name='mxmlNewXML'>mxmlNewXML()</a></h3><h4>Description</h4><p>Create a new XML document tree.<p>The &quot;version&quot; argument specifies the version number to put in the?xml element node. If NULL, version 1.0 is assumed.<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlNewXML(    const char * version);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>version</tt></td><td>Version number to use</td></tr></tbody></table></div><h4>Returns</h4><p>New ?xml node</p><!-- NEW PAGE --><h3 class='title'><span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span><a name='mxmlRelease'>mxmlRelease()</a></h3><h4>Description</h4><p>Release a node.<p>When the reference count reaches zero, the node (and any children)is deleted via mxmlDelete().<h4>Syntax</h4><p><tt>int<br>mxmlRelease(    <a href='#mxml_node_t'>mxml_node_t</a> * node);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>node</tt></td><td>Node</td></tr></tbody></table></div><h4>Returns</h4><p>New reference count</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlRemove'>mxmlRemove()</a></h3><h4>Description</h4><p>Remove a node from its parent.<p>Does not free memory used by the node - use mxmlDelete() for that.This function does nothing if the node has no parent.<h4>Syntax</h4><p><tt>void<br>mxmlRemove(    <a href='#mxml_node_t'>mxml_node_t</a> * node);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>node</tt></td><td>Node to remove</td></tr></tbody></table></div><h4>Returns</h4><p>Nothing.</p><!-- NEW PAGE --><h3 class='title'><span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span><a name='mxmlRetain'>mxmlRetain()</a></h3><h4>Description</h4><p>Retain a node.<h4>Syntax</h4><p><tt>int<br>mxmlRetain(    <a href='#mxml_node_t'>mxml_node_t</a> * node);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>node</tt></td><td>Node</td></tr></tbody></table></div><h4>Returns</h4><p>New reference count</p><!-- NEW PAGE --><h3 class='title'><span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span><a name='mxmlSAXLoadFd'>mxmlSAXLoadFd()</a></h3><h4>Description</h4><p>Load a file descriptor into an XML node treeusing a SAX callback.<p>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 asingle parent node like &lt;?xml&gt; for the entire file. The callbackfunction returns the value type that should be used for child nodes.If MXML_NO_CALLBACK is specified then all child nodes will be eitherMXML_ELEMENT or MXML_TEXT nodes.<p>The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loadingchild nodes of the specified type.<p>The SAX callback must call mxmlRetain() for any nodes that need tobe kept for later use. Otherwise, nodes are deleted when the parentnode is closed or after each data, comment, CDATA, or directive node.<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlSAXLoadFd(    <a href='#mxml_node_t'>mxml_node_t</a> * top,    int fd,    <a href='#mxml_load_cb_t'>mxml_load_cb_t</a> cb,    <a href='#mxml_sax_cb_t'>mxml_sax_cb_t</a> sax_cb,    void * sax_data);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>top</tt></td><td>Top node</td></tr><tr><td><tt>fd</tt></td><td>File descriptor to read from</td></tr><tr><td><tt>cb</tt></td><td>Callback function or MXML_NO_CALLBACK</td></tr><tr><td><tt>sax_cb</tt></td><td>SAX callback or MXML_NO_CALLBACK</td></tr><tr><td><tt>sax_data</tt></td><td>SAX user data</td></tr></tbody></table></div><h4>Returns</h4><p>First node or NULL if the file could not be read.</p><!-- NEW PAGE --><h3 class='title'><span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span><a name='mxmlSAXLoadFile'>mxmlSAXLoadFile()</a></h3><h4>Description</h4><p>Load a file into an XML node treeusing a SAX callback.<p>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 asingle parent node like &lt;?xml&gt; for the entire file. The callbackfunction returns the value type that should be used for child nodes.If MXML_NO_CALLBACK is specified then all child nodes will be eitherMXML_ELEMENT or MXML_TEXT nodes.<p>The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loadingchild nodes of the specified type.<p>The SAX callback must call mxmlRetain() for any nodes that need tobe kept for later use. Otherwise, nodes are deleted when the parentnode is closed or after each data, comment, CDATA, or directive node.<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlSAXLoadFile(    <a href='#mxml_node_t'>mxml_node_t</a> * top,    FILE * fp,    <a href='#mxml_load_cb_t'>mxml_load_cb_t</a> cb,    <a href='#mxml_sax_cb_t'>mxml_sax_cb_t</a> sax_cb,    void * sax_data);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>top</tt></td><td>Top node</td></tr><tr><td><tt>fp</tt></td><td>File to read from</td></tr><tr><td><tt>cb</tt></td><td>Callback function or MXML_NO_CALLBACK</td></tr><tr><td><tt>sax_cb</tt></td><td>SAX callback or MXML_NO_CALLBACK</td></tr><tr><td><tt>sax_data</tt></td><td>SAX user data</td></tr></tbody></table></div><h4>Returns</h4><p>First node or NULL if the file could not be read.</p><!-- NEW PAGE --><h3 class='title'><span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span><a name='mxmlSAXLoadString'>mxmlSAXLoadString()</a></h3><h4>Description</h4><p>Load a string into an XML node treeusing a SAX callback.<p>The nodes in the specified string are added to the specified top node.If no top node is provided, the XML string MUST be well-formed with asingle parent node like &lt;?xml&gt; for the entire string. The callbackfunction returns the value type that should be used for child nodes.If MXML_NO_CALLBACK is specified then all child nodes will be eitherMXML_ELEMENT or MXML_TEXT nodes.<p>The constants MXML_INTEGER_CALLBACK, MXML_OPAQUE_CALLBACK,MXML_REAL_CALLBACK, and MXML_TEXT_CALLBACK are defined for loadingchild nodes of the specified type.<p>The SAX callback must call mxmlRetain() for any nodes that need tobe kept for later use. Otherwise, nodes are deleted when the parentnode is closed or after each data, comment, CDATA, or directive node.<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlSAXLoadString(    <a href='#mxml_node_t'>mxml_node_t</a> * top,    const char * s,    <a href='#mxml_load_cb_t'>mxml_load_cb_t</a> cb,    <a href='#mxml_sax_cb_t'>mxml_sax_cb_t</a> sax_cb,    void * sax_data);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>top</tt></td><td>Top node</td></tr><tr><td><tt>s</tt></td><td>String to load</td></tr><tr><td><tt>cb</tt></td><td>Callback function or MXML_NO_CALLBACK</td></tr><tr><td><tt>sax_cb</tt></td><td>SAX callback or MXML_NO_CALLBACK</td></tr><tr><td><tt>sax_data</tt></td><td>SAX user data</td></tr></tbody></table></div><h4>Returns</h4><p>First node or NULL if the string has errors.</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlSaveAllocString'>mxmlSaveAllocString()</a></h3><h4>Description</h4><p>Save an XML node tree to an allocated string.<p>This function returns a pointer to a string containing the textualrepresentation of the XML node tree.  The string should be freedusing the free() function when you are done with it.  NULL is returnedif the node would produce an empty string or if the string cannot beallocated.<p>The callback argument specifies a function that returns a whitespacestring or NULL before and after each element. If MXML_NO_CALLBACKis specified, whitespace will only be added before MXML_TEXT nodeswith leading whitespace and before attribute names inside openingelement tags.<h4>Syntax</h4><p><tt>char *<br>mxmlSaveAllocString(    <a href='#mxml_node_t'>mxml_node_t</a> * node,    <a href='#mxml_save_cb_t'>mxml_save_cb_t</a> cb);</tt></p><h4>Arguments</h4><div class='table'><table align='center' border='1' width='80%' cellpadding='5' cellspacing='0' summary='Arguments'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>node</tt></td><td>Node to write</td></tr><tr><td><tt>cb</tt></td><td>Whitespace callback or MXML_NO_CALLBACK</td></tr></tbody></table></div><h4>Returns</h4><p>Allocated string or NULL</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlSaveFd'>mxmlSaveFd()</a></h3><h4>Description</h4><p>Save an XML tree to a file descriptor.<p>The callback argument specifies a function that returns a whitespace

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -