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

📄 reference.html

📁 MINIXml 具有 解析、查找、生成、遍历 功能,一般不是太复杂的应用足够了。可贵的是全部实现是标准c,移植很容易。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
string 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>int<br>mxmlSaveFd(    <a href='#mxml_node_t'>mxml_node_t</a> * node,    int fd,    <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>fd</tt></td><td>File descriptor to write to</td></tr><tr><td><tt>cb</tt></td><td>Whitespace callback or MXML_NO_CALLBACK</td></tr></tbody></table></div><h4>Returns</h4><p>0 on success, -1 on error.</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlSaveFile'>mxmlSaveFile()</a></h3><h4>Description</h4><p>Save an XML tree to a file.<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>int<br>mxmlSaveFile(    <a href='#mxml_node_t'>mxml_node_t</a> * node,    FILE * fp,    <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>fp</tt></td><td>File to write to</td></tr><tr><td><tt>cb</tt></td><td>Whitespace callback or MXML_NO_CALLBACK</td></tr></tbody></table></div><h4>Returns</h4><p>0 on success, -1 on error.</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlSaveString'>mxmlSaveString()</a></h3><h4>Description</h4><p>Save an XML node tree to a string.<p>This function returns the total number of bytes that would berequired for the string but only copies (bufsize - 1) charactersinto the specified buffer.<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>int<br>mxmlSaveString(    <a href='#mxml_node_t'>mxml_node_t</a> * node,    char * buffer,    int bufsize,    <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>buffer</tt></td><td>String buffer</td></tr><tr><td><tt>bufsize</tt></td><td>Size of string buffer</td></tr><tr><td><tt>cb</tt></td><td>Whitespace callback or MXML_NO_CALLBACK</td></tr></tbody></table></div><h4>Returns</h4><p>Size of string</p><!-- NEW PAGE --><h3 class='title'><span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span><a name='mxmlSetCDATA'>mxmlSetCDATA()</a></h3><h4>Description</h4><p>Set the element name of a CDATA node.<p>The node is not changed if it is not a CDATA element node.<h4>Syntax</h4><p><tt>int<br>mxmlSetCDATA(    <a href='#mxml_node_t'>mxml_node_t</a> * node,    const char * 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>node</tt></td><td>Node to set</td></tr><tr><td><tt>data</tt></td><td>New data string</td></tr></tbody></table></div><h4>Returns</h4><p>0 on success, -1 on failure</p><!-- NEW PAGE --><h3 class='title'><span class='info'>&nbsp;Mini-XML 2.1&nbsp;</span><a name='mxmlSetCustom'>mxmlSetCustom()</a></h3><h4>Description</h4><p>Set the data and destructor of a custom data node.<p>The node is not changed if it is not a custom node.<h4>Syntax</h4><p><tt>int<br>mxmlSetCustom(    <a href='#mxml_node_t'>mxml_node_t</a> * node,    void * data,    <a href='#mxml_custom_destroy_cb_t'>mxml_custom_destroy_cb_t</a> destroy);</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 set</td></tr><tr><td><tt>data</tt></td><td>New data pointer</td></tr><tr><td><tt>destroy</tt></td><td>New destructor function</td></tr></tbody></table></div><h4>Returns</h4><p>0 on success, -1 on failure</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlSetCustomHandlers'>mxmlSetCustomHandlers()</a></h3><h4>Description</h4><p>Set the handling functions for custom data.<p>The load function accepts a node pointer and a data string and mustreturn 0 on success and non-zero on error.<p>The save function accepts a node pointer and must return a malloc'dstring on success and NULL on error.<h4>Syntax</h4><p><tt>void<br>mxmlSetCustomHandlers(    <a href='#mxml_custom_load_cb_t'>mxml_custom_load_cb_t</a> load,    <a href='#mxml_custom_save_cb_t'>mxml_custom_save_cb_t</a> save);</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>load</tt></td><td>Load function</td></tr><tr><td><tt>save</tt></td><td>Save function</td></tr></tbody></table></div><h4>Returns</h4><p>Nothing.</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlSetElement'>mxmlSetElement()</a></h3><h4>Description</h4><p>Set the name of an element node.<p>The node is not changed if it is not an element node.<h4>Syntax</h4><p><tt>int<br>mxmlSetElement(    <a href='#mxml_node_t'>mxml_node_t</a> * node,    const char * name);</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 set</td></tr><tr><td><tt>name</tt></td><td>New name string</td></tr></tbody></table></div><h4>Returns</h4><p>0 on success, -1 on failure</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlSetErrorCallback'>mxmlSetErrorCallback()</a></h3><h4>Description</h4><p>Set the error message callback.<h4>Syntax</h4><p><tt>void<br>mxmlSetErrorCallback(    <a href='#mxml_error_cb_t'>mxml_error_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>cb</tt></td><td>Error callback function</td></tr></tbody></table></div><h4>Returns</h4><p>Nothing.</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlSetInteger'>mxmlSetInteger()</a></h3><h4>Description</h4><p>Set the value of an integer node.<p>The node is not changed if it is not an integer node.<h4>Syntax</h4><p><tt>int<br>mxmlSetInteger(    <a href='#mxml_node_t'>mxml_node_t</a> * node,    int integer);</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 set</td></tr><tr><td><tt>integer</tt></td><td>Integer value</td></tr></tbody></table></div><h4>Returns</h4><p>0 on success, -1 on failure</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlSetOpaque'>mxmlSetOpaque()</a></h3><h4>Description</h4><p>Set the value of an opaque node.<p>The node is not changed if it is not an opaque node.<h4>Syntax</h4><p><tt>int<br>mxmlSetOpaque(    <a href='#mxml_node_t'>mxml_node_t</a> * node,    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>node</tt></td><td>Node to set</td></tr><tr><td><tt>opaque</tt></td><td>Opaque string</td></tr></tbody></table></div><h4>Returns</h4><p>0 on success, -1 on failure</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlSetReal'>mxmlSetReal()</a></h3><h4>Description</h4><p>Set the value of a real number node.<p>The node is not changed if it is not a real number node.<h4>Syntax</h4><p><tt>int<br>mxmlSetReal(    <a href='#mxml_node_t'>mxml_node_t</a> * node,    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>node</tt></td><td>Node to set</td></tr><tr><td><tt>real</tt></td><td>Real number value</td></tr></tbody></table></div><h4>Returns</h4><p>0 on success, -1 on failure</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlSetText'>mxmlSetText()</a></h3><h4>Description</h4><p>Set the value of a text node.<p>The node is not changed if it is not a text node.<h4>Syntax</h4><p><tt>int<br>mxmlSetText(    <a href='#mxml_node_t'>mxml_node_t</a> * node,    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>node</tt></td><td>Node to set</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>0 on success, -1 on failure</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlSetTextf'>mxmlSetTextf()</a></h3><h4>Description</h4><p>Set the value of a text node to a formatted string.<p>The node is not changed if it is not a text node.<h4>Syntax</h4><p><tt>int<br>mxmlSetTextf(    <a href='#mxml_node_t'>mxml_node_t</a> * node,    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>node</tt></td><td>Node to set</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 format string</td></tr><tr><td><tt>...</tt></td><td>Additional arguments as needed</td></tr></tbody></table></div><h4>Returns</h4><p>0 on success, -1 on failure</p><!-- NEW PAGE --><h3 class='title'><span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span><a name='mxmlSetWrapMargin'>mxmlSetWrapMargin()</a></h3><h4>Description</h4><p>Set the the wrap margin when saving XML data.<p>Wrapping is disabled when &quot;column&quot; is &lt;= 0.<h4>Syntax</h4><p><tt>void<br>mxmlSetWrapMargin(    int column);</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>column</tt></td><td>Column for wrapping</td></tr></tbody></table></div><h4>Returns</h4><p>Nothing.</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlWalkNext'>mxmlWalkNext()</a></h3><h4>Description</h4><p>Walk to the next logical node in the tree.<p>The descend argument controls whether the first child is consideredto be the next node. The top node argument constrains the walk tothe node's children.<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>mxmlWalkNext(

⌨️ 快捷键说明

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