mirror of
https://github.com/michaelrsweet/mxml.git
synced 2024-11-08 13:39:58 +00:00
Prelim changes to mxmldoc; think I'll be revamping the code parser
completely...
This commit is contained in:
parent
466072f832
commit
6bc3523143
@ -16,6 +16,7 @@
|
||||
<li><a href="#_structures">Structures</a></li>
|
||||
<li><a href="#_types">Types</a></li>
|
||||
<li><a href="#_unions">Unions</a></li>
|
||||
<li><a href="#_variables">Variables</a></li>
|
||||
</ul>
|
||||
<hr noshade/>
|
||||
<h1><a name="_enumerations">Enumerations</a></h1>
|
||||
@ -37,6 +38,7 @@
|
||||
<hr noshade/>
|
||||
<h1><a name="_functions">Functions</a></h1>
|
||||
<ul>
|
||||
<li><a href="#calloc"><tt>calloc()</tt></a></li>
|
||||
<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>
|
||||
@ -63,7 +65,24 @@
|
||||
<li><a href="#mxmlSetTextf"><tt>mxmlSetTextf()</tt></a></li>
|
||||
<li><a href="#mxmlWalkNext"><tt>mxmlWalkNext()</tt></a></li>
|
||||
<li><a href="#mxmlWalkPrev"><tt>mxmlWalkPrev()</tt></a></li>
|
||||
<li><a href="#realloc"><tt>realloc()</tt></a></li>
|
||||
</ul>
|
||||
<h2><a name="calloc">calloc()</a></h2>
|
||||
<p></p>
|
||||
<h3>Syntax</h3>
|
||||
<pre>
|
||||
if((node
|
||||
calloc(
|
||||
sizeof(<a href="#mxml_node_t">mxml_node_t</a>))) NULL);
|
||||
</pre>
|
||||
<h3>Arguments</h3>
|
||||
<p class="table"><table align="center" border="1" width="80%">
|
||||
<thead><tr><th>Name</th><th>Description</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><tt>NULL</tt></td><td></td></tr>
|
||||
</tbody></table></p>
|
||||
<h3>Returns</h3>
|
||||
<p></p>
|
||||
<h2><a name="mxmlAdd">mxmlAdd()</a></h2>
|
||||
<p>Add a node to a tree.
|
||||
|
||||
@ -683,6 +702,22 @@ mxmlWalkPrev(
|
||||
</tbody></table></p>
|
||||
<h3>Returns</h3>
|
||||
<p>Previous node or NULL</p>
|
||||
<h2><a name="realloc">realloc()</a></h2>
|
||||
<p>Current buffer size</p>
|
||||
<h3>Syntax</h3>
|
||||
<pre>
|
||||
if((newbuffer
|
||||
realloc(
|
||||
buffer, *bufsize)) NULL);
|
||||
</pre>
|
||||
<h3>Arguments</h3>
|
||||
<p class="table"><table align="center" border="1" width="80%">
|
||||
<thead><tr><th>Name</th><th>Description</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><tt>NULL</tt></td><td></td></tr>
|
||||
</tbody></table></p>
|
||||
<h3>Returns</h3>
|
||||
<p>Increase the size of the buffer...</p>
|
||||
<hr noshade/>
|
||||
<h1><a name="_structures">Structures</a></h1>
|
||||
<ul>
|
||||
@ -845,5 +880,29 @@ struct mxml_value_u
|
||||
<tr><td><tt>real</tt></td><td>Real number</td></tr>
|
||||
<tr><td><tt>text</tt></td><td>Text fragment</td></tr>
|
||||
</tbody></table></p>
|
||||
<hr noshade/>
|
||||
<h1><a name="_variables">Variables</a></h1>
|
||||
<ul>
|
||||
<li><a href="#newbuffer"><tt>newbuffer</tt></a></li>
|
||||
<li><a href="#node"><tt>node</tt></a></li>
|
||||
<li><a href="#type"><tt>type</tt></a></li>
|
||||
</ul>
|
||||
<h2><a name="newbuffer">newbuffer</a></h2>
|
||||
<h3>Definition</h3>
|
||||
<pre>
|
||||
buffer newbuffer;
|
||||
</pre>
|
||||
<h2><a name="node">node</a></h2>
|
||||
<p>New node</p>
|
||||
<h3>Definition</h3>
|
||||
<pre>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> * node;
|
||||
</pre>
|
||||
<h2><a name="type">type</a></h2>
|
||||
<p>Add to the parent if present...</p>
|
||||
<h3>Definition</h3>
|
||||
<pre>
|
||||
node type type;
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
11
mxml.xml
11
mxml.xml
@ -1,4 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<function name="calloc"><returnvalue><description/><type>if((node</type></returnvalue>
|
||||
<description/><argument name="NULL"><type>sizeof(mxml_node_t)))</type></argument>
|
||||
</function>
|
||||
<function name="mxmlAdd"><description>Add a node to a tree.
|
||||
|
||||
Adds the specified node to the parent. If the child argument is not
|
||||
@ -318,4 +321,10 @@ name="element"><type>mxml_element_t</type><description>Element</description></va
|
||||
<variable name="opaque"><type>char *</type><description>Opaque string</description></variable>
|
||||
<variable name="real"><type>double</type><description>Real number</description></variable>
|
||||
<variable name="text"><type>mxml_text_t</type><description>Text fragment</description></variable>
|
||||
</union>
|
||||
</union><variable name="newbuffer"><type>buffer</type></variable>
|
||||
<variable name="node"><type>mxml_node_t *</type><description>New node</description></variable>
|
||||
<function name="realloc"><returnvalue><description>Increase the size of the buffer...</description><type>if((newbuffer</type></returnvalue>
|
||||
<description>Current buffer size</description><argument name="NULL"><type>buffer,
|
||||
*bufsize))</type></argument>
|
||||
</function>
|
||||
<variable name="type"><type>node type</type><description>Add to the parent if present...</description></variable>
|
||||
|
20
mxmldoc.c
20
mxmldoc.c
@ -1,5 +1,6 @@
|
||||
//#define DEBUG 1
|
||||
/*
|
||||
* "$Id: mxmldoc.c,v 1.18 2003/12/03 03:59:04 mike Exp $"
|
||||
* "$Id: mxmldoc.c,v 1.19 2003/12/03 04:26:30 mike Exp $"
|
||||
*
|
||||
* Documentation generator using mini-XML, a small XML-like file parsing
|
||||
* library.
|
||||
@ -423,6 +424,9 @@ scan_file(const char *filename, /* I - Filename */
|
||||
break;
|
||||
|
||||
case '#' : /* Preprocessor */
|
||||
#ifdef DEBUG
|
||||
fputs(" #preprocessor...\n", stderr);
|
||||
#endif /* DEBUG */
|
||||
state = STATE_PREPROCESSOR;
|
||||
break;
|
||||
|
||||
@ -436,7 +440,11 @@ scan_file(const char *filename, /* I - Filename */
|
||||
|
||||
case '{' :
|
||||
#ifdef DEBUG
|
||||
fputs(" open brace...\n", stderr);
|
||||
fprintf(stderr, " open brace, function=%p, type=%p...\n",
|
||||
function, type);
|
||||
if (type)
|
||||
fprintf(stderr, " type->child=\"%s\"...\n",
|
||||
type->child->value.text.string);
|
||||
#endif /* DEBUG */
|
||||
|
||||
if (function)
|
||||
@ -604,6 +612,7 @@ scan_file(const char *filename, /* I - Filename */
|
||||
{
|
||||
mxmlDelete(type);
|
||||
type = NULL;
|
||||
braces --;
|
||||
}
|
||||
|
||||
braces ++;
|
||||
@ -661,6 +670,11 @@ scan_file(const char *filename, /* I - Filename */
|
||||
break;
|
||||
|
||||
case ';' :
|
||||
#ifdef DEBUG
|
||||
fputs("Identifier: <<<< ; >>>\n", stderr);
|
||||
fprintf(stderr, " function=%p, type=%p\n", function, type);
|
||||
#endif /* DEBUG */
|
||||
|
||||
if (function)
|
||||
{
|
||||
mxmlDelete(function);
|
||||
@ -2127,5 +2141,5 @@ ws_cb(mxml_node_t *node, /* I - Element node */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: mxmldoc.c,v 1.18 2003/12/03 03:59:04 mike Exp $".
|
||||
* End of "$Id: mxmldoc.c,v 1.19 2003/12/03 04:26:30 mike Exp $".
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user