mirror of
https://github.com/michaelrsweet/mxml.git
synced 2024-11-14 07:45:31 +00:00
Fix bug where comments/descriptions were text fragments instead of opaque
strings.
This commit is contained in:
parent
bcfa6ef518
commit
0d0850fffd
@ -278,6 +278,13 @@ void mxmlAdd (<br>
|
||||
<dt>node</dt>
|
||||
<dd class="description">Node to add</dd>
|
||||
</dl>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">Adds the specified node to the parent. If the child argument is not
|
||||
<code>NULL</code>, puts the new node before or after the specified child depending
|
||||
on the value of the where argument. If the child argument is <code>NULL</code>,
|
||||
puts the new node at the beginning of the child list (<code>MXML_ADD_BEFORE</code>)
|
||||
or at the end of the child list (<code>MXML_ADD_AFTER</code>). The constant
|
||||
<code>MXML_ADD_TO_PARENT</code> can be used to specify a <code>NULL</code> child pointer.</p>
|
||||
<h3 class="function"><a id="mxmlDelete">mxmlDelete</a></h3>
|
||||
<p class="description">Delete a node and all of its children.</p>
|
||||
<p class="code">
|
||||
@ -289,6 +296,9 @@ void mxmlDelete (<br>
|
||||
<dt>node</dt>
|
||||
<dd class="description">Node to delete</dd>
|
||||
</dl>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">If the specified node has a parent, this function first removes the
|
||||
node from its parent using the <a href="#mxmlRemove"><code>mxmlRemove</code></a> function.</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.4 </span><a id="mxmlElementDeleteAttr">mxmlElementDeleteAttr</a></h3>
|
||||
<p class="description">Delete an attribute.</p>
|
||||
<p class="code">
|
||||
@ -319,6 +329,9 @@ const char *mxmlElementGetAttr (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Attribute value or <code>NULL</code></p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">This function returns <code>NULL</code> if the node is not an element or the
|
||||
named attribute does not exist.</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.11 </span><a id="mxmlElementGetAttrByIndex">mxmlElementGetAttrByIndex</a></h3>
|
||||
<p class="description">Get an element attribute by index.</p>
|
||||
<p class="code">
|
||||
@ -338,6 +351,11 @@ const char *mxmlElementGetAttrByIndex (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Attribute value</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The index ("idx") is 0-based. <code>NULL</code> is returned if the specified index
|
||||
is out of range.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.11 </span><a id="mxmlElementGetAttrCount">mxmlElementGetAttrCount</a></h3>
|
||||
<p class="description">Get the number of element attributes.</p>
|
||||
<p class="code">
|
||||
@ -368,6 +386,11 @@ void mxmlElementSetAttr (<br>
|
||||
<dt>value</dt>
|
||||
<dd class="description">Attribute value</dd>
|
||||
</dl>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">If the named attribute already exists, the value of the attribute
|
||||
is replaced by the new string value. The string value is copied
|
||||
into the element node. This function does nothing if the node is
|
||||
not an element.</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.3 </span><a id="mxmlElementSetAttrf">mxmlElementSetAttrf</a></h3>
|
||||
<p class="description">Set an attribute with a formatted value.</p>
|
||||
<p class="code">
|
||||
@ -388,6 +411,13 @@ void mxmlElementSetAttrf (<br>
|
||||
<dt>...</dt>
|
||||
<dd class="description">Additional arguments as needed</dd>
|
||||
</dl>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">If the named attribute already exists, the value of the attribute
|
||||
is replaced by the new formatted string. The formatted string value is
|
||||
copied into the element node. This function does nothing if the node
|
||||
is not an element.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><a id="mxmlEntityAddCallback">mxmlEntityAddCallback</a></h3>
|
||||
<p class="description">Add a callback to convert entities to Unicode.</p>
|
||||
<p class="code">
|
||||
@ -414,6 +444,8 @@ const char *mxmlEntityGetName (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Entity name or <code>NULL</code></p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">If val does not need to be represented by a named entity, <code>NULL</code> is returned.</p>
|
||||
<h3 class="function"><a id="mxmlEntityGetValue">mxmlEntityGetValue</a></h3>
|
||||
<p class="description">Get the character corresponding to a named entity.</p>
|
||||
<p class="code">
|
||||
@ -427,6 +459,9 @@ int mxmlEntityGetValue (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Character value or -1 on error</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The entity name can also be a numeric constant. -1 is returned if the
|
||||
name is not known.</p>
|
||||
<h3 class="function"><a id="mxmlEntityRemoveCallback">mxmlEntityRemoveCallback</a></h3>
|
||||
<p class="description">Remove a callback.</p>
|
||||
<p class="code">
|
||||
@ -466,6 +501,15 @@ void mxmlEntityRemoveCallback (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Element node or <code>NULL</code></p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The search is constrained by the name, attribute name, and value; any
|
||||
<code>NULL</code> names or values are treated as wildcards, so different kinds of
|
||||
searches can be implemented by looking for all elements of a given name
|
||||
or all elements with a specific attribute. The descend argument determines
|
||||
whether the search descends into child nodes; normally you will use
|
||||
<code>MXML_DESCEND_FIRST</code> for the initial search and <code>MXML_NO_DESCEND</code>
|
||||
to find additional direct descendents of the node. The top node argument
|
||||
constrains the search to a particular node's children.</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.7 </span><a id="mxmlFindPath">mxmlFindPath</a></h3>
|
||||
<p class="description">Find a node with the given path.</p>
|
||||
<p class="code">
|
||||
@ -482,6 +526,15 @@ void mxmlEntityRemoveCallback (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Found node or <code>NULL</code></p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The "path" is a slash-separated list of element names. The name "*" is
|
||||
considered a wildcard for one or more levels of elements. For example,
|
||||
"foo/one/two", "bar/two/one", "*/one", and so forth.<br>
|
||||
<br>
|
||||
The first child node of the found node is returned if the given node has
|
||||
children and the first child is a value node.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.7 </span><a id="mxmlGetCDATA">mxmlGetCDATA</a></h3>
|
||||
<p class="description">Get the value for a CDATA node.</p>
|
||||
<p class="code">
|
||||
@ -495,6 +548,10 @@ const char *mxmlGetCDATA (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">CDATA value or <code>NULL</code></p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion"><code>NULL</code> is returned if the node is not a CDATA element.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.7 </span><a id="mxmlGetCustom">mxmlGetCustom</a></h3>
|
||||
<p class="description">Get the value for a custom node.</p>
|
||||
<p class="code">
|
||||
@ -508,6 +565,11 @@ const void *mxmlGetCustom (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Custom value or <code>NULL</code></p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion"><code>NULL</code> is returned if the node (or its first child) is not a custom
|
||||
value node.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.7 </span><a id="mxmlGetElement">mxmlGetElement</a></h3>
|
||||
<p class="description">Get the name for an element node.</p>
|
||||
<p class="code">
|
||||
@ -521,6 +583,10 @@ const char *mxmlGetElement (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Element name or <code>NULL</code></p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion"><code>NULL</code> is returned if the node is not an element node.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.7 </span><a id="mxmlGetFirstChild">mxmlGetFirstChild</a></h3>
|
||||
<p class="description">Get the first child of an element node.</p>
|
||||
<p class="code">
|
||||
@ -534,6 +600,11 @@ const char *mxmlGetElement (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">First child or <code>NULL</code></p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion"><code>NULL</code> is returned if the node is not an element node or if the node
|
||||
has no children.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.7 </span><a id="mxmlGetInteger">mxmlGetInteger</a></h3>
|
||||
<p class="description">Get the integer value from the specified node or its
|
||||
first child.</p>
|
||||
@ -548,6 +619,10 @@ int mxmlGetInteger (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Integer value or 0</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">0 is returned if the node (or its first child) is not an integer value node.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.7 </span><a id="mxmlGetLastChild">mxmlGetLastChild</a></h3>
|
||||
<p class="description">Get the last child of an element node.</p>
|
||||
<p class="code">
|
||||
@ -561,6 +636,11 @@ int mxmlGetInteger (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Last child or <code>NULL</code></p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion"><code>NULL</code> is returned if the node is not an element node or if the node
|
||||
has no children.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><a id="mxmlGetNextSibling">mxmlGetNextSibling</a></h3>
|
||||
<p class="description">Return the node type...</p>
|
||||
<p class="code">
|
||||
@ -590,6 +670,11 @@ const char *mxmlGetOpaque (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Opaque string or <code>NULL</code></p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion"><code>NULL</code> is returned if the node (or its first child) is not an opaque
|
||||
value node.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.7 </span><a id="mxmlGetParent">mxmlGetParent</a></h3>
|
||||
<p class="description">Get the parent node.</p>
|
||||
<p class="code">
|
||||
@ -603,6 +688,10 @@ const char *mxmlGetOpaque (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Parent node or <code>NULL</code></p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion"><code>NULL</code> is returned for a root node.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.7 </span><a id="mxmlGetPrevSibling">mxmlGetPrevSibling</a></h3>
|
||||
<p class="description">Get the previous node for the current parent.</p>
|
||||
<p class="code">
|
||||
@ -616,6 +705,10 @@ const char *mxmlGetOpaque (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Previous node or <code>NULL</code></p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion"><code>NULL</code> is returned if this is the first child for the current parent.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.7 </span><a id="mxmlGetReal">mxmlGetReal</a></h3>
|
||||
<p class="description">Get the real value for a node or its first child.</p>
|
||||
<p class="code">
|
||||
@ -629,6 +722,10 @@ double mxmlGetReal (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Real value or 0.0</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">0.0 is returned if the node (or its first child) is not a real value node.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.7 </span><a id="mxmlGetRefCount">mxmlGetRefCount</a></h3>
|
||||
<p class="description">Get the current reference (use) count for a node.</p>
|
||||
<p class="code">
|
||||
@ -642,6 +739,12 @@ int mxmlGetRefCount (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Reference count</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The initial reference count of new nodes is 1. Use the <a href="#mxmlRetain"><code>mxmlRetain</code></a>
|
||||
and <a href="#mxmlRelease"><code>mxmlRelease</code></a> functions to increment and decrement a node's
|
||||
reference count.
|
||||
|
||||
.</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.7 </span><a id="mxmlGetText">mxmlGetText</a></h3>
|
||||
<p class="description">Get the text value for a node or its first child.</p>
|
||||
<p class="code">
|
||||
@ -658,6 +761,11 @@ const char *mxmlGetText (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Text string or <code>NULL</code></p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion"><code>NULL</code> is returned if the node (or its first child) is not a text node.
|
||||
The "whitespace" argument can be <code>NULL</code>.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.7 </span><a id="mxmlGetType">mxmlGetType</a></h3>
|
||||
<p class="description">Get the node type.</p>
|
||||
<p class="code">
|
||||
@ -671,6 +779,10 @@ const char *mxmlGetText (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Type of node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion"><code>MXML_IGNORE</code> is returned if "node" is <code>NULL</code>.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.7 </span><a id="mxmlGetUserData">mxmlGetUserData</a></h3>
|
||||
<p class="description">Get the user data pointer for a node.</p>
|
||||
<p class="code">
|
||||
@ -708,6 +820,10 @@ void mxmlIndexDelete (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Next node or <code>NULL</code> if there is none</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">You should call <a href="#mxmlIndexReset"><code>mxmlIndexReset</code></a> prior to using this function to get
|
||||
the first node in the index. Nodes are returned in the sorted order of the
|
||||
index.</p>
|
||||
<h3 class="function"><a id="mxmlIndexFind">mxmlIndexFind</a></h3>
|
||||
<p class="description">Find the next matching node.</p>
|
||||
<p class="code">
|
||||
@ -727,6 +843,11 @@ void mxmlIndexDelete (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Node or <code>NULL</code> if none found</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">You should call <a href="#mxmlIndexReset"><code>mxmlIndexReset</code></a> prior to using this function for
|
||||
the first time with a particular set of "element" and "value"
|
||||
strings. Passing <code>NULL</code> for both "element" and "value" is equivalent
|
||||
to calling <a href="#mxmlIndexEnum"><code>mxmlIndexEnum</code></a>.</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.7 </span><a id="mxmlIndexGetCount">mxmlIndexGetCount</a></h3>
|
||||
<p class="description">Get the number of nodes in an index.</p>
|
||||
<p class="code">
|
||||
@ -759,6 +880,12 @@ int mxmlIndexGetCount (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">New index</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The index will contain all nodes that contain the named element and/or
|
||||
attribute. If both "element" and "attr" are <code>NULL</code>, then the index will
|
||||
contain a sorted list of the elements in the node tree. Nodes are
|
||||
sorted by element name and optionally by attribute value if the "attr"
|
||||
argument is not NULL.</p>
|
||||
<h3 class="function"><a id="mxmlIndexReset">mxmlIndexReset</a></h3>
|
||||
<p class="description">Reset the enumeration/find pointer in the index and
|
||||
return the first node in the index.</p>
|
||||
@ -773,6 +900,9 @@ return the first node in the index.</p>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">First node or <code>NULL</code> if there is none</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">This function should be called prior to using <a href="#mxmlIndexEnum"><code>mxmlIndexEnum</code></a> or
|
||||
<a href="#mxmlIndexFind"><code>mxmlIndexFind</code></a> for the first time.</p>
|
||||
<h3 class="function"><a id="mxmlLoadFd">mxmlLoadFd</a></h3>
|
||||
<p class="description">Load a file descriptor into an XML node tree.</p>
|
||||
<p class="code">
|
||||
@ -792,6 +922,14 @@ return the first node in the index.</p>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">First node or <code>NULL</code> if the file could not be read.</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">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.
|
||||
The constants <code>MXML_INTEGER_CALLBACK</code>, <code>MXML_OPAQUE_CALLBACK</code>,
|
||||
<code>MXML_REAL_CALLBACK</code>, and <code>MXML_TEXT_CALLBACK</code> are defined for
|
||||
loading child (data) nodes of the specified type.</p>
|
||||
<h3 class="function"><a id="mxmlLoadFile">mxmlLoadFile</a></h3>
|
||||
<p class="description">Load a file into an XML node tree.</p>
|
||||
<p class="code">
|
||||
@ -811,6 +949,14 @@ return the first node in the index.</p>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">First node or <code>NULL</code> if the file could not be read.</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">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.
|
||||
The constants <code>MXML_INTEGER_CALLBACK</code>, <code>MXML_OPAQUE_CALLBACK</code>,
|
||||
<code>MXML_REAL_CALLBACK</code>, and <code>MXML_TEXT_CALLBACK</code> are defined for
|
||||
loading child (data) nodes of the specified type.</p>
|
||||
<h3 class="function"><a id="mxmlLoadString">mxmlLoadString</a></h3>
|
||||
<p class="description">Load a string into an XML node tree.</p>
|
||||
<p class="code">
|
||||
@ -830,6 +976,14 @@ return the first node in the index.</p>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">First node or <code>NULL</code> if the string has errors.</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">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 a
|
||||
single parent node like <?xml> for the entire string. The callback
|
||||
function returns the value type that should be used for child nodes.
|
||||
The constants <code>MXML_INTEGER_CALLBACK</code>, <code>MXML_OPAQUE_CALLBACK</code>,
|
||||
<code>MXML_REAL_CALLBACK</code>, and <code>MXML_TEXT_CALLBACK</code> are defined for
|
||||
loading child (data) nodes of the specified type.</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.3 </span><a id="mxmlNewCDATA">mxmlNewCDATA</a></h3>
|
||||
<p class="description">Create a new CDATA node.</p>
|
||||
<p class="code">
|
||||
@ -846,6 +1000,14 @@ return the first node in the index.</p>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new CDATA node is added to the end of the specified parent's child
|
||||
list. The constant <code>MXML_NO_PARENT</code> can be used to specify that the new
|
||||
CDATA node has no parent. The data string must be nul-terminated and
|
||||
is copied into the new node. CDATA nodes currently use the
|
||||
<code>MXML_ELEMENT</code> type.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.1 </span><a id="mxmlNewCustom">mxmlNewCustom</a></h3>
|
||||
<p class="description">Create a new custom data node.</p>
|
||||
<p class="code">
|
||||
@ -865,6 +1027,13 @@ return the first node in the index.</p>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new custom node is added to the end of the specified parent's child
|
||||
list. The constant <code>MXML_NO_PARENT</code> can be used to specify that the new
|
||||
element node has no parent. <code>NULL</code> can be passed when the data in the
|
||||
node is not dynamically allocated or is separately managed.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><a id="mxmlNewElement">mxmlNewElement</a></h3>
|
||||
<p class="description">Create a new element node.</p>
|
||||
<p class="code">
|
||||
@ -881,6 +1050,10 @@ return the first node in the index.</p>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new element node is added to the end of the specified parent's child
|
||||
list. The constant <code>MXML_NO_PARENT</code> can be used to specify that the new
|
||||
element node has no parent.</p>
|
||||
<h3 class="function"><a id="mxmlNewInteger">mxmlNewInteger</a></h3>
|
||||
<p class="description">Create a new integer node.</p>
|
||||
<p class="code">
|
||||
@ -897,6 +1070,10 @@ return the first node in the index.</p>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new integer node is added to the end of the specified parent's child
|
||||
list. The constant <code>MXML_NO_PARENT</code> can be used to specify that the new
|
||||
integer node has no parent.</p>
|
||||
<h3 class="function"><a id="mxmlNewOpaque">mxmlNewOpaque</a></h3>
|
||||
<p class="description">Create a new opaque string.</p>
|
||||
<p class="code">
|
||||
@ -913,6 +1090,11 @@ return the first node in the index.</p>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new opaque string node is added to the end of the specified parent's
|
||||
child list. The constant <code>MXML_NO_PARENT</code> can be used to specify that
|
||||
the new opaque string node has no parent. The opaque string must be nul-
|
||||
terminated and is copied into the new node.</p>
|
||||
<h3 class="function"><a id="mxmlNewOpaquef">mxmlNewOpaquef</a></h3>
|
||||
<p class="description">Create a new formatted opaque string node.</p>
|
||||
<p class="code">
|
||||
@ -932,6 +1114,11 @@ return the first node in the index.</p>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new opaque string node is added to the end of the specified parent's
|
||||
child list. The constant <code>MXML_NO_PARENT</code> can be used to specify that
|
||||
the new opaque string node has no parent. The format string must be
|
||||
nul-terminated and is formatted into the new node.</p>
|
||||
<h3 class="function"><a id="mxmlNewReal">mxmlNewReal</a></h3>
|
||||
<p class="description">Create a new real number node.</p>
|
||||
<p class="code">
|
||||
@ -948,6 +1135,10 @@ return the first node in the index.</p>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new real number node is added to the end of the specified parent's
|
||||
child list. The constant <code>MXML_NO_PARENT</code> can be used to specify that
|
||||
the new real number node has no parent.</p>
|
||||
<h3 class="function"><a id="mxmlNewText">mxmlNewText</a></h3>
|
||||
<p class="description">Create a new text fragment node.</p>
|
||||
<p class="code">
|
||||
@ -967,6 +1158,12 @@ return the first node in the index.</p>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new text node is added to the end of the specified parent's child
|
||||
list. The constant <code>MXML_NO_PARENT</code> can be used to specify that the new
|
||||
text node has no parent. The whitespace parameter is used to specify
|
||||
whether leading whitespace is present before the node. The text
|
||||
string must be nul-terminated and is copied into the new node.</p>
|
||||
<h3 class="function"><a id="mxmlNewTextf">mxmlNewTextf</a></h3>
|
||||
<p class="description">Create a new formatted text fragment node.</p>
|
||||
<p class="code">
|
||||
@ -989,6 +1186,12 @@ return the first node in the index.</p>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new text node is added to the end of the specified parent's child
|
||||
list. The constant <code>MXML_NO_PARENT</code> can be used to specify that the new
|
||||
text node has no parent. The whitespace parameter is used to specify
|
||||
whether leading whitespace is present before the node. The format
|
||||
string must be nul-terminated and is formatted into the new node.</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.3 </span><a id="mxmlNewXML">mxmlNewXML</a></h3>
|
||||
<p class="description">Create a new XML document tree.</p>
|
||||
<p class="code">
|
||||
@ -1002,6 +1205,11 @@ return the first node in the index.</p>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">New ?xml node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The "version" argument specifies the version number to put in the
|
||||
?xml element node. If <code>NULL</code>, version "1.0" is assumed.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.3 </span><a id="mxmlRelease">mxmlRelease</a></h3>
|
||||
<p class="description">Release a node.</p>
|
||||
<p class="code">
|
||||
@ -1015,6 +1223,11 @@ int mxmlRelease (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">New reference count</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">When the reference count reaches zero, the node (and any children)
|
||||
is deleted via <a href="#mxmlDelete"><code>mxmlDelete</code></a>.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><a id="mxmlRemove">mxmlRemove</a></h3>
|
||||
<p class="description">Remove a node from its parent.</p>
|
||||
<p class="code">
|
||||
@ -1026,6 +1239,9 @@ void mxmlRemove (<br>
|
||||
<dt>node</dt>
|
||||
<dd class="description">Node to remove</dd>
|
||||
</dl>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">This function does not free memory used by the node - use <a href="#mxmlDelete"><code>mxmlDelete</code></a>
|
||||
for that. This function does nothing if the node has no parent.</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.3 </span><a id="mxmlRetain">mxmlRetain</a></h3>
|
||||
<p class="description">Retain a node.</p>
|
||||
<p class="code">
|
||||
@ -1065,6 +1281,20 @@ using a SAX callback.</p>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">First node or <code>NULL</code> if the file could not be read.</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">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.
|
||||
The constants <code>MXML_INTEGER_CALLBACK</code>, <code>MXML_OPAQUE_CALLBACK</code>,
|
||||
<code>MXML_REAL_CALLBACK</code>, and <code>MXML_TEXT_CALLBACK</code> are defined for
|
||||
loading child nodes of the specified type.<br>
|
||||
<br>
|
||||
The SAX callback must call <a href="#mxmlRetain"><code>mxmlRetain</code></a> for any nodes that need to
|
||||
be kept for later use. Otherwise, nodes are deleted when the parent
|
||||
node is closed or after each data, comment, CDATA, or directive node.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.3 </span><a id="mxmlSAXLoadFile">mxmlSAXLoadFile</a></h3>
|
||||
<p class="description">Load a file into an XML node tree
|
||||
using a SAX callback.</p>
|
||||
@ -1091,6 +1321,20 @@ using a SAX callback.</p>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">First node or <code>NULL</code> if the file could not be read.</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">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.
|
||||
The constants <code>MXML_INTEGER_CALLBACK</code>, <code>MXML_OPAQUE_CALLBACK</code>,
|
||||
<code>MXML_REAL_CALLBACK</code>, and <code>MXML_TEXT_CALLBACK</code> are defined for
|
||||
loading child nodes of the specified type.<br>
|
||||
<br>
|
||||
The SAX callback must call <a href="#mxmlRetain"><code>mxmlRetain</code></a> for any nodes that need to
|
||||
be kept for later use. Otherwise, nodes are deleted when the parent
|
||||
node is closed or after each data, comment, CDATA, or directive node.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.3 </span><a id="mxmlSAXLoadString">mxmlSAXLoadString</a></h3>
|
||||
<p class="description">Load a string into an XML node tree
|
||||
using a SAX callback.</p>
|
||||
@ -1117,6 +1361,20 @@ using a SAX callback.</p>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">First node or <code>NULL</code> if the string has errors.</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">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 a
|
||||
single parent node like <?xml> for the entire string. The callback
|
||||
function returns the value type that should be used for child nodes.
|
||||
The constants <code>MXML_INTEGER_CALLBACK</code>, <code>MXML_OPAQUE_CALLBACK</code>,
|
||||
<code>MXML_REAL_CALLBACK</code>, and <code>MXML_TEXT_CALLBACK</code> are defined for
|
||||
loading child nodes of the specified type.<br>
|
||||
<br>
|
||||
The SAX callback must call <a href="#mxmlRetain"><code>mxmlRetain</code></a> for any nodes that need to
|
||||
be kept for later use. Otherwise, nodes are deleted when the parent
|
||||
node is closed or after each data, comment, CDATA, or directive node.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><a id="mxmlSaveAllocString">mxmlSaveAllocString</a></h3>
|
||||
<p class="description">Save an XML tree to an allocated string.</p>
|
||||
<p class="code">
|
||||
@ -1133,6 +1391,18 @@ char *mxmlSaveAllocString (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Allocated string or <code>NULL</code></p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">This function returns a pointer to a string containing the textual
|
||||
representation of the XML node tree. The string should be freed
|
||||
using the free() function when you are done with it. <code>NULL</code> is returned
|
||||
if the node would produce an empty string or if the string cannot be
|
||||
allocated.<br>
|
||||
<br>
|
||||
The callback argument specifies a function that returns a whitespace
|
||||
string or NULL before and after each element. If <code>MXML_NO_CALLBACK</code>
|
||||
is specified, whitespace will only be added before <code>MXML_TEXT</code> nodes
|
||||
with leading whitespace and before attribute names inside opening
|
||||
element tags.</p>
|
||||
<h3 class="function"><a id="mxmlSaveFd">mxmlSaveFd</a></h3>
|
||||
<p class="description">Save an XML tree to a file descriptor.</p>
|
||||
<p class="code">
|
||||
@ -1152,6 +1422,12 @@ int mxmlSaveFd (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">0 on success, -1 on error.</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The callback argument specifies a function that returns a whitespace
|
||||
string or NULL before and after each element. If <code>MXML_NO_CALLBACK</code>
|
||||
is specified, whitespace will only be added before <code>MXML_TEXT</code> nodes
|
||||
with leading whitespace and before attribute names inside opening
|
||||
element tags.</p>
|
||||
<h3 class="function"><a id="mxmlSaveFile">mxmlSaveFile</a></h3>
|
||||
<p class="description">Save an XML tree to a file.</p>
|
||||
<p class="code">
|
||||
@ -1171,6 +1447,12 @@ int mxmlSaveFile (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">0 on success, -1 on error.</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The callback argument specifies a function that returns a whitespace
|
||||
string or NULL before and after each element. If <code>MXML_NO_CALLBACK</code>
|
||||
is specified, whitespace will only be added before <code>MXML_TEXT</code> nodes
|
||||
with leading whitespace and before attribute names inside opening
|
||||
element tags.</p>
|
||||
<h3 class="function"><a id="mxmlSaveString">mxmlSaveString</a></h3>
|
||||
<p class="description">Save an XML node tree to a string.</p>
|
||||
<p class="code">
|
||||
@ -1193,6 +1475,16 @@ int mxmlSaveString (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Size of string</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">This function returns the total number of bytes that would be
|
||||
required for the string but only copies (bufsize - 1) characters
|
||||
into the specified buffer.<br>
|
||||
<br>
|
||||
The callback argument specifies a function that returns a whitespace
|
||||
string or NULL before and after each element. If <code>MXML_NO_CALLBACK</code>
|
||||
is specified, whitespace will only be added before <code>MXML_TEXT</code> nodes
|
||||
with leading whitespace and before attribute names inside opening
|
||||
element tags.</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.3 </span><a id="mxmlSetCDATA">mxmlSetCDATA</a></h3>
|
||||
<p class="description">Set the element name of a CDATA node.</p>
|
||||
<p class="code">
|
||||
@ -1209,6 +1501,10 @@ int mxmlSetCDATA (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">0 on success, -1 on failure</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The node is not changed if it (or its first child) is not a CDATA element node.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.1 </span><a id="mxmlSetCustom">mxmlSetCustom</a></h3>
|
||||
<p class="description">Set the data and destructor of a custom data node.</p>
|
||||
<p class="code">
|
||||
@ -1228,6 +1524,10 @@ int mxmlSetCustom (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">0 on success, -1 on failure</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The node is not changed if it (or its first child) is not a custom node.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><a id="mxmlSetCustomHandlers">mxmlSetCustomHandlers</a></h3>
|
||||
<p class="description">Set the handling functions for custom data.</p>
|
||||
<p class="code">
|
||||
@ -1242,6 +1542,12 @@ void mxmlSetCustomHandlers (<br>
|
||||
<dt>save</dt>
|
||||
<dd class="description">Save function</dd>
|
||||
</dl>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The load function accepts a node pointer and a data string and must
|
||||
return 0 on success and non-zero on error.<br>
|
||||
<br>
|
||||
The save function accepts a node pointer and must return a malloc'd
|
||||
string on success and <code>NULL</code> on error.</p>
|
||||
<h3 class="function"><a id="mxmlSetElement">mxmlSetElement</a></h3>
|
||||
<p class="description">Set the name of an element node.</p>
|
||||
<p class="code">
|
||||
@ -1258,6 +1564,8 @@ int mxmlSetElement (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">0 on success, -1 on failure</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The node is not changed if it is not an element node.</p>
|
||||
<h3 class="function"><a id="mxmlSetErrorCallback">mxmlSetErrorCallback</a></h3>
|
||||
<p class="description">Set the error message callback.</p>
|
||||
<p class="code">
|
||||
@ -1285,6 +1593,8 @@ int mxmlSetInteger (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">0 on success, -1 on failure</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The node is not changed if it (or its first child) is not an integer node.</p>
|
||||
<h3 class="function"><a id="mxmlSetOpaque">mxmlSetOpaque</a></h3>
|
||||
<p class="description">Set the value of an opaque node.</p>
|
||||
<p class="code">
|
||||
@ -1301,6 +1611,8 @@ int mxmlSetOpaque (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">0 on success, -1 on failure</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The node is not changed if it (or its first child) is not an opaque node.</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.11 </span><a id="mxmlSetOpaquef">mxmlSetOpaquef</a></h3>
|
||||
<p class="description">Set the value of an opaque string node to a formatted string.</p>
|
||||
<p class="code">
|
||||
@ -1320,6 +1632,10 @@ int mxmlSetOpaquef (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">0 on success, -1 on failure</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The node is not changed if it (or its first child) is not an opaque node.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><a id="mxmlSetReal">mxmlSetReal</a></h3>
|
||||
<p class="description">Set the value of a real number node.</p>
|
||||
<p class="code">
|
||||
@ -1336,6 +1652,8 @@ int mxmlSetReal (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">0 on success, -1 on failure</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The node is not changed if it (or its first child) is not a real number node.</p>
|
||||
<h3 class="function"><a id="mxmlSetText">mxmlSetText</a></h3>
|
||||
<p class="description">Set the value of a text node.</p>
|
||||
<p class="code">
|
||||
@ -1355,6 +1673,8 @@ int mxmlSetText (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">0 on success, -1 on failure</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The node is not changed if it (or its first child) is not a text node.</p>
|
||||
<h3 class="function"><a id="mxmlSetTextf">mxmlSetTextf</a></h3>
|
||||
<p class="description">Set the value of a text node to a formatted string.</p>
|
||||
<p class="code">
|
||||
@ -1377,6 +1697,8 @@ int mxmlSetTextf (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">0 on success, -1 on failure</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The node is not changed if it (or its first child) is not a text node.</p>
|
||||
<h3 class="function"><span class="info"> Mini-XML 2.7 </span><a id="mxmlSetUserData">mxmlSetUserData</a></h3>
|
||||
<p class="description">Set the user data pointer for a node.</p>
|
||||
<p class="code">
|
||||
@ -1404,6 +1726,10 @@ void mxmlSetWrapMargin (<br>
|
||||
<dt>column</dt>
|
||||
<dd class="description">Column for wrapping, 0 to disable wrapping</dd>
|
||||
</dl>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">Wrapping is disabled when "column" is 0.
|
||||
|
||||
</p>
|
||||
<h3 class="function"><a id="mxmlWalkNext">mxmlWalkNext</a></h3>
|
||||
<p class="description">Walk to the next logical node in the tree.</p>
|
||||
<p class="code">
|
||||
@ -1423,6 +1749,10 @@ void mxmlSetWrapMargin (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Next node or <code>NULL</code></p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The descend argument controls whether the first child is considered
|
||||
to be the next node. The top node argument constrains the walk to
|
||||
the node's children.</p>
|
||||
<h3 class="function"><a id="mxmlWalkPrev">mxmlWalkPrev</a></h3>
|
||||
<p class="description">Walk to the previous logical node in the tree.</p>
|
||||
<p class="code">
|
||||
@ -1442,6 +1772,10 @@ void mxmlSetWrapMargin (<br>
|
||||
</dl>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Previous node or <code>NULL</code></p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The descend argument controls whether the previous node's last child
|
||||
is considered to be the previous node. The top node argument constrains
|
||||
the walk to the node's children.</p>
|
||||
<h2 class="title"><a id="TYPES">Data Types</a></h2>
|
||||
<h3 class="typedef"><a id="mxml_custom_destroy_cb_t">mxml_custom_destroy_cb_t</a></h3>
|
||||
<p class="description">Custom data destructor</p>
|
||||
|
112
mxmldoc.c
112
mxmldoc.c
@ -2134,8 +2134,7 @@ scan_file(const char *filename, /* I - Filename */
|
||||
* Copy comment for typedef as well as class/struct/union...
|
||||
*/
|
||||
|
||||
mxmlNewText(comment, 0,
|
||||
comment->last_child->value.text.string);
|
||||
mxmlNewOpaque(comment, comment->last_child->value.opaque);
|
||||
description = mxmlNewElement(typedefnode, "description");
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr,
|
||||
@ -2219,8 +2218,7 @@ scan_file(const char *filename, /* I - Filename */
|
||||
* Copy comment for typedef as well as class/struct/union...
|
||||
*/
|
||||
|
||||
mxmlNewText(comment, 0,
|
||||
comment->last_child->value.text.string);
|
||||
mxmlNewOpaque(comment, comment->last_child->value.opaque);
|
||||
description = mxmlNewElement(typedefnode, "description");
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr,
|
||||
@ -2576,9 +2574,8 @@ scan_file(const char *filename, /* I - Filename */
|
||||
" adding comment %p/%p to variable...\n",
|
||||
comment->last_child, comment->child);
|
||||
#endif /* DEBUG */
|
||||
mxmlNewText(comment, 0, buffer);
|
||||
update_comment(variable,
|
||||
mxmlNewText(description, 0, buffer));
|
||||
mxmlNewOpaque(comment, buffer);
|
||||
update_comment(variable, mxmlNewOpaque(description, buffer));
|
||||
}
|
||||
|
||||
variable = NULL;
|
||||
@ -2601,9 +2598,8 @@ scan_file(const char *filename, /* I - Filename */
|
||||
" adding comment %p/%p to constant...\n",
|
||||
comment->last_child, comment->child);
|
||||
#endif /* DEBUG */
|
||||
mxmlNewText(comment, 0, buffer);
|
||||
update_comment(constant,
|
||||
mxmlNewText(description, 0, buffer));
|
||||
mxmlNewOpaque(comment, buffer);
|
||||
update_comment(constant, mxmlNewOpaque(description, buffer));
|
||||
}
|
||||
|
||||
constant = NULL;
|
||||
@ -2639,21 +2635,20 @@ scan_file(const char *filename, /* I - Filename */
|
||||
comment->last_child, comment->child,
|
||||
mxmlElementGetAttr(typedefnode, "name"));
|
||||
#endif /* DEBUG */
|
||||
mxmlNewText(comment, 0, buffer);
|
||||
update_comment(typedefnode,
|
||||
mxmlNewText(description, 0, buffer));
|
||||
mxmlNewOpaque(comment, buffer);
|
||||
update_comment(typedefnode, mxmlNewOpaque(description, buffer));
|
||||
|
||||
if (structclass)
|
||||
{
|
||||
description = mxmlNewElement(structclass, "description");
|
||||
update_comment(structclass,
|
||||
mxmlNewText(description, 0, buffer));
|
||||
mxmlNewOpaque(description, buffer));
|
||||
}
|
||||
else if (enumeration)
|
||||
{
|
||||
description = mxmlNewElement(enumeration, "description");
|
||||
update_comment(enumeration,
|
||||
mxmlNewText(description, 0, buffer));
|
||||
mxmlNewOpaque(description, buffer));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2668,9 +2663,8 @@ scan_file(const char *filename, /* I - Filename */
|
||||
fprintf(stderr, " adding comment %p/%p to parent...\n",
|
||||
comment->last_child, comment->child);
|
||||
#endif /* DEBUG */
|
||||
mxmlNewText(comment, 0, buffer);
|
||||
update_comment(tree,
|
||||
mxmlNewText(description, 0, buffer));
|
||||
mxmlNewOpaque(comment, buffer);
|
||||
update_comment(tree, mxmlNewOpaque(description, buffer));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2678,7 +2672,7 @@ scan_file(const char *filename, /* I - Filename */
|
||||
fprintf(stderr, " before adding comment, child=%p, last_child=%p\n",
|
||||
comment->child, comment->last_child);
|
||||
#endif /* DEBUG */
|
||||
mxmlNewText(comment, 0, buffer);
|
||||
mxmlNewOpaque(comment, buffer);
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, " after adding comment, child=%p, last_child=%p\n",
|
||||
comment->child, comment->last_child);
|
||||
@ -2756,9 +2750,8 @@ scan_file(const char *filename, /* I - Filename */
|
||||
fprintf(stderr, " adding comment %p/%p to variable...\n",
|
||||
comment->last_child, comment->child);
|
||||
#endif /* DEBUG */
|
||||
mxmlNewText(comment, 0, buffer);
|
||||
update_comment(variable,
|
||||
mxmlNewText(description, 0, buffer));
|
||||
mxmlNewOpaque(comment, buffer);
|
||||
update_comment(variable, mxmlNewOpaque(description, buffer));
|
||||
}
|
||||
|
||||
variable = NULL;
|
||||
@ -2780,9 +2773,8 @@ scan_file(const char *filename, /* I - Filename */
|
||||
fprintf(stderr, " adding comment %p/%p to constant...\n",
|
||||
comment->last_child, comment->child);
|
||||
#endif /* DEBUG */
|
||||
mxmlNewText(comment, 0, buffer);
|
||||
update_comment(constant,
|
||||
mxmlNewText(description, 0, buffer));
|
||||
mxmlNewOpaque(comment, buffer);
|
||||
update_comment(constant, mxmlNewOpaque(description, buffer));
|
||||
}
|
||||
|
||||
constant = NULL;
|
||||
@ -2818,21 +2810,18 @@ scan_file(const char *filename, /* I - Filename */
|
||||
comment->last_child, comment->child,
|
||||
mxmlElementGetAttr(typedefnode, "name"));
|
||||
#endif /* DEBUG */
|
||||
mxmlNewText(comment, 0, buffer);
|
||||
update_comment(typedefnode,
|
||||
mxmlNewText(description, 0, buffer));
|
||||
mxmlNewOpaque(comment, buffer);
|
||||
update_comment(typedefnode, mxmlNewOpaque(description, buffer));
|
||||
|
||||
if (structclass)
|
||||
{
|
||||
description = mxmlNewElement(structclass, "description");
|
||||
update_comment(structclass,
|
||||
mxmlNewText(description, 0, buffer));
|
||||
update_comment(structclass, mxmlNewOpaque(description, buffer));
|
||||
}
|
||||
else if (enumeration)
|
||||
{
|
||||
description = mxmlNewElement(enumeration, "description");
|
||||
update_comment(enumeration,
|
||||
mxmlNewText(description, 0, buffer));
|
||||
update_comment(enumeration, mxmlNewOpaque(description, buffer));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2847,12 +2836,11 @@ scan_file(const char *filename, /* I - Filename */
|
||||
fprintf(stderr, " adding comment %p/%p to parent...\n",
|
||||
comment->last_child, comment->child);
|
||||
#endif /* DEBUG */
|
||||
mxmlNewText(comment, 0, buffer);
|
||||
update_comment(tree,
|
||||
mxmlNewText(description, 0, buffer));
|
||||
mxmlNewOpaque(comment, buffer);
|
||||
update_comment(tree, mxmlNewOpaque(description, buffer));
|
||||
}
|
||||
else
|
||||
mxmlNewText(comment, 0, buffer);
|
||||
mxmlNewOpaque(comment, buffer);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "C comment: <<<< %s >>>\n", buffer);
|
||||
@ -2911,9 +2899,8 @@ scan_file(const char *filename, /* I - Filename */
|
||||
fprintf(stderr, " adding comment %p/%p to variable...\n",
|
||||
comment->last_child, comment->child);
|
||||
#endif /* DEBUG */
|
||||
mxmlNewText(comment, 0, buffer);
|
||||
update_comment(variable,
|
||||
mxmlNewText(description, 0, buffer));
|
||||
mxmlNewOpaque(comment, buffer);
|
||||
update_comment(variable, mxmlNewOpaque(description, buffer));
|
||||
}
|
||||
|
||||
variable = NULL;
|
||||
@ -2935,9 +2922,8 @@ scan_file(const char *filename, /* I - Filename */
|
||||
fprintf(stderr, " adding comment %p/%p to constant...\n",
|
||||
comment->last_child, comment->child);
|
||||
#endif /* DEBUG */
|
||||
mxmlNewText(comment, 0, buffer);
|
||||
update_comment(constant,
|
||||
mxmlNewText(description, 0, buffer));
|
||||
mxmlNewOpaque(comment, buffer);
|
||||
update_comment(constant, mxmlNewOpaque(description, buffer));
|
||||
}
|
||||
|
||||
constant = NULL;
|
||||
@ -2973,21 +2959,18 @@ scan_file(const char *filename, /* I - Filename */
|
||||
comment->last_child, comment->child,
|
||||
mxmlElementGetAttr(typedefnode, "name"));
|
||||
#endif /* DEBUG */
|
||||
mxmlNewText(comment, 0, buffer);
|
||||
update_comment(typedefnode,
|
||||
mxmlNewText(description, 0, buffer));
|
||||
mxmlNewOpaque(comment, buffer);
|
||||
update_comment(typedefnode, mxmlNewOpaque(description, buffer));
|
||||
|
||||
if (structclass)
|
||||
{
|
||||
description = mxmlNewElement(structclass, "description");
|
||||
update_comment(structclass,
|
||||
mxmlNewText(description, 0, buffer));
|
||||
update_comment(structclass, mxmlNewOpaque(description, buffer));
|
||||
}
|
||||
else if (enumeration)
|
||||
{
|
||||
description = mxmlNewElement(enumeration, "description");
|
||||
update_comment(enumeration,
|
||||
mxmlNewText(description, 0, buffer));
|
||||
update_comment(enumeration, mxmlNewOpaque(description, buffer));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3000,12 +2983,11 @@ scan_file(const char *filename, /* I - Filename */
|
||||
fprintf(stderr, " adding comment %p/%p to parent...\n",
|
||||
comment->last_child, comment->child);
|
||||
#endif /* DEBUG */
|
||||
mxmlNewText(comment, 0, buffer);
|
||||
update_comment(tree,
|
||||
mxmlNewText(description, 0, buffer));
|
||||
mxmlNewOpaque(comment, buffer);
|
||||
update_comment(tree, mxmlNewOpaque(description, buffer));
|
||||
}
|
||||
else
|
||||
mxmlNewText(comment, 0, buffer);
|
||||
mxmlNewOpaque(comment, buffer);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "C++ comment: <<<< %s >>>\n", buffer);
|
||||
@ -3508,7 +3490,7 @@ update_comment(mxml_node_t *parent, /* I - Parent node */
|
||||
* Convert "\/" to "/"...
|
||||
*/
|
||||
|
||||
for (ptr = strstr(comment->value.text.string, "\\/");
|
||||
for (ptr = strstr(comment->value.opaque, "\\/");
|
||||
ptr;
|
||||
ptr = strstr(ptr, "\\/"))
|
||||
safe_strcpy(ptr, ptr + 1);
|
||||
@ -3517,7 +3499,7 @@ update_comment(mxml_node_t *parent, /* I - Parent node */
|
||||
* Update the comment...
|
||||
*/
|
||||
|
||||
ptr = comment->value.text.string;
|
||||
ptr = comment->value.opaque;
|
||||
|
||||
if (*ptr == '\'')
|
||||
{
|
||||
@ -3539,7 +3521,7 @@ update_comment(mxml_node_t *parent, /* I - Parent node */
|
||||
while (isspace(*ptr & 255))
|
||||
ptr ++;
|
||||
|
||||
safe_strcpy(comment->value.text.string, ptr);
|
||||
safe_strcpy(comment->value.opaque, ptr);
|
||||
}
|
||||
}
|
||||
else if (!strncmp(ptr, "I ", 2) || !strncmp(ptr, "O ", 2) ||
|
||||
@ -3554,7 +3536,7 @@ update_comment(mxml_node_t *parent, /* I - Parent node */
|
||||
*ptr++ = '\0';
|
||||
|
||||
if (!strcmp(parent->value.element.name, "argument"))
|
||||
mxmlElementSetAttr(parent, "direction", comment->value.text.string);
|
||||
mxmlElementSetAttr(parent, "direction", comment->value.opaque);
|
||||
|
||||
while (isspace(*ptr & 255))
|
||||
ptr ++;
|
||||
@ -3565,27 +3547,27 @@ update_comment(mxml_node_t *parent, /* I - Parent node */
|
||||
while (isspace(*ptr & 255))
|
||||
ptr ++;
|
||||
|
||||
safe_strcpy(comment->value.text.string, ptr);
|
||||
safe_strcpy(comment->value.opaque, ptr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Eliminate leading and trailing *'s...
|
||||
*/
|
||||
|
||||
for (ptr = comment->value.text.string; *ptr == '*'; ptr ++);
|
||||
for (ptr = comment->value.opaque; *ptr == '*'; ptr ++);
|
||||
for (; isspace(*ptr & 255); ptr ++);
|
||||
if (ptr > comment->value.text.string)
|
||||
safe_strcpy(comment->value.text.string, ptr);
|
||||
if (ptr > comment->value.opaque)
|
||||
safe_strcpy(comment->value.opaque, ptr);
|
||||
|
||||
for (ptr = comment->value.text.string + strlen(comment->value.text.string) - 1;
|
||||
ptr > comment->value.text.string && *ptr == '*';
|
||||
for (ptr = comment->value.opaque + strlen(comment->value.opaque) - 1;
|
||||
ptr > comment->value.opaque && *ptr == '*';
|
||||
ptr --)
|
||||
*ptr = '\0';
|
||||
for (; ptr > comment->value.text.string && isspace(*ptr & 255); ptr --)
|
||||
for (; ptr > comment->value.opaque && isspace(*ptr & 255); ptr --)
|
||||
*ptr = '\0';
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, " updated comment = %s\n", comment->value.text.string);
|
||||
fprintf(stderr, " updated comment = %s\n", comment->value.opaque);
|
||||
#endif /* DEBUG */
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user