diff --git a/CHANGES.md b/CHANGES.md index 9cfd2fa..feaec81 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,7 @@ Changes in Mini-XML 4.0.4 - Added Linux-specific build files and dropped unused `long long` config tests (Issue #335) +- Documentation fixes (Issue #337) - Fixed an issue when reporting errors with a `NULL` options pointer (Issue #329) - Fixed some compiler warnings (Issue #333) diff --git a/NOTICE b/NOTICE index 32928e8..175b57d 100644 --- a/NOTICE +++ b/NOTICE @@ -1,6 +1,6 @@ Mini-XML -Copyright © 2003-2024 by Michael R Sweet +Copyright © 2003-2025 by Michael R Sweet (Optional) Exceptions to the Apache 2.0 License: diff --git a/README.md b/README.md index 4928fda..960d7ed 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,7 @@ current version of this software, documentation, and Github issue tracking page. Legal Stuff ----------- -Copyright © 2003-2024 by Michael R Sweet +Copyright © 2003-2025 by Michael R Sweet The Mini-XML library is licensed under the Apache License Version 2.0 with an *optional* exception to allow linking against GPL2/LGPL2-only software. See the diff --git a/doc/mxml.3 b/doc/mxml.3 index 38e1044..a12d3b5 100644 --- a/doc/mxml.3 +++ b/doc/mxml.3 @@ -1,4 +1,4 @@ -.TH mxml 3 "Mini-XML API" "2024-11-17" "Mini-XML API" +.TH mxml 3 "Mini-XML API" "2025-01-19" "Mini-XML API" .SH NAME mxml \- Mini-XML API .SH INCLUDE FILE @@ -1112,20 +1112,19 @@ The default load/save options load values using the constant type The various \fBmxmlOptionsSet\fR functions are used to change the defaults, for example: .PP -\fB`\fRc -mxml_options_t \fIoptions = mxmlOptionsNew(); - -/\fR Load values as opaque strings */ -mxmlOptionsSetTypeValue(options, MXML_TYPE_OPAQUE); .nf + mxml_options_t *options = mxmlOptionsNew(); - Note: The most common programming error when using the Mini-XML library is - to load an XML file using the `MXML_TYPE_TEXT` node type, which returns - inline text as a series of whitespace-delimited words, instead of using the - `MXML_TYPE_OPAQUE` node type which returns the inline text as a single string - (including whitespace). + /* Load values as opaque strings */ + mxmlOptionsSetTypeValue(options, MXML_TYPE_OPAQUE); + .fi +Note: The most common programming error when using the Mini-XML library is +to load an XML file using the \fBMXML_TYPE_TEXT\fR node type, which returns +inline text as a series of whitespace-delimited words, instead of using the +\fBMXML_TYPE_OPAQUE\fR node type which returns the inline text as a single string +(including whitespace). .SS mxmlOptionsSetCustomCallbacks Set the custom data callbacks. .PP diff --git a/doc/mxml.epub b/doc/mxml.epub index 0993b76..e65fde2 100644 Binary files a/doc/mxml.epub and b/doc/mxml.epub differ diff --git a/doc/mxml.html b/doc/mxml.html index 637ea06..5d02071 100644 --- a/doc/mxml.html +++ b/doc/mxml.html @@ -3,7 +3,7 @@ Mini-XML 4.0 Programming Manual - + @@ -466,8 +466,9 @@ span.string {

If you have the pkg-config software installed, you can use it to determine the proper compiler and linker options for your installation:

gcc `pkg-config --cflags mxml4` -o myprogram myprogram.c `pkg-config --libs mxml4`
 
+

> Note: The library name "mxml4" is a configure-time option. If you use the

-

Note: The library name "mxml4" is a configure-time option. If you use the --disable-libmxml4-prefix configure option the library is named "mxml".

+

--disable-libmxml4-prefix configure option the library is named "mxml".

API Basics

Every piece of information in an XML file is stored in memory in "nodes". Nodes are represented by mxml_node_t pointers. Each node has an associated type, value(s), a parent node, sibling nodes (previous and next), potentially first and last child nodes, and an optional user data pointer.

@@ -2469,21 +2470,20 @@ reused for multiple calls to these functions and should be freed using the The default load/save options load values using the constant type MXML_TYPE_TEXT and save XML data with a wrap margin of 72 columns. The various mxmlOptionsSet functions are used to change the defaults, -for example:
-
-`c -mxml_options_t options = mxmlOptionsNew(); +for example: -/ Load values as opaque strings */ -mxmlOptionsSetTypeValue(options, MXML_TYPE_OPAQUE);
+mxml_options_t *options = mxmlOptionsNew();
+
+/* Load values as opaque strings */
+mxmlOptionsSetTypeValue(options, MXML_TYPE_OPAQUE);
+
Note: The most common programming error when using the Mini-XML library is -to load an XML file using the `MXML_TYPE_TEXT` node type, which returns +to load an XML file using the MXML_TYPE_TEXT node type, which returns inline text as a series of whitespace-delimited words, instead of using the -`MXML_TYPE_OPAQUE` node type which returns the inline text as a single string -(including whitespace). -

+MXML_TYPE_OPAQUE node type which returns the inline text as a single string +(including whitespace).

mxmlOptionsSetCustomCallbacks

Set the custom data callbacks.

diff --git a/mxml-options.c b/mxml-options.c index b6cbf36..4940c99 100644 --- a/mxml-options.c +++ b/mxml-options.c @@ -3,7 +3,7 @@ // // https://www.msweet.org/mxml // -// Copyright © 2003-2024 by Michael R Sweet. +// Copyright © 2003-2025 by Michael R Sweet. // // Licensed under Apache License v2.0. See the file "LICENSE" for more // information. @@ -40,7 +40,7 @@ mxmlOptionsDelete( // The various `mxmlOptionsSet` functions are used to change the defaults, // for example: // -// ```c +// ``` // mxml_options_t *options = mxmlOptionsNew(); // // /* Load values as opaque strings */ diff --git a/testmxml.c b/testmxml.c index cdd3106..c0989c3 100644 --- a/testmxml.c +++ b/testmxml.c @@ -8,7 +8,7 @@ // // https://www.msweet.org/mxml // -// Copyright © 2003-2024 by Michael R Sweet. +// Copyright © 2003-2025 by Michael R Sweet. // // Licensed under Apache License v2.0. See the file "LICENSE" for more // information. @@ -616,6 +616,10 @@ main(int argc, // I - Number of command-line args } } + // Free memory used by options - not explicitly required here since we are + // just exiting, but long-running programs should do this... + mxmlOptionsDelete(options); + #ifndef _WIN32 // Debug hooks... if (getenv("TEST_DELAY") != NULL)