diff --git a/doc/reference.html b/doc/reference.html
index 7321000..42fb5bd 100644
--- a/doc/reference.html
+++ b/doc/reference.html
@@ -278,6 +278,13 @@ void mxmlAdd (
Adds the specified node to the parent. If the child argument is not
+NULL
, puts the new node before or after the specified child depending
+on 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 constant
+MXML_ADD_TO_PARENT
can be used to specify a NULL
child pointer.
Delete a node and all of its children.
@@ -289,6 +296,9 @@ void mxmlDelete (
If the specified node has a parent, this function first removes the
+node from its parent using the mxmlRemove
function.
Delete an attribute.
@@ -319,6 +329,9 @@ const char *mxmlElementGetAttr (
Attribute value or NULL
This function returns NULL
if the node is not an element or the
+named attribute does not exist.
Get an element attribute by index.
@@ -338,6 +351,11 @@ const char *mxmlElementGetAttrByIndex (
Attribute value
+The index ("idx") is 0-based. NULL
is returned if the specified index
+is out of range.
+
+
Get the number of element attributes.
@@ -368,6 +386,11 @@ void mxmlElementSetAttr (
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.
Set an attribute with a formatted value.
@@ -388,6 +411,13 @@ void mxmlElementSetAttrf (
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. + +
Add a callback to convert entities to Unicode.
@@ -414,6 +444,8 @@ const char *mxmlEntityGetName (
Entity name or NULL
If val does not need to be represented by a named entity, NULL
is returned.
Get the character corresponding to a named entity.
@@ -427,6 +459,9 @@ int mxmlEntityGetValue (
Character value or -1 on error
+The entity name can also be a numeric constant. -1 is returned if the +name is not known.
Remove a callback.
@@ -466,6 +501,15 @@ void mxmlEntityRemoveCallback (
Element node or NULL
The search is constrained by the name, attribute name, and value; any
+NULL
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
+MXML_DESCEND_FIRST
for the initial search and MXML_NO_DESCEND
+to find additional direct descendents of the node. The top node argument
+constrains the search to a particular node's children.
Find a node with the given path.
@@ -482,6 +526,15 @@ void mxmlEntityRemoveCallback (
Found node or NULL
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.
+
+The first child node of the found node is returned if the given node has
+children and the first child is a value node.
+
+
Get the value for a CDATA node.
@@ -495,6 +548,10 @@ const char *mxmlGetCDATA (
CDATA value or NULL
NULL
is returned if the node is not a CDATA element.
+
+
Get the value for a custom node.
@@ -508,6 +565,11 @@ const void *mxmlGetCustom (
Custom value or NULL
NULL
is returned if the node (or its first child) is not a custom
+value node.
+
+
Get the name for an element node.
@@ -521,6 +583,10 @@ const char *mxmlGetElement (
Element name or NULL
NULL
is returned if the node is not an element node.
+
+
Get the first child of an element node.
@@ -534,6 +600,11 @@ const char *mxmlGetElement (
First child or NULL
NULL
is returned if the node is not an element node or if the node
+has no children.
+
+
Get the integer value from the specified node or its first child.
@@ -548,6 +619,10 @@ int mxmlGetInteger (Integer value or 0
+0 is returned if the node (or its first child) is not an integer value node. + +
Get the last child of an element node.
@@ -561,6 +636,11 @@ int mxmlGetInteger (
Last child or NULL
NULL
is returned if the node is not an element node or if the node
+has no children.
+
+
Return the node type...
@@ -590,6 +670,11 @@ const char *mxmlGetOpaque (
Opaque string or NULL
NULL
is returned if the node (or its first child) is not an opaque
+value node.
+
+
Get the parent node.
@@ -603,6 +688,10 @@ const char *mxmlGetOpaque (
Parent node or NULL
NULL
is returned for a root node.
+
+
Get the previous node for the current parent.
@@ -616,6 +705,10 @@ const char *mxmlGetOpaque (
Previous node or NULL
NULL
is returned if this is the first child for the current parent.
+
+
Get the real value for a node or its first child.
@@ -629,6 +722,10 @@ double mxmlGetReal (
Real value or 0.0
+0.0 is returned if the node (or its first child) is not a real value node. + +
Get the current reference (use) count for a node.
@@ -642,6 +739,12 @@ int mxmlGetRefCount (
Reference count
+The initial reference count of new nodes is 1. Use the mxmlRetain
+and mxmlRelease
functions to increment and decrement a node's
+reference count.
+
+.
Get the text value for a node or its first child.
@@ -658,6 +761,11 @@ const char *mxmlGetText (
Text string or NULL
NULL
is returned if the node (or its first child) is not a text node.
+The "whitespace" argument can be NULL
.
+
+
Get the node type.
@@ -671,6 +779,10 @@ const char *mxmlGetText (
Type of node
+MXML_IGNORE
is returned if "node" is NULL
.
+
+
Get the user data pointer for a node.
@@ -708,6 +820,10 @@ void mxmlIndexDelete (
Next node or NULL
if there is none
You should call mxmlIndexReset
prior to using this function to get
+the first node in the index. Nodes are returned in the sorted order of the
+index.
Find the next matching node.
@@ -727,6 +843,11 @@ void mxmlIndexDelete (
Node or NULL
if none found
You should call mxmlIndexReset
prior to using this function for
+the first time with a particular set of "element" and "value"
+strings. Passing NULL
for both "element" and "value" is equivalent
+to calling mxmlIndexEnum
.
Get the number of nodes in an index.
@@ -759,6 +880,12 @@ int mxmlIndexGetCount (
New index
+The index will contain all nodes that contain the named element and/or
+attribute. If both "element" and "attr" are NULL
, 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.
Reset the enumeration/find pointer in the index and return the first node in the index.
@@ -773,6 +900,9 @@ return the first node in the index.First node or NULL
if there is none
This function should be called prior to using mxmlIndexEnum
or
+mxmlIndexFind
for the first time.
Load a file descriptor into an XML node tree.
@@ -792,6 +922,14 @@ return the first node in the index.
First node or NULL
if the file could not be read.
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 MXML_INTEGER_CALLBACK
, MXML_OPAQUE_CALLBACK
,
+MXML_REAL_CALLBACK
, and MXML_TEXT_CALLBACK
are defined for
+loading child (data) nodes of the specified type.
Load a file into an XML node tree.
@@ -811,6 +949,14 @@ return the first node in the index.
First node or NULL
if the file could not be read.
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 MXML_INTEGER_CALLBACK
, MXML_OPAQUE_CALLBACK
,
+MXML_REAL_CALLBACK
, and MXML_TEXT_CALLBACK
are defined for
+loading child (data) nodes of the specified type.
Load a string into an XML node tree.
@@ -830,6 +976,14 @@ return the first node in the index.
First node or NULL
if the string has errors.
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 MXML_INTEGER_CALLBACK
, MXML_OPAQUE_CALLBACK
,
+MXML_REAL_CALLBACK
, and MXML_TEXT_CALLBACK
are defined for
+loading child (data) nodes of the specified type.
Create a new CDATA node.
@@ -846,6 +1000,14 @@ return the first node in the index.
New node
+The new CDATA node is added to the end of the specified parent's child
+list. The constant MXML_NO_PARENT
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
+MXML_ELEMENT
type.
+
+
Create a new custom data node.
@@ -865,6 +1027,13 @@ return the first node in the index.
New node
+The new custom node is added to the end of the specified parent's child
+list. The constant MXML_NO_PARENT
can be used to specify that the new
+element node has no parent. NULL
can be passed when the data in the
+node is not dynamically allocated or is separately managed.
+
+
Create a new element node.
@@ -881,6 +1050,10 @@ return the first node in the index.
New node
+The new element node is added to the end of the specified parent's child
+list. The constant MXML_NO_PARENT
can be used to specify that the new
+element node has no parent.
Create a new integer node.
@@ -897,6 +1070,10 @@ return the first node in the index.
New node
+The new integer node is added to the end of the specified parent's child
+list. The constant MXML_NO_PARENT
can be used to specify that the new
+integer node has no parent.
Create a new opaque string.
@@ -913,6 +1090,11 @@ return the first node in the index.
New node
+The new opaque string node is added to the end of the specified parent's
+child list. The constant MXML_NO_PARENT
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.
Create a new formatted opaque string node.
@@ -932,6 +1114,11 @@ return the first node in the index.
New node
+The new opaque string node is added to the end of the specified parent's
+child list. The constant MXML_NO_PARENT
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.
Create a new real number node.
@@ -948,6 +1135,10 @@ return the first node in the index.
New node
+The new real number node is added to the end of the specified parent's
+child list. The constant MXML_NO_PARENT
can be used to specify that
+the new real number node has no parent.
Create a new text fragment node.
@@ -967,6 +1158,12 @@ return the first node in the index.
New node
+The new text node is added to the end of the specified parent's child
+list. The constant MXML_NO_PARENT
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.
Create a new formatted text fragment node.
@@ -989,6 +1186,12 @@ return the first node in the index.
New node
+The new text node is added to the end of the specified parent's child
+list. The constant MXML_NO_PARENT
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.
Create a new XML document tree.
@@ -1002,6 +1205,11 @@ return the first node in the index.
New ?xml node
+The "version" argument specifies the version number to put in the
+?xml element node. If NULL
, version "1.0" is assumed.
+
+
Release a node.
@@ -1015,6 +1223,11 @@ int mxmlRelease (
New reference count
+When the reference count reaches zero, the node (and any children)
+is deleted via mxmlDelete
.
+
+
Remove a node from its parent.
@@ -1026,6 +1239,9 @@ void mxmlRemove (
This function does not free memory used by the node - use mxmlDelete
+for that. This function does nothing if the node has no parent.
Retain a node.
@@ -1065,6 +1281,20 @@ using a SAX callback.
First node or NULL
if the file could not be read.
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 MXML_INTEGER_CALLBACK
, MXML_OPAQUE_CALLBACK
,
+MXML_REAL_CALLBACK
, and MXML_TEXT_CALLBACK
are defined for
+loading child nodes of the specified type.
+
+The SAX callback must call mxmlRetain
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.
+
+
Load a file into an XML node tree using a SAX callback.
@@ -1091,6 +1321,20 @@ using a SAX callback.First node or NULL
if the file could not be read.
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 MXML_INTEGER_CALLBACK
, MXML_OPAQUE_CALLBACK
,
+MXML_REAL_CALLBACK
, and MXML_TEXT_CALLBACK
are defined for
+loading child nodes of the specified type.
+
+The SAX callback must call mxmlRetain
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.
+
+
Load a string into an XML node tree using a SAX callback.
@@ -1117,6 +1361,20 @@ using a SAX callback.First node or NULL
if the string has errors.
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 MXML_INTEGER_CALLBACK
, MXML_OPAQUE_CALLBACK
,
+MXML_REAL_CALLBACK
, and MXML_TEXT_CALLBACK
are defined for
+loading child nodes of the specified type.
+
+The SAX callback must call mxmlRetain
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.
+
+
Save an XML tree to an allocated string.
@@ -1133,6 +1391,18 @@ char *mxmlSaveAllocString (
Allocated string or NULL
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. NULL
is returned
+if the node would produce an empty string or if the string cannot be
+allocated.
+
+The callback argument specifies a function that returns a whitespace
+string or NULL before and after each element. If MXML_NO_CALLBACK
+is specified, whitespace will only be added before MXML_TEXT
nodes
+with leading whitespace and before attribute names inside opening
+element tags.
Save an XML tree to a file descriptor.
@@ -1152,6 +1422,12 @@ int mxmlSaveFd (
0 on success, -1 on error.
+The callback argument specifies a function that returns a whitespace
+string or NULL before and after each element. If MXML_NO_CALLBACK
+is specified, whitespace will only be added before MXML_TEXT
nodes
+with leading whitespace and before attribute names inside opening
+element tags.
Save an XML tree to a file.
@@ -1171,6 +1447,12 @@ int mxmlSaveFile (
0 on success, -1 on error.
+The callback argument specifies a function that returns a whitespace
+string or NULL before and after each element. If MXML_NO_CALLBACK
+is specified, whitespace will only be added before MXML_TEXT
nodes
+with leading whitespace and before attribute names inside opening
+element tags.
Save an XML node tree to a string.
@@ -1193,6 +1475,16 @@ int mxmlSaveString (
Size of string
+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.
+
+The callback argument specifies a function that returns a whitespace
+string or NULL before and after each element. If MXML_NO_CALLBACK
+is specified, whitespace will only be added before MXML_TEXT
nodes
+with leading whitespace and before attribute names inside opening
+element tags.
Set the element name of a CDATA node.
@@ -1209,6 +1501,10 @@ int mxmlSetCDATA (
0 on success, -1 on failure
+The node is not changed if it (or its first child) is not a CDATA element node. + +
Set the data and destructor of a custom data node.
@@ -1228,6 +1524,10 @@ int mxmlSetCustom (
0 on success, -1 on failure
+The node is not changed if it (or its first child) is not a custom node. + +
Set the handling functions for custom data.
@@ -1242,6 +1542,12 @@ void mxmlSetCustomHandlers (
The load function accepts a node pointer and a data string and must
+return 0 on success and non-zero on error.
+
+The save function accepts a node pointer and must return a malloc'd
+string on success and NULL
on error.
Set the name of an element node.
@@ -1258,6 +1564,8 @@ int mxmlSetElement (
0 on success, -1 on failure
+The node is not changed if it is not an element node.
Set the error message callback.
@@ -1285,6 +1593,8 @@ int mxmlSetInteger (
0 on success, -1 on failure
+The node is not changed if it (or its first child) is not an integer node.
Set the value of an opaque node.
@@ -1301,6 +1611,8 @@ int mxmlSetOpaque (
0 on success, -1 on failure
+The node is not changed if it (or its first child) is not an opaque node.
Set the value of an opaque string node to a formatted string.
@@ -1320,6 +1632,10 @@ int mxmlSetOpaquef (
0 on success, -1 on failure
+The node is not changed if it (or its first child) is not an opaque node. + +
Set the value of a real number node.
@@ -1336,6 +1652,8 @@ int mxmlSetReal (
0 on success, -1 on failure
+The node is not changed if it (or its first child) is not a real number node.
Set the value of a text node.
@@ -1355,6 +1673,8 @@ int mxmlSetText (
0 on success, -1 on failure
+The node is not changed if it (or its first child) is not a text node.
Set the value of a text node to a formatted string.
@@ -1377,6 +1697,8 @@ int mxmlSetTextf (
0 on success, -1 on failure
+The node is not changed if it (or its first child) is not a text node.
Set the user data pointer for a node.
@@ -1404,6 +1726,10 @@ void mxmlSetWrapMargin (
Wrapping is disabled when "column" is 0. + +
Walk to the next logical node in the tree.
@@ -1423,6 +1749,10 @@ void mxmlSetWrapMargin (
Next node or NULL
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.
Walk to the previous logical node in the tree.
@@ -1442,6 +1772,10 @@ void mxmlSetWrapMargin (
Previous node or NULL
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.
Custom data destructor
diff --git a/mxmldoc.c b/mxmldoc.c index 575a534..639f262 100644 --- a/mxmldoc.c +++ b/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 */ }