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

📄 reference.html

📁 MINIXml 具有 解析、查找、生成、遍历 功能,一般不是太复杂的应用足够了。可贵的是全部实现是标准c,移植很容易。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html><head>	<title>Documentation</title>	<meta name='creator' content='Mini-XML v2.3'>	<style type='text/css'><!--	h1, h2, h3, p { font-family: sans-serif; text-align: justify; }	tt, pre a:link, pre a:visited, tt a:link, tt a:visited { font-weight: bold; color: #7f0000; }	pre { font-weight: bold; color: #7f0000; margin-left: 2em; }	span.info { background: #000000; border: solid thin #000000; color: #ffffff; font-size: 80%; font-style: italic; font-weight: bold; white-space: nowrap; }	h3 span.info { float: right; font-size: 100%; }	h1.title, h2.title, h3.title { border-bottom: solid 2px #000000; }	--></style></head><body><h2 class='title'>Contents</h2><ul>	<li><a href='#ENUMERATIONS'>Enumerations</a></li>	<li><a href='#FUNCTIONS'>Functions</a></li>	<li><a href='#STRUCTURES'>Structures</a></li>	<li><a href='#TYPES'>Types</a></li>	<li><a href='#UNIONS'>Unions</a></li></ul><!-- NEW PAGE --><h2 class='title'><a name='ENUMERATIONS'>Enumerations</a></h2><ul>	<li><a href='#mxml_sax_event_e'><tt>mxml_sax_event_e</tt></a> </li>	<li><a href='#mxml_type_e'><tt>mxml_type_e</tt></a> </li></ul><!-- NEW PAGE --><h3 class='title'><a name='mxml_sax_event_e'>mxml_sax_event_e</a></h3><h4>Description</h4><p>SAX event type.<h4>Values</h4><div class='table'><table align='center' border='1' width='80%' summary='Values'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>MXML_SAX_CDATA</tt> </td><td>CDATA node</td></tr><tr><td><tt>MXML_SAX_COMMENT</tt> </td><td>Comment node</td></tr><tr><td><tt>MXML_SAX_DATA</tt> </td><td>Data node</td></tr><tr><td><tt>MXML_SAX_DIRECTIVE</tt> </td><td>Processing directive node</td></tr><tr><td><tt>MXML_SAX_ELEMENT_CLOSE</tt> </td><td>Element closed</td></tr><tr><td><tt>MXML_SAX_ELEMENT_OPEN</tt> </td><td>Element opened</td></tr></tbody></table></div><!-- NEW PAGE --><h3 class='title'><a name='mxml_type_e'>mxml_type_e</a></h3><h4>Description</h4><p>The XML node type.<h4>Values</h4><div class='table'><table align='center' border='1' width='80%' summary='Values'><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><tt>MXML_CUSTOM</tt> <span class='info'>&nbsp;Mini-XML 2.1&nbsp;</span></td><td>Custom data </td></tr><tr><td><tt>MXML_ELEMENT</tt> </td><td>XML element with attributes</td></tr><tr><td><tt>MXML_IGNORE</tt> <span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span></td><td>Ignore/throw away node </td></tr><tr><td><tt>MXML_INTEGER</tt> </td><td>Integer value</td></tr><tr><td><tt>MXML_OPAQUE</tt> </td><td>Opaque string</td></tr><tr><td><tt>MXML_REAL</tt> </td><td>Real value</td></tr><tr><td><tt>MXML_TEXT</tt> </td><td>Text fragment</td></tr></tbody></table></div><!-- NEW PAGE --><h2 class='title'><a name='FUNCTIONS'>Functions</a></h2><ul>	<li><a href='#mxmlAdd'><tt>mxmlAdd()</tt></a> </li>	<li><a href='#mxmlDelete'><tt>mxmlDelete()</tt></a> </li>	<li><a href='#mxmlElementGetAttr'><tt>mxmlElementGetAttr()</tt></a> </li>	<li><a href='#mxmlElementSetAttr'><tt>mxmlElementSetAttr()</tt></a> </li>	<li><a href='#mxmlElementSetAttrf'><tt>mxmlElementSetAttrf()</tt></a> <span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span></li>	<li><a href='#mxmlEntityAddCallback'><tt>mxmlEntityAddCallback()</tt></a> </li>	<li><a href='#mxmlEntityGetName'><tt>mxmlEntityGetName()</tt></a> </li>	<li><a href='#mxmlEntityGetValue'><tt>mxmlEntityGetValue()</tt></a> </li>	<li><a href='#mxmlEntityRemoveCallback'><tt>mxmlEntityRemoveCallback()</tt></a> </li>	<li><a href='#mxmlFindElement'><tt>mxmlFindElement()</tt></a> </li>	<li><a href='#mxmlIndexDelete'><tt>mxmlIndexDelete()</tt></a> </li>	<li><a href='#mxmlIndexEnum'><tt>mxmlIndexEnum()</tt></a> </li>	<li><a href='#mxmlIndexFind'><tt>mxmlIndexFind()</tt></a> </li>	<li><a href='#mxmlIndexNew'><tt>mxmlIndexNew()</tt></a> </li>	<li><a href='#mxmlIndexReset'><tt>mxmlIndexReset()</tt></a> </li>	<li><a href='#mxmlLoadFd'><tt>mxmlLoadFd()</tt></a> </li>	<li><a href='#mxmlLoadFile'><tt>mxmlLoadFile()</tt></a> </li>	<li><a href='#mxmlLoadString'><tt>mxmlLoadString()</tt></a> </li>	<li><a href='#mxmlNewCDATA'><tt>mxmlNewCDATA()</tt></a> <span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span></li>	<li><a href='#mxmlNewCustom'><tt>mxmlNewCustom()</tt></a> <span class='info'>&nbsp;Mini-XML 2.1&nbsp;</span></li>	<li><a href='#mxmlNewElement'><tt>mxmlNewElement()</tt></a> </li>	<li><a href='#mxmlNewInteger'><tt>mxmlNewInteger()</tt></a> </li>	<li><a href='#mxmlNewOpaque'><tt>mxmlNewOpaque()</tt></a> </li>	<li><a href='#mxmlNewReal'><tt>mxmlNewReal()</tt></a> </li>	<li><a href='#mxmlNewText'><tt>mxmlNewText()</tt></a> </li>	<li><a href='#mxmlNewTextf'><tt>mxmlNewTextf()</tt></a> </li>	<li><a href='#mxmlNewXML'><tt>mxmlNewXML()</tt></a> <span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span></li>	<li><a href='#mxmlRelease'><tt>mxmlRelease()</tt></a> <span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span></li>	<li><a href='#mxmlRemove'><tt>mxmlRemove()</tt></a> </li>	<li><a href='#mxmlRetain'><tt>mxmlRetain()</tt></a> <span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span></li>	<li><a href='#mxmlSAXLoadFd'><tt>mxmlSAXLoadFd()</tt></a> <span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span></li>	<li><a href='#mxmlSAXLoadFile'><tt>mxmlSAXLoadFile()</tt></a> <span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span></li>	<li><a href='#mxmlSAXLoadString'><tt>mxmlSAXLoadString()</tt></a> <span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span></li>	<li><a href='#mxmlSaveAllocString'><tt>mxmlSaveAllocString()</tt></a> </li>	<li><a href='#mxmlSaveFd'><tt>mxmlSaveFd()</tt></a> </li>	<li><a href='#mxmlSaveFile'><tt>mxmlSaveFile()</tt></a> </li>	<li><a href='#mxmlSaveString'><tt>mxmlSaveString()</tt></a> </li>	<li><a href='#mxmlSetCDATA'><tt>mxmlSetCDATA()</tt></a> <span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span></li>	<li><a href='#mxmlSetCustom'><tt>mxmlSetCustom()</tt></a> <span class='info'>&nbsp;Mini-XML 2.1&nbsp;</span></li>	<li><a href='#mxmlSetCustomHandlers'><tt>mxmlSetCustomHandlers()</tt></a> </li>	<li><a href='#mxmlSetElement'><tt>mxmlSetElement()</tt></a> </li>	<li><a href='#mxmlSetErrorCallback'><tt>mxmlSetErrorCallback()</tt></a> </li>	<li><a href='#mxmlSetInteger'><tt>mxmlSetInteger()</tt></a> </li>	<li><a href='#mxmlSetOpaque'><tt>mxmlSetOpaque()</tt></a> </li>	<li><a href='#mxmlSetReal'><tt>mxmlSetReal()</tt></a> </li>	<li><a href='#mxmlSetText'><tt>mxmlSetText()</tt></a> </li>	<li><a href='#mxmlSetTextf'><tt>mxmlSetTextf()</tt></a> </li>	<li><a href='#mxmlSetWrapMargin'><tt>mxmlSetWrapMargin()</tt></a> <span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span></li>	<li><a href='#mxmlWalkNext'><tt>mxmlWalkNext()</tt></a> </li>	<li><a href='#mxmlWalkPrev'><tt>mxmlWalkPrev()</tt></a> </li></ul><!-- NEW PAGE --><h3 class='title'><a name='mxmlAdd'>mxmlAdd()</a></h3><h4>Description</h4><p>Add a node to a tree.<p>Adds the specified node to the parent. If the child argument is notNULL, puts the new node before or after the specified child dependingon the value of the where argument. If the child argument is NULL,puts the new node at the beginning of the child list (MXML_ADD_BEFORE)or at the end of the child list (MXML_ADD_AFTER). The constantMXML_ADD_TO_PARENT can be used to specify a NULL child pointer.<h4>Syntax</h4><p><tt>void<br>mxmlAdd(    <a href='#mxml_node_t'>mxml_node_t</a> * parent,    int where,    <a href='#mxml_node_t'>mxml_node_t</a> * child,    <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>parent</tt></td><td>Parent node</td></tr><tr><td><tt>where</tt></td><td>Where to add, MXML_ADD_BEFORE or MXML_ADD_AFTER</td></tr><tr><td><tt>child</tt></td><td>Child node for where or MXML_ADD_TO_PARENT</td></tr><tr><td><tt>node</tt></td><td>Node to add</td></tr></tbody></table></div><h4>Returns</h4><p>Nothing.</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlDelete'>mxmlDelete()</a></h3><h4>Description</h4><p>Delete a node and all of its children.<p>If the specified node has a parent, this function first removes thenode from its parent using the mxmlRemove() function.<h4>Syntax</h4><p><tt>void<br>mxmlDelete(    <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 delete</td></tr></tbody></table></div><h4>Returns</h4><p>Nothing.</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlElementGetAttr'>mxmlElementGetAttr()</a></h3><h4>Description</h4><p>Get an attribute.<p>This function returns NULL if the node is not an element or thenamed attribute does not exist.<h4>Syntax</h4><p><tt>const char *<br>mxmlElementGetAttr(    <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>Element node</td></tr><tr><td><tt>name</tt></td><td>Name of attribute</td></tr></tbody></table></div><h4>Returns</h4><p>Attribute value or NULL</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlElementSetAttr'>mxmlElementSetAttr()</a></h3><h4>Description</h4><p>Set an attribute.<p>If the named attribute already exists, the value of the attributeis replaced by the new string value. The string value is copiedinto the element node. This function does nothing if the node isnot an element.<h4>Syntax</h4><p><tt>void<br>mxmlElementSetAttr(    <a href='#mxml_node_t'>mxml_node_t</a> * node,    const char * name,    const char * value);</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>Element node</td></tr><tr><td><tt>name</tt></td><td>Name of attribute</td></tr><tr><td><tt>value</tt></td><td>Attribute value</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='mxmlElementSetAttrf'>mxmlElementSetAttrf()</a></h3><h4>Description</h4><p>Set an attribute with a formatted value.<p>If the named attribute already exists, the value of the attributeis replaced by the new formatted string. The formatted string value iscopied into the element node. This function does nothing if the nodeis not an element.<h4>Syntax</h4><p><tt>void<br>mxmlElementSetAttrf(    <a href='#mxml_node_t'>mxml_node_t</a> * node,    const char * name,    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>Element node</td></tr><tr><td><tt>name</tt></td><td>Name of attribute</td></tr><tr><td><tt>format</tt></td><td>Printf-style attribute value</td></tr><tr><td><tt>...</tt></td><td>Additional arguments as needed</td></tr></tbody></table></div><h4>Returns</h4><p>Nothing.</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlEntityAddCallback'>mxmlEntityAddCallback()</a></h3><h4>Description</h4><p>Add a callback to convert entities to Unicode.<h4>Syntax</h4><p><tt>int<br>mxmlEntityAddCallback(void);</tt></p><h4>Arguments</h4><p>None.</p><h4>Returns</h4><p>0 on success, -1 on failure</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlEntityGetName'>mxmlEntityGetName()</a></h3><h4>Description</h4><p>Get the name that corresponds to the character value.<p>If val does not need to be represented by a named entity, NULL is returned.<h4>Syntax</h4><p><tt>const char *<br>mxmlEntityGetName(    int val);</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>val</tt></td><td>Character value</td></tr></tbody></table></div><h4>Returns</h4><p>Entity name or NULL</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlEntityGetValue'>mxmlEntityGetValue()</a></h3><h4>Description</h4><p>Get the character corresponding to a named entity.<p>The entity name can also be a numeric constant. -1 is returned if thename is not known.<h4>Syntax</h4><p><tt>int<br>mxmlEntityGetValue(    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>name</tt></td><td>Entity name</td></tr></tbody></table></div><h4>Returns</h4><p>Character value or -1 on error</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlEntityRemoveCallback'>mxmlEntityRemoveCallback()</a></h3><h4>Description</h4><p>Remove a callback.<h4>Syntax</h4><p><tt>void<br>mxmlEntityRemoveCallback(void);</tt></p><h4>Arguments</h4><p>None.</p><h4>Returns</h4><p>Nothing.</p><!-- NEW PAGE --><h3 class='title'><a name='mxmlFindElement'>mxmlFindElement()</a></h3><h4>Description</h4><p>Find the named element.<p>The search is constrained by the name, attribute name, and value; anyNULL names or values are treated as wildcards, so different kinds ofsearches can be implemented by looking for all elements of a given nameor all elements with a specific attribute. The descend argument determineswhether the search descends into child nodes; normally you will useMXML_DESCEND_FIRST for the initial search and MXML_NO_DESCEND to findadditional direct descendents of the node. The top node argumentconstrains the search to a particular node's children.<h4>Syntax</h4><p><tt><a href='#mxml_node_t'>mxml_node_t</a> *<br>

⌨️ 快捷键说明

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