From 2181cfb68860d2812290e62d900c059b08b79b06 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 9 Sep 2007 07:02:33 +0000 Subject: [PATCH] Web page overhaul. --- www/articles.php | 95 +- www/comment.php | 34 +- www/docfiles/Abbreviations.html | 66 - ...BuildingInstallingandPackagingMiniXML.html | 46 - www/docfiles/ChangingNodeValues.html | 55 - www/docfiles/CommentingYourCode.html | 102 - www/docfiles/CompilingMiniXML.html | 40 - .../CompilingwithCommandLineTools.html | 58 - www/docfiles/CompilingwithVisualC.html | 41 - www/docfiles/Contents.html | 46 - www/docfiles/ControllingLineWrapping.html | 50 - www/docfiles/CreatingMiniXMLPackages.html | 65 - www/docfiles/CreatingXMLDocuments.html | 98 - www/docfiles/CustomDataTypes.html | 176 -- www/docfiles/Enumerations.html | 44 - www/docfiles/FindingandIteratingNodes.html | 158 -- www/docfiles/FormattedText.html | 49 - www/docfiles/Functions.html | 147 -- www/docfiles/GettingStartedwithMiniXML.html | 56 - www/docfiles/Indexing.html | 111 - www/docfiles/InstallingMiniXML.html | 45 - www/docfiles/Introduction.html | 68 - www/docfiles/LegalStuff.html | 47 - www/docfiles/LibraryReference.html | 38 - www/docfiles/LoadCallbacks.html | 101 - www/docfiles/LoadingXML.html | 84 - www/docfiles/MiniXML21mxmlNewCustom.html | 65 - www/docfiles/MiniXML21mxmlSetCustom.html | 62 - www/docfiles/MiniXML21mxmlcustoms.html | 58 - www/docfiles/MiniXML21mxmlcustomt.html | 46 - .../MiniXML23mxmlElementSetAttrf.html | 67 - www/docfiles/MiniXML23mxmlNewCDATA.html | 63 - www/docfiles/MiniXML23mxmlNewXML.html | 59 - www/docfiles/MiniXML23mxmlRelease.html | 60 - www/docfiles/MiniXML23mxmlRetain.html | 58 - www/docfiles/MiniXML23mxmlSAXLoadFd.html | 76 - www/docfiles/MiniXML23mxmlSAXLoadFile.html | 76 - www/docfiles/MiniXML23mxmlSAXLoadString.html | 76 - www/docfiles/MiniXML23mxmlSetCDATA.html | 60 - www/docfiles/MiniXML23mxmlSetWrapMargin.html | 58 - .../MoreMiniXMLProgrammingTechniques.html | 41 - www/docfiles/Nodes.html | 118 -- www/docfiles/NotationConventions.html | 68 - www/docfiles/OrganizationofThisDocument.html | 64 - www/docfiles/OtherReferences.html | 51 - www/docfiles/SAXStreamLoadingofDocuments.html | 164 -- www/docfiles/SaveCallbacks.html | 133 -- www/docfiles/SavingXML.html | 76 - www/docfiles/Structures.html | 51 - www/docfiles/TheBasics.html | 53 - www/docfiles/TheBasics1.html | 80 - .../TitlesSectionsandIntroductions.html | 66 - www/docfiles/Types.html | 67 - www/docfiles/Unions.html | 42 - www/docfiles/UsingthemxmldocUtility.html | 40 - www/docfiles/advanced.html | 578 ++++++ www/docfiles/basics.html | 440 ++++ www/docfiles/index.html | 261 ++- www/docfiles/install.html | 115 ++ www/docfiles/intro.html | 182 ++ .../{MiniXMLLicense.html => license.html} | 12 +- www/docfiles/mxmlAdd.html | 69 - www/docfiles/mxmlDelete.html | 58 - www/docfiles/mxmlElementGetAttr.html | 59 - www/docfiles/mxmlElementSetAttr.html | 61 - www/docfiles/mxmlEntityAddCallback.html | 49 - www/docfiles/mxmlEntityGetName.html | 57 - www/docfiles/mxmlEntityGetValue.html | 57 - www/docfiles/mxmlEntityRemoveCallback.html | 49 - www/docfiles/mxmlFindElement.html | 72 - www/docfiles/mxmlIndexDelete.html | 56 - www/docfiles/mxmlIndexEnum.html | 57 - www/docfiles/mxmlIndexFind.html | 62 - www/docfiles/mxmlIndexNew.html | 63 - www/docfiles/mxmlIndexReset.html | 59 - www/docfiles/mxmlLoadFd.html | 68 - www/docfiles/mxmlLoadFile.html | 68 - www/docfiles/mxmlLoadString.html | 68 - www/docfiles/mxmlNewElement.html | 60 - www/docfiles/mxmlNewInteger.html | 60 - www/docfiles/mxmlNewOpaque.html | 61 - www/docfiles/mxmlNewReal.html | 60 - www/docfiles/mxmlNewText.html | 64 - www/docfiles/mxmlNewTextf.html | 65 - www/docfiles/mxmlRemove.html | 58 - www/docfiles/mxmlSaveAllocString.html | 69 - www/docfiles/mxmlSaveFd.html | 64 - www/docfiles/mxmlSaveFile.html | 64 - www/docfiles/mxmlSaveString.html | 68 - www/docfiles/mxmlSetCustomHandlers.html | 63 - www/docfiles/mxmlSetElement.html | 58 - www/docfiles/mxmlSetErrorCallback.html | 57 - www/docfiles/mxmlSetInteger.html | 58 - www/docfiles/mxmlSetOpaque.html | 58 - www/docfiles/mxmlSetReal.html | 58 - www/docfiles/mxmlSetText.html | 60 - www/docfiles/mxmlSetTextf.html | 61 - www/docfiles/mxmlWalkNext.html | 63 - www/docfiles/mxmlWalkPrev.html | 63 - www/docfiles/mxmlattrs.html | 55 - www/docfiles/mxmlattrt.html | 44 - www/docfiles/mxmlcustomdestroycbt.html | 44 - www/docfiles/mxmlcustomloadcbt.html | 45 - www/docfiles/mxmlcustomsavecbt.html | 45 - www/docfiles/mxmldoc.html | 180 ++ www/docfiles/mxmlelements.html | 57 - www/docfiles/mxmlelementt.html | 44 - www/docfiles/mxmlerrorcbt.html | 43 - www/docfiles/mxmlindexs.html | 61 - www/docfiles/mxmlindext.html | 44 - www/docfiles/mxmlloadcbt.html | 44 - www/docfiles/mxmlnodes.html | 69 - www/docfiles/mxmlnodet.html | 44 - www/docfiles/mxmlsavecbt.html | 44 - www/docfiles/mxmlsaxcbt.html | 44 - www/docfiles/mxmlsaxevente.html | 54 - www/docfiles/mxmlsaxeventt.html | 44 - www/docfiles/mxmltexts.html | 55 - www/docfiles/mxmltextt.html | 44 - www/docfiles/mxmltypee.html | 58 - www/docfiles/mxmlvaluet.html | 44 - www/docfiles/mxmlvalueu.html | 65 - www/docfiles/refapp.html | 1794 +++++++++++++++++ .../{ReleaseNotes.html => relnotes.html} | 12 +- www/docfiles/{XMLSchema.html => schema.html} | 7 +- www/docfiles/search.index | Bin 0 -> 13261 bytes www/documentation.php | 126 +- www/images/bottom-left.gif | Bin 475 -> 0 bytes www/images/bottom-right.gif | Bin 477 -> 0 bytes www/images/hdr-bottom-left.gif | Bin 122 -> 0 bytes www/images/hdr-bottom-right.gif | Bin 123 -> 0 bytes www/images/hdr-top-left.gif | Bin 121 -> 0 bytes www/images/hdr-top-right.gif | Bin 121 -> 0 bytes www/images/logo-large.gif | Bin 0 -> 5190 bytes www/images/logo.gif | Bin 1249 -> 846 bytes www/images/top-left.gif | Bin 474 -> 0 bytes www/images/top-right.gif | Bin 475 -> 0 bytes www/index.php | 126 +- www/links.php | 1046 ---------- www/logo.png | Bin 35955 -> 0 bytes www/phplib/db-sqlite.php | 164 -- www/phplib/globals.php | 6 +- www/phplib/html.php | 191 +- www/software.php | 43 +- www/str.php | 150 +- www/style.css | 103 +- 146 files changed, 3904 insertions(+), 8965 deletions(-) delete mode 100644 www/docfiles/Abbreviations.html delete mode 100644 www/docfiles/BuildingInstallingandPackagingMiniXML.html delete mode 100644 www/docfiles/ChangingNodeValues.html delete mode 100644 www/docfiles/CommentingYourCode.html delete mode 100644 www/docfiles/CompilingMiniXML.html delete mode 100644 www/docfiles/CompilingwithCommandLineTools.html delete mode 100644 www/docfiles/CompilingwithVisualC.html delete mode 100644 www/docfiles/Contents.html delete mode 100644 www/docfiles/ControllingLineWrapping.html delete mode 100644 www/docfiles/CreatingMiniXMLPackages.html delete mode 100644 www/docfiles/CreatingXMLDocuments.html delete mode 100644 www/docfiles/CustomDataTypes.html delete mode 100644 www/docfiles/Enumerations.html delete mode 100644 www/docfiles/FindingandIteratingNodes.html delete mode 100644 www/docfiles/FormattedText.html delete mode 100644 www/docfiles/Functions.html delete mode 100644 www/docfiles/GettingStartedwithMiniXML.html delete mode 100644 www/docfiles/Indexing.html delete mode 100644 www/docfiles/InstallingMiniXML.html delete mode 100644 www/docfiles/Introduction.html delete mode 100644 www/docfiles/LegalStuff.html delete mode 100644 www/docfiles/LibraryReference.html delete mode 100644 www/docfiles/LoadCallbacks.html delete mode 100644 www/docfiles/LoadingXML.html delete mode 100644 www/docfiles/MiniXML21mxmlNewCustom.html delete mode 100644 www/docfiles/MiniXML21mxmlSetCustom.html delete mode 100644 www/docfiles/MiniXML21mxmlcustoms.html delete mode 100644 www/docfiles/MiniXML21mxmlcustomt.html delete mode 100644 www/docfiles/MiniXML23mxmlElementSetAttrf.html delete mode 100644 www/docfiles/MiniXML23mxmlNewCDATA.html delete mode 100644 www/docfiles/MiniXML23mxmlNewXML.html delete mode 100644 www/docfiles/MiniXML23mxmlRelease.html delete mode 100644 www/docfiles/MiniXML23mxmlRetain.html delete mode 100644 www/docfiles/MiniXML23mxmlSAXLoadFd.html delete mode 100644 www/docfiles/MiniXML23mxmlSAXLoadFile.html delete mode 100644 www/docfiles/MiniXML23mxmlSAXLoadString.html delete mode 100644 www/docfiles/MiniXML23mxmlSetCDATA.html delete mode 100644 www/docfiles/MiniXML23mxmlSetWrapMargin.html delete mode 100644 www/docfiles/MoreMiniXMLProgrammingTechniques.html delete mode 100644 www/docfiles/Nodes.html delete mode 100644 www/docfiles/NotationConventions.html delete mode 100644 www/docfiles/OrganizationofThisDocument.html delete mode 100644 www/docfiles/OtherReferences.html delete mode 100644 www/docfiles/SAXStreamLoadingofDocuments.html delete mode 100644 www/docfiles/SaveCallbacks.html delete mode 100644 www/docfiles/SavingXML.html delete mode 100644 www/docfiles/Structures.html delete mode 100644 www/docfiles/TheBasics.html delete mode 100644 www/docfiles/TheBasics1.html delete mode 100644 www/docfiles/TitlesSectionsandIntroductions.html delete mode 100644 www/docfiles/Types.html delete mode 100644 www/docfiles/Unions.html delete mode 100644 www/docfiles/UsingthemxmldocUtility.html create mode 100644 www/docfiles/advanced.html create mode 100644 www/docfiles/basics.html create mode 100644 www/docfiles/install.html create mode 100644 www/docfiles/intro.html rename www/docfiles/{MiniXMLLicense.html => license.html} (98%) delete mode 100644 www/docfiles/mxmlAdd.html delete mode 100644 www/docfiles/mxmlDelete.html delete mode 100644 www/docfiles/mxmlElementGetAttr.html delete mode 100644 www/docfiles/mxmlElementSetAttr.html delete mode 100644 www/docfiles/mxmlEntityAddCallback.html delete mode 100644 www/docfiles/mxmlEntityGetName.html delete mode 100644 www/docfiles/mxmlEntityGetValue.html delete mode 100644 www/docfiles/mxmlEntityRemoveCallback.html delete mode 100644 www/docfiles/mxmlFindElement.html delete mode 100644 www/docfiles/mxmlIndexDelete.html delete mode 100644 www/docfiles/mxmlIndexEnum.html delete mode 100644 www/docfiles/mxmlIndexFind.html delete mode 100644 www/docfiles/mxmlIndexNew.html delete mode 100644 www/docfiles/mxmlIndexReset.html delete mode 100644 www/docfiles/mxmlLoadFd.html delete mode 100644 www/docfiles/mxmlLoadFile.html delete mode 100644 www/docfiles/mxmlLoadString.html delete mode 100644 www/docfiles/mxmlNewElement.html delete mode 100644 www/docfiles/mxmlNewInteger.html delete mode 100644 www/docfiles/mxmlNewOpaque.html delete mode 100644 www/docfiles/mxmlNewReal.html delete mode 100644 www/docfiles/mxmlNewText.html delete mode 100644 www/docfiles/mxmlNewTextf.html delete mode 100644 www/docfiles/mxmlRemove.html delete mode 100644 www/docfiles/mxmlSaveAllocString.html delete mode 100644 www/docfiles/mxmlSaveFd.html delete mode 100644 www/docfiles/mxmlSaveFile.html delete mode 100644 www/docfiles/mxmlSaveString.html delete mode 100644 www/docfiles/mxmlSetCustomHandlers.html delete mode 100644 www/docfiles/mxmlSetElement.html delete mode 100644 www/docfiles/mxmlSetErrorCallback.html delete mode 100644 www/docfiles/mxmlSetInteger.html delete mode 100644 www/docfiles/mxmlSetOpaque.html delete mode 100644 www/docfiles/mxmlSetReal.html delete mode 100644 www/docfiles/mxmlSetText.html delete mode 100644 www/docfiles/mxmlSetTextf.html delete mode 100644 www/docfiles/mxmlWalkNext.html delete mode 100644 www/docfiles/mxmlWalkPrev.html delete mode 100644 www/docfiles/mxmlattrs.html delete mode 100644 www/docfiles/mxmlattrt.html delete mode 100644 www/docfiles/mxmlcustomdestroycbt.html delete mode 100644 www/docfiles/mxmlcustomloadcbt.html delete mode 100644 www/docfiles/mxmlcustomsavecbt.html create mode 100644 www/docfiles/mxmldoc.html delete mode 100644 www/docfiles/mxmlelements.html delete mode 100644 www/docfiles/mxmlelementt.html delete mode 100644 www/docfiles/mxmlerrorcbt.html delete mode 100644 www/docfiles/mxmlindexs.html delete mode 100644 www/docfiles/mxmlindext.html delete mode 100644 www/docfiles/mxmlloadcbt.html delete mode 100644 www/docfiles/mxmlnodes.html delete mode 100644 www/docfiles/mxmlnodet.html delete mode 100644 www/docfiles/mxmlsavecbt.html delete mode 100644 www/docfiles/mxmlsaxcbt.html delete mode 100644 www/docfiles/mxmlsaxevente.html delete mode 100644 www/docfiles/mxmlsaxeventt.html delete mode 100644 www/docfiles/mxmltexts.html delete mode 100644 www/docfiles/mxmltextt.html delete mode 100644 www/docfiles/mxmltypee.html delete mode 100644 www/docfiles/mxmlvaluet.html delete mode 100644 www/docfiles/mxmlvalueu.html create mode 100644 www/docfiles/refapp.html rename www/docfiles/{ReleaseNotes.html => relnotes.html} (97%) rename www/docfiles/{XMLSchema.html => schema.html} (98%) create mode 100644 www/docfiles/search.index delete mode 100644 www/images/bottom-left.gif delete mode 100644 www/images/bottom-right.gif delete mode 100644 www/images/hdr-bottom-left.gif delete mode 100644 www/images/hdr-bottom-right.gif delete mode 100644 www/images/hdr-top-left.gif delete mode 100644 www/images/hdr-top-right.gif create mode 100644 www/images/logo-large.gif delete mode 100644 www/images/top-left.gif delete mode 100644 www/images/top-right.gif delete mode 100644 www/links.php delete mode 100644 www/logo.png delete mode 100644 www/phplib/db-sqlite.php diff --git a/www/articles.php b/www/articles.php index 49b4a5f..d1cd910 100644 --- a/www/articles.php +++ b/www/articles.php @@ -245,9 +245,8 @@ switch ($op) html_link("Modify Article #$id", "$PHP_SELF?M$id$options"); html_end_links(); - print("

Delete Article #$id

\n"); print("
" - ."

\n"); + ."
\n"); if (!$row['is_published']) print("\n"); - print("
This article is " @@ -264,7 +263,7 @@ switch ($op) print("
" ."

\n"); + print("\n"); html_footer(); } @@ -308,12 +307,9 @@ switch ($op) print("

This article is currently hidden from " ."public view.

\n"); - print("

Article #$id: $title

\n" - ."

$date by $create_user
$abstract

\n" - ."
\n" + print("

$date by $create_user
$abstract

\n" ."$contents\n" - ."
\n" - ."

Comments

\n"); + ."

Comments

\n"); html_start_links(); html_link("Submit Comment", "comment.php?r0+particles.php_L$id"); @@ -331,15 +327,11 @@ switch ($op) html_link("Submit Article", "$PHP_SELF?N$options"); html_end_links(); - print("

Articles

\n"); - print("

" ."Search Words:  " ."

\n"); - print("
\n"); - $query = ""; $prefix = "WHERE "; @@ -440,22 +432,22 @@ switch ($op) if ($count > $PAGE_MAX) { - print("

\n"); print("\n"); - print("
"); if ($index > 0) - print("[ Previous $PAGE_MAX ]"); + print("Previous $PAGE_MAX"); print(""); if ($end < $count) { $next_count = min($PAGE_MAX, $count - $end); - print("[ Next $next_count ]"); + print("Next $next_count"); } print("

\n"); + print("\n"); } html_start_table(array("ID","Title","Last Modified", "Comment(s)")); @@ -476,7 +468,7 @@ switch ($op) $temp = htmlspecialchars($row['title']); if ($row['is_published'] == 0) $temp .= " Private"; + ."border='0' align='absmiddle' alt='Private'>"; print("$link$temp"); @@ -494,41 +486,37 @@ switch ($op) html_end_row(); } + html_end_table(); + if ($LOGIN_LEVEL > 0) { - html_start_row("header"); - - print(" 
Published: "); + print("

Published: "); select_is_published(); - print("\n"); - - html_end_row(); + print("

\n"); } - html_end_table(); - if ($count > $PAGE_MAX) { - print("

\n"); print("\n"); - print("
"); if ($index > 0) - print("[ Previous $PAGE_MAX ]"); + print("Previous $PAGE_MAX"); print(""); if ($end < $count) { $next_count = min($PAGE_MAX, $count - $end); - print("[ Next $next_count ]"); + print("Next $next_count"); } print("

\n"); + print("\n"); } print("

private = hidden from public view

\n"); + ."align='absmiddle' alt='private'> = hidden from public view

\n"); } html_footer(); @@ -617,13 +605,11 @@ switch ($op) html_link("Article #$id", "$PHP_SELF?L$id$options"); html_end_links(); - print("

Modify Article #$id

\n"); - if ($REQUEST_METHOD == "POST") { print("

Error: Please fill in the fields marked in " ."bold red below and resubmit " - ."your article.


\n"); + ."your article.

\n"); $hstart = ""; $hend = ""; @@ -635,7 +621,7 @@ switch ($op) } print("
" - ."

\n"); + ."
\n"); if ($LOGIN_LEVEL >= AUTH_DEVEL) { @@ -644,7 +630,7 @@ switch ($op) print("\n"); } else - print("\n"); + print("\n"); $title = htmlspecialchars($title, ENT_QUOTES); @@ -653,7 +639,7 @@ switch ($op) else print(""); print("\n"); + ."size='80' value='$title'>\n"); $abstract = htmlspecialchars($abstract, ENT_QUOTES); @@ -662,7 +648,7 @@ switch ($op) else print(""); print("\n"); + ."size='80' value='$abstract'>\n"); $contents = htmlspecialchars($contents, ENT_QUOTES); @@ -681,8 +667,8 @@ switch ($op) ."TT, U, UL

\n"); print("\n"); - print("
Title:
Abstract:
" - ."

\n"); + ."\n"); + print("\n"); html_footer(); } @@ -771,13 +757,11 @@ switch ($op) html_link("Return to Articles", "$PHP_SELF?L$options"); html_end_links(); - print("

Submit Article

\n"); - if ($REQUEST_METHOD == "POST") { print("

Error: Please fill in the fields marked in " ."bold red below and resubmit " - ."your article.


\n"); + ."your article.

\n"); $hstart = ""; $hend = ""; @@ -788,15 +772,14 @@ switch ($op) ."examples, and case studies showing how you use $PROJECT_NAME. " ."We will proofread your article, and if we determine it is " ."appropriate for the site, we will make the article public " - ."on the site. Thank you for supporting $PROJECT_NAME!

\n" - ."
\n"); + ."on the site. Thank you for supporting $PROJECT_NAME!

\n"); $hstart = ""; $hend = ""; } print("
" - ."

\n"); + ."
\n"); if ($LOGIN_LEVEL >= AUTH_DEVEL) { @@ -805,7 +788,7 @@ switch ($op) print("\n"); } else - print("\n"); + print("\n"); $title = htmlspecialchars($title, ENT_QUOTES); @@ -814,7 +797,7 @@ switch ($op) else print(""); print("\n"); + ."size='80' value='$title'>\n"); $abstract = htmlspecialchars($abstract, ENT_QUOTES); @@ -823,7 +806,7 @@ switch ($op) else print(""); print("\n"); + ."size='80' value='$abstract'>\n"); $create_user = htmlspecialchars($create_user, ENT_QUOTES); @@ -834,10 +817,10 @@ switch ($op) if ($LOGIN_USER != "" && $LOGIN_LEVEL < AUTH_DEVEL) print("\n"); + ."value='$create_user'>$create_user\n"); else print("\n"); + ."size='40' value='$create_user'>\n"); $contents = htmlspecialchars($contents, ENT_QUOTES); @@ -856,8 +839,8 @@ switch ($op) ."TT, U, UL

\n"); print("\n"); - print("
Title:
Abstract:
$create_user
" - ."

\n"); + ."\n"); + print("\n"); html_footer(); break; diff --git a/www/comment.php b/www/comment.php index bf0cc81..a393eca 100644 --- a/www/comment.php +++ b/www/comment.php @@ -67,10 +67,9 @@ else { case 'd' : // Delete comment html_header("Delete Comment #$id"); - print("

Delete Comment #$id

\n"); print("

Click the button below to confirm the deletion.

\n" ."
" - ."
" + ."
" ."
\n"); html_footer(); break; @@ -193,15 +192,9 @@ else else { if ($id) - { html_header("Edit Comment"); - print("

Edit Comment

\n"); - } else - { html_header("Add Comment"); - print("

Add Comment

\n"); - } if ($REQUEST_METHOD == "POST") { @@ -228,11 +221,11 @@ else if ($create_user == "") print("${hstart}Author:${hend}" ."\n"); + ."size='40'>\n"); else print("Author:" ."\n"); + ."size='40'>\n"); $contents = htmlspecialchars($contents); if ($contents == "") @@ -255,7 +248,7 @@ else { print("File Path:" ."\n"); + ."size='40'>\n"); print("Score:" ."\n"); - print("\n"); + print("\n"); + print("\n"); } if ($id) - print("\n"); + print("\n"); else - print("\n"); + print("\n"); print("\n" ."\n"); @@ -286,7 +279,6 @@ else case 'L' : // List all comments... case 'l' : // List unapproved comments... html_header("Comments"); - print("

Comments

\n"); if ($LOGIN_LEVEL < AUTH_DEVEL) { @@ -299,13 +291,13 @@ else { $result = db_query("SELECT * FROM comment WHERE " ."url LIKE '${listpath}%' ORDER BY id"); - print("

Show Hidden Comments ]

\n"); + print("

Show Hidden Comments

\n"); } else { $result = db_query("SELECT * FROM comment WHERE status = 0 AND " ."url LIKE '${listpath}%' ORDER BY id"); - print("

Show All Comments ]

\n"); + print("

Show All Comments

\n"); } } @@ -329,9 +321,9 @@ else print("
  • $row[url] " ." by $create_user on $create_date " - ."[ Edit " - ."| Delete " - ."]
    $contents
  • \n"); + ."Edit " + ."· Delete" + ."
    $contents\n"); } print("\n"); diff --git a/www/docfiles/Abbreviations.html b/www/docfiles/Abbreviations.html deleted file mode 100644 index 150fae8..0000000 --- a/www/docfiles/Abbreviations.html +++ /dev/null @@ -1,66 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Abbreviations

    -

    The following abbreviations are used throughout this manual:

    -
    -
    Gb
    -
    Gigabytes, or 1073741824 bytes -
    -
    -
    kb
    -
    Kilobytes, or 1024 bytes -
    -
    -
    Mb
    -
    Megabytes, or 1048576 bytes -
    -
    -
    UTF-8, UTF-16
    -
    Unicode Transformation Format, 8-bit or 16-bit -
    -
    -
    W3C
    -
    World Wide Web Consortium -
    -
    -
    XML
    -
    Extensible Markup Language -
    -
    -
    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/BuildingInstallingandPackagingMiniXML.html b/www/docfiles/BuildingInstallingandPackagingMiniXML.html deleted file mode 100644 index 411c034..0000000 --- a/www/docfiles/BuildingInstallingandPackagingMiniXML.html +++ /dev/null @@ -1,46 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    1Building, Installing, and - Packaging Mini-XML

    -

    This chapter describes how to build, install, and package Mini-XML on - your system from the source archive. You will need an ANSI/ISO-C - compatible compiler to build Mini-XML - GCC works, as do most vendors' - C compilers. If you are building Mini-XML on Windows, we recommend - using the Visual C++ environment with the supplied solution file. For - other operating systems, you'll need a POSIX-compatible shell and -make program in addition to the C compiler.

    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/ChangingNodeValues.html b/www/docfiles/ChangingNodeValues.html deleted file mode 100644 index 3b12574..0000000 --- a/www/docfiles/ChangingNodeValues.html +++ /dev/null @@ -1,55 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Changing Node Values

    -

    All of the examples so far have concentrated on creating and loading - new XML data nodes. Many applications, however, need to manipulate or - change the nodes during their operation, so Mini-XML provides functions - to change node values safely and without leaking memory.

    -

    Existing nodes can be changed using the -mxmlSetElement(), -mxmlSetInteger(), -mxmlSetOpaque(), -mxmlSetReal(), -mxmlSetText(), and -mxmlSetTextf() functions. For example, use the following - function call to change a text node to contain the text "new" with - leading whitespace:

    -
    -    mxml_node_t *node;
    -
    -    mxmlSetText(node, 1, "new");
    -
    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/CommentingYourCode.html b/www/docfiles/CommentingYourCode.html deleted file mode 100644 index efec211..0000000 --- a/www/docfiles/CommentingYourCode.html +++ /dev/null @@ -1,102 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Commenting Your Code

    -

    As noted previously, mxmldoc looks for in-line comments to - describe the functions, types, and constants in your code. Mxmldoc - will document all public names it finds in your source files - any - names starting with the underscore character (_) or names that are - documented with the @private@ directive are - treated as private and are undocumented.

    -

    Comments appearing directly before a function or type definition are - used to document that function or type. Comments appearing after - argument, definition, return type, or variable declarations are used to - document that argument, definition, return type, or variable. For - example, the following code excerpt defines a key/value structure and a - function that creates a new instance of that structure:

    -
    -    /* A key/value pair. This is used with the
    -       dictionary structure. */
    -
    -    struct keyval
    -    {
    -      char *key; /* Key string */
    -      char *val; /* Value string */
    -    };
    -
    -    /* Create a new key/value pair. */
    -
    -    struct keyval * /* New key/value pair */
    -    new_keyval(
    -        const char *key, /* Key string */
    -	const char *val) /* Value string */
    -    {
    -      ...
    -    }
    -
    -

    Mxmldoc also knows to remove extra asterisks (*) from the - comment string, so the comment string:

    -
    -    /*
    -     * Compute the value of PI.
    -     *
    -     * The function connects to an Internet server
    -     * that streams audio of mathematical monks
    -     * chanting the first 100 digits of PI.
    -     */
    -
    -

    will be shown as:

    -
    -    Compute the value of PI.
    -
    -    The function connects to an Internet server
    -    that streams audio of mathematical monks
    -    chanting the first 100 digits of PI.
    -
    -

    Comments can also include the following - special @name ...@ directive strings:

    - - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/CompilingMiniXML.html b/www/docfiles/CompilingMiniXML.html deleted file mode 100644 index 1ffa51f..0000000 --- a/www/docfiles/CompilingMiniXML.html +++ /dev/null @@ -1,40 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Compiling Mini-XML

    -

    Mini-XML comes with both an autoconf-based configure script and a - Visual C++ solution that can be used to compile the library and - associated tools.

    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/CompilingwithCommandLineTools.html b/www/docfiles/CompilingwithCommandLineTools.html deleted file mode 100644 index a087e3a..0000000 --- a/www/docfiles/CompilingwithCommandLineTools.html +++ /dev/null @@ -1,58 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Compiling with Command-Line Tools

    -

    Type the following command to configure the Mini-XML source code for - your system:

    -
    -    ./configure ENTER
    -
    -

    The default install prefix is /usr/local, which can be - overridden using the --prefix option:

    -
    -    ./configure --prefix=/foo ENTER
    -
    -

    Other configure options can be found using the --help - option:

    -
    -    ./configure --help ENTER
    -
    -

    Once you have configured the software, use the make(1) - program to do the build and run the test program to verify that things - are working, as follows:

    -
    -    make ENTER
    -
    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/CompilingwithVisualC.html b/www/docfiles/CompilingwithVisualC.html deleted file mode 100644 index 15fbfdb..0000000 --- a/www/docfiles/CompilingwithVisualC.html +++ /dev/null @@ -1,41 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Compiling with Visual C++

    -

    Open the mxml.sln solution in the vcnet folder. - Choose the desired build configuration, "Debug" (the default) or - "Release", and then choose Build Solution from the - Build menu.

    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/Contents.html b/www/docfiles/Contents.html deleted file mode 100644 index 50c2cb1..0000000 --- a/www/docfiles/Contents.html +++ /dev/null @@ -1,46 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Contents

    - - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/ControllingLineWrapping.html b/www/docfiles/ControllingLineWrapping.html deleted file mode 100644 index 9b078ac..0000000 --- a/www/docfiles/ControllingLineWrapping.html +++ /dev/null @@ -1,50 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Controlling Line Wrapping

    -

    When saving XML documents, Mini-XML normally wraps output lines at - column 75 so that the text is readable in terminal windows. The -mxmlSetWrapMargin function overrides the default wrap - margin:

    -
    -    /* Set the margin to 132 columns */
    -    mxmlSetWrapMargin(132);
    -
    -    /* Disable wrapping */
    -    mxmlSetWrapMargin(0);
    -
    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/CreatingMiniXMLPackages.html b/www/docfiles/CreatingMiniXMLPackages.html deleted file mode 100644 index 283fe93..0000000 --- a/www/docfiles/CreatingMiniXMLPackages.html +++ /dev/null @@ -1,65 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Creating Mini-XML Packages

    -

    Mini-XML includes two files that can be used to create binary - packages. The first file is mxml.spec which is used by the -rpmbuild(8) software to create Red Hat Package Manager ("RPM") - packages which are commonly used on Linux. Since rpmbuild - wants to compile the software on its own, you can provide it with the - Mini-XML tar file to build the package:

    -
    -    rpmbuild -ta mxml-version.tar.gz ENTER
    -
    -

    The second file is mxml.list which is used by the -epm(1) program to create software packages in a variety of formats. - The epm program is available from the following URL:

    -
    -    http://www.easysw.com/epm/
    -
    -

    Use the make command with the epm target to - create portable and native packages for your system:

    -
    -    make epm ENTER
    -
    -

    The packages are stored in a subdirectory named dist for - your convenience. The portable packages utilize scripts and tar files - to install the software on the target system. After extracting the - package archive, use the mxml.install script to install the - software.

    -

    The native packages will be in the local OS's native format: RPM for - Red Hat Linux, DPKG for Debian Linux, PKG for Solaris, and so forth. - Use the corresponding commands to install the native packages.

    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/CreatingXMLDocuments.html b/www/docfiles/CreatingXMLDocuments.html deleted file mode 100644 index 0581b9c..0000000 --- a/www/docfiles/CreatingXMLDocuments.html +++ /dev/null @@ -1,98 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Creating XML Documents

    -

    You can create and update XML documents in memory using the various -mxmlNew functions. The following code will create the XML document - described in the previous section:

    -
    -    mxml_node_t *xml;    /* <?xml ... ?> */
    -    mxml_node_t *data;   /* <data> */
    -    mxml_node_t *node;   /* <node> */
    -    mxml_node_t *group;  /* <group> */
    -
    -    xml = mxmlNewXML("1.0");
    -
    -    data = mxmlNewElement(xml, "data");
    -
    -        node = mxmlNewElement(data, "node");
    -        mxmlNewText(node, 0, "val1");
    -        node = mxmlNewElement(data, "node");
    -        mxmlNewText(node, 0, "val2");
    -        node = mxmlNewElement(data, "node");
    -        mxmlNewText(node, 0, "val3");
    -
    -        group = mxmlNewElement(data, "group");
    -
    -            node = mxmlNewElement(group, "node");
    -            mxmlNewText(node, 0, "val4");
    -            node = mxmlNewElement(group, "node");
    -            mxmlNewText(node, 0, "val5");
    -            node = mxmlNewElement(group, "node");
    -            mxmlNewText(node, 0, "val6");
    -
    -        node = mxmlNewElement(data, "node");
    -        mxmlNewText(node, 0, "val7");
    -        node = mxmlNewElement(data, "node");
    -        mxmlNewText(node, 0, "val8");
    -
    -

    We start by creating the <?xml version="1.0"?> node common - to all XML files using the -mxmlNewXML function:

    -
    -    xml = mxmlNewXML("1.0");
    -
    -

    We then create the <data> node used for this document using - the mxmlNewElement - function. The first argument specifies the parent node (xml -) while the second specifies the element name (data):

    -
    -    data = mxmlNewElement(xml, "data");
    -
    -

    Each <node>...</node> in the file is created using the -mxmlNewElement and -mxmlNewText functions. The first argument of mxmlNewText - specifies the parent node (node). The second argument - specifies whether whitespace appears before the text - 0 or false in - this case. The last argument specifies the actual text to add:

    -
    -    node = mxmlNewElement(data, "node");
    -    mxmlNewText(node, 0, "val1");
    -
    -

    The resulting in-memory XML document can then be saved or processed - just like one loaded from disk or a string.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/CustomDataTypes.html b/www/docfiles/CustomDataTypes.html deleted file mode 100644 index a78dd51..0000000 --- a/www/docfiles/CustomDataTypes.html +++ /dev/null @@ -1,176 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Custom Data Types

    -

    Mini-XML supports custom data types via global load and save - callbacks. Only a single set of callbacks can be active at any time, - however your callbacks can store additional information in order to - support multiple custom data types as needed. The MXML_CUSTOM - node type identifies custom data nodes.

    -

    The load callback receives a pointer to the current data node and a - string of opaque character data from the XML source with character - entities converted to the corresponding UTF-8 characters. For example, - if we wanted to support a custom date/time type whose value is encoded - as "yyyy-mm-ddThh:mm:ssZ" (ISO format), the load callback would look - like the following:

    -
    -    typedef struct
    -    {
    -      unsigned      year,    /* Year */
    -                    month,   /* Month */
    -                    day,     /* Day */
    -                    hour,    /* Hour */
    -                    minute,  /* Minute */
    -                    second;  /* Second */
    -      time_t        unix;    /* UNIX time */
    -    } iso_date_time_t;
    -
    -    int
    -    load_custom(mxml_node_t *node,
    -                const char *data)
    -    {
    -      iso_date_time_t *dt;
    -      struct tm tmdata;
    -
    -     /*
    -      * Allocate data structure...
    -      */
    -
    -      dt = calloc(1, sizeof(iso_date_time_t));
    -
    -     /*
    -      * Try reading 6 unsigned integers from the
    -      * data string...
    -      */
    -
    -      if (sscanf(data, "%u-%u-%uT%u:%u:%uZ",
    -                 &(dt->year), &(dt->month),
    -                 &(dt->day), &(dt->hour),
    -                 &(dt->minute),
    -                 &(dt->second)) != 6)
    -      {
    -       /*
    -        * Unable to read numbers, free the data
    -        * structure and return an error...
    -        */
    -
    -        free(dt);
    -
    -        return (-1);
    -      }
    -
    -     /*
    -      * Range check values...
    -      */
    -
    -      if (dt->month <1 || dt->month > 12 ||
    -          dt->day  <1 || dt->day > 31 ||
    -          dt->hour  <0 || dt->hour > 23 ||
    -          dt->minute  <0 || dt->minute > 59 ||
    -          dt->second  <0 || dt->second > 59)
    -      {
    -       /*
    -        * Date information is out of range...
    -        */
    -
    -        free(dt);
    -
    -        return (-1);
    -      }
    -
    -     /*
    -      * Convert ISO time to UNIX time in
    -      * seconds...
    -      */
    -
    -      tmdata.tm_year = dt->year - 1900;
    -      tmdata.tm_mon  = dt->month - 1;
    -      tmdata.tm_day  = dt->day;
    -      tmdata.tm_hour = dt->hour;
    -      tmdata.tm_min  = dt->minute;
    -      tmdata.tm_sec  = dt->second;
    -
    -      dt->unix = gmtime(&tmdata);
    -
    -     /*
    -      * Assign custom node data and destroy
    -      * function pointers...
    -      */
    -
    -      node->value.custom.data    = dt;
    -      node->value.custom.destroy = free;
    -
    -     /*
    -      * Return with no errors...
    -      */
    -
    -      return (0);
    -    }
    -
    -

    The function itself can return 0 on success or -1 if it is unable to - decode the custom data or the data contains an error. Custom data nodes - contain a void pointer to the allocated custom data for the - node and a pointer to a destructor function which will free the custom - data when the node is deleted.

    -

    The save callback receives the node pointer and returns an allocated - string containing the custom data value. The following save callback - could be used for our ISO date/time type:

    -
    -    char *
    -    save_custom(mxml_node_t *node)
    -    {
    -      char data[255];
    -      iso_date_time_t *dt;
    -
    -
    -      dt = (iso_date_time_t *)node->custom.data;
    -
    -      snprintf(data, sizeof(data),
    -               "%04u-%02u-%02uT%02u:%02u:%02uZ",
    -               dt->year, dt->month, dt->day,
    -               dt->hour, dt->minute, dt->second);
    -
    -      return (strdup(data));
    -    }
    -
    -

    You register the callback functions using the -mxmlSetCustomHandlers() function:

    -
    -    mxmlSetCustomHandlers(load_custom,
    -                          save_custom);
    -
    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/Enumerations.html b/www/docfiles/Enumerations.html deleted file mode 100644 index f3573c3..0000000 --- a/www/docfiles/Enumerations.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Enumerations

    - - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/FindingandIteratingNodes.html b/www/docfiles/FindingandIteratingNodes.html deleted file mode 100644 index 0469e00..0000000 --- a/www/docfiles/FindingandIteratingNodes.html +++ /dev/null @@ -1,158 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Finding and Iterating Nodes

    -

    The mxmlWalkPrev - and mxmlWalkNext -functions can be used to iterate through the XML node tree:

    -
    -    mxml_node_t *node;
    -    
    -    node = mxmlWalkPrev(current, tree,
    -                        MXML_DESCEND);
    -
    -    node = mxmlWalkNext(current, tree,
    -                        MXML_DESCEND);
    -
    -

    In addition, you can find a named element/node using the -mxmlFindElement function:

    -
    -    mxml_node_t *node;
    -    
    -    node = mxmlFindElement(tree, tree, "name",
    -                           "attr", "value",
    -                           MXML_DESCEND);
    -
    -

    The name, attr, and value arguments can be - passed as NULL to act as wildcards, e.g.:

    - - -
    -    /* Find the first "a" element */
    -    node = mxmlFindElement(tree, tree, "a",
    -                           NULL, NULL,
    -                           MXML_DESCEND);
    -
    - - -
    -    /* Find the first "a" element with "href"
    -       attribute */
    -    node = mxmlFindElement(tree, tree, "a",
    -                           "href", NULL,
    -                           MXML_DESCEND);
    -
    - - -
    -    /* Find the first "a" element with "href"
    -       to a URL */
    -    node = mxmlFindElement(tree, tree, "a",
    -                           "href",
    -                           "http://www.easysw.com/",
    -                           MXML_DESCEND);
    -
    - - -
    -    /* Find the first element with a "src"
    -       attribute */
    -    node = mxmlFindElement(tree, tree, NULL,
    -                           "src", NULL,
    -                           MXML_DESCEND);
    -
    - - -
    -    /* Find the first element with a "src"
    -       = "foo.jpg" */
    -    node = mxmlFindElement(tree, tree, NULL,
    -                           "src", "foo.jpg",
    -                           MXML_DESCEND);
    -
    -

    You can also iterate with the same function:

    -
    -    mxml_node_t *node;
    -
    -    for (node = mxmlFindElement(tree, tree,
    -                                "name",
    -                                NULL, NULL,
    -                                MXML_DESCEND);
    -         node != NULL;
    -         node = mxmlFindElement(node, tree,
    -                                "name",
    -                                NULL, NULL,
    -                                MXML_DESCEND))
    -    {
    -      ... do something ...
    -    }
    -
    - - -

    The MXML_DESCEND argument can actually be one of three - constants:

    - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/FormattedText.html b/www/docfiles/FormattedText.html deleted file mode 100644 index 84ead98..0000000 --- a/www/docfiles/FormattedText.html +++ /dev/null @@ -1,49 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Formatted Text

    -

    The mxmlNewTextf() - and mxmlSetTextf() - functions create and change text nodes, respectively, using printf --style format strings and arguments. For example, use the following - function call to create a new text node containing a constructed - filename:

    -
    -    mxml_node_t *node;
    -
    -    node = mxmlNewTextf(node, 1, "%s/%s",
    -                        path, filename);
    -
    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/Functions.html b/www/docfiles/Functions.html deleted file mode 100644 index 601b836..0000000 --- a/www/docfiles/Functions.html +++ /dev/null @@ -1,147 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Functions

    - - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/GettingStartedwithMiniXML.html b/www/docfiles/GettingStartedwithMiniXML.html deleted file mode 100644 index 7bb31d5..0000000 --- a/www/docfiles/GettingStartedwithMiniXML.html +++ /dev/null @@ -1,56 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    2Getting Started with Mini-XML

    -

    This chapter describes how to write programs that use Mini-XML to - access data in an XML file. Mini-XML provides the following - functionality:

    - -

    Mini-XML doesn't do validation or other types of processing on the - data based upon schema files or other sources of definition - information, nor does it support character entities other than those - required by the XML specification.

    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/Indexing.html b/www/docfiles/Indexing.html deleted file mode 100644 index 75556e9..0000000 --- a/www/docfiles/Indexing.html +++ /dev/null @@ -1,111 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Indexing

    -

    Mini-XML provides functions for managing indices of nodes. The - current implementation provides the same functionality as -mxmlFindElement(). The advantage of using an index is that - searching and enumeration of elements is significantly faster. The only - disadvantage is that each index is a static snapshot of the XML - document, so indices are not well suited to XML data that is updated - more often than it is searched. The overhead of creating an index is - approximately equal to walking the XML document tree. Nodes in the - index are sorted by element name and attribute value.

    -

    Indices are stored in -mxml_index_t structures. The -mxmlIndexNew() function creates a new index:

    -
    -    mxml_node_t *tree;
    -    mxml_index_t *ind;
    -
    -    ind = mxmlIndexNew(tree, "element",
    -                       "attribute");
    -
    -

    The first argument is the XML node tree to index. Normally this will - be a pointer to the ?xml element.

    -

    The second argument contains the element to index; passing NULL - indexes all element nodes alphabetically.

    -

    The third argument contains the attribute to index; passing NULL - causes only the element name to be indexed.

    -

    Once the index is created, the -mxmlIndexEnum(), -mxmlIndexFind(), and -mxmlIndexReset() functions are used to access the nodes in - the index. The -mxmlIndexReset() function resets the "current" node pointer in - the index, allowing you to do new searches and enumerations on the same - index. Typically you will call this function prior to your calls to -mxmlIndexEnum() and -mxmlIndexFind().

    -

    The mxmlIndexEnum() - function enumerates each of the nodes in the index and can be used - in a loop as follows:

    -
    -    mxml_node_t *node;
    -
    -    mxmlIndexReset(ind);
    -
    -    while ((node = mxmlIndexEnum(ind)) != NULL)
    -    {
    -      // do something with node
    -    }
    -
    -

    The mxmlIndexFind() - function locates the next occurrence of the named element and - attribute value in the index. It can be used to find all matching - elements in an index, as follows:

    -
    -    mxml_node_t *node;
    -
    -    mxmlIndexReset(ind);
    -
    -    while ((node = mxmlIndexFind(ind, "element",
    -                                 "attr-value"))
    -                != NULL)
    -    {
    -      // do something with node
    -    }
    -
    -

    The second and third arguments represent the element name and - attribute value, respectively. A NULL pointer is used to - return all elements or attributes in the index. Passing NULL - for both the element name and attribute value is equivalent to calling -mxmlIndexEnum.

    -

    When you are done using the index, delete it using the -mxmlIndexDelete() function:

    -
    -    mxmlIndexDelete(ind);
    -
    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/InstallingMiniXML.html b/www/docfiles/InstallingMiniXML.html deleted file mode 100644 index 0accd59..0000000 --- a/www/docfiles/InstallingMiniXML.html +++ /dev/null @@ -1,45 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Installing Mini-XML

    -

    If you are using Visual C++, copy the mxml.lib and and - mxml.h files to the Visual C++ lib and include - directories, respectively.

    -

    Otherwise, use the make command with the install - target to install Mini-XML in the configured directories:

    -
    -    make install ENTER
    -
    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/Introduction.html b/www/docfiles/Introduction.html deleted file mode 100644 index ef1308f..0000000 --- a/www/docfiles/Introduction.html +++ /dev/null @@ -1,68 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - -Contents -Next -
    -

    0Introduction

    -

    This programmers manual describes Mini-XML version 2.3, a small XML - parsing library that you can use to read and write XML data files in - your C and C++ applications.

    -

    Mini-XML was initially developed for the -Gutenprint project to replace the rather large and unwieldy -libxml2 library with something substantially smaller and - easier-to-use. It all began one morning in June of 2003 when Robert - posted the following sentence to the developer's list:

    -
    It's bad enough that we require libxml2, but rolling our - own XML parser is a bit more than we can handle.
    -

    I then replied with:

    -
    Given the limited scope of what you use in XML, it - should be trivial to code a mini-XML API in a few hundred lines of - code.
    -

    I took my own challenge and coded furiously for two days to produced - the initial public release of Mini-XML, total lines of code: 696. - Robert promptly integrated Mini-XML into Gutenprint and removed - libxml2.

    -

    Thanks to lots of feedback and support from various developers, - Mini-XML has evolved since then to provide a more complete XML - implementation and now stands at a whopping 3,441 lines of code, - compared to 103,893 lines of code for libxml2 version 2.6.9.

    -

    Aside from Gutenprint, Mini-XML is used for the following - projects/software applications:

    - -

    Please email me (mxml @ easysw . com) if you would like your project - added or removed from this list, or if you have any comments/quotes you - would like me to publish about your experiences with Mini-XML.

    -
    -Contents -Next - - diff --git a/www/docfiles/LegalStuff.html b/www/docfiles/LegalStuff.html deleted file mode 100644 index b6f7e01..0000000 --- a/www/docfiles/LegalStuff.html +++ /dev/null @@ -1,47 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Legal Stuff

    -

    The Mini-XML library is copyright 2003-2007 by Michael Sweet.

    -

    This library is free software; you can redistribute it and/or modify - it under the terms of the GNU - Library General Public License as published by the Free Software - Foundation; either version 2 of the License, or (at your option) any - later version.

    -

    This library is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details.

    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/LibraryReference.html b/www/docfiles/LibraryReference.html deleted file mode 100644 index be5ab54..0000000 --- a/www/docfiles/LibraryReference.html +++ /dev/null @@ -1,38 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    CLibrary Reference

    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/LoadCallbacks.html b/www/docfiles/LoadCallbacks.html deleted file mode 100644 index a04b704..0000000 --- a/www/docfiles/LoadCallbacks.html +++ /dev/null @@ -1,101 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Load Callbacks

    -

    Chapter 2 introduced the -mxmlLoadFile() and -mxmlLoadString() functions. The last argument to these - functions is a callback function which is used to determine the value - type of each data node in an XML document.

    -

    Mini-XML defines several standard callbacks for simple XML data - files:

    - -

    You can provide your own callback functions for more complex XML - documents. Your callback function will receive a pointer to the current - element node and must return the value type of the immediate children - for that element node: MXML_INTEGER, MXML_OPAQUE, -MXML_REAL, or MXML_TEXT. The function is called after - the element and its attributes have been read, so you can look at the - element name, attributes, and attribute values to determine the proper - value type to return.

    - - -

    The following callback function looks for an attribute named "type" - or the element name to determine the value type for its child nodes:

    -
    -    mxml_type_t
    -    type_cb(mxml_node_t *node)
    -    {
    -      const char *type;
    -
    -     /*
    -      * You can lookup attributes and/or use the
    -      * element name, hierarchy, etc...
    -      */
    -
    -      type = mxmlElementGetAttr(node, "type");
    -      if (type == NULL)
    -	type = node->value.element.name;
    -
    -      if (!strcmp(type, "integer"))
    -	return (MXML_INTEGER);
    -      else if (!strcmp(type, "opaque"))
    -	return (MXML_OPAQUE);
    -      else if (!strcmp(type, "real"))
    -	return (MXML_REAL);
    -      else
    -	return (MXML_TEXT);
    -    }
    -
    -

    To use this callback function, simply use the name when you call any - of the load functions:

    -
    -    FILE *fp;
    -    mxml_node_t *tree;
    -
    -    fp = fopen("filename.xml", "r");
    -    tree = mxmlLoadFile(NULL, fp, type_cb);
    -    fclose(fp);
    -
    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/LoadingXML.html b/www/docfiles/LoadingXML.html deleted file mode 100644 index 4369db8..0000000 --- a/www/docfiles/LoadingXML.html +++ /dev/null @@ -1,84 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Loading XML

    -

    You load an XML file using the -mxmlLoadFile function:

    -
    -    FILE *fp;
    -    mxml_node_t *tree;
    -
    -    fp = fopen("filename.xml", "r");
    -    tree = mxmlLoadFile(NULL, fp,
    -                        MXML_TEXT_CALLBACK);
    -    fclose(fp);
    -
    -

    The first argument specifies an existing XML parent node, if any. - Normally you will pass NULL for this argument unless you are - combining multiple XML sources. The XML file must contain a complete - XML document including the ?xml element if the parent node is -NULL.

    -

    The second argument specifies the stdio file to read from, as opened - by fopen() or popen(). You can also use stdin - if you are implementing an XML filter program.

    -

    The third argument specifies a callback function which returns the - value type of the immediate children for a new element node: -MXML_CUSTOM, MXML_IGNORE, MXML_INTEGER, -MXML_OPAQUE, MXML_REAL, or MXML_TEXT. Load - callbacks are described in detail in -Chapter 3. The example code uses the MXML_TEXT_CALLBACK - constant which specifies that all data nodes in the document contain - whitespace-separated text values. Other standard callbacks include -MXML_IGNORE_CALLBACK, MXML_INTEGER_CALLBACK, -MXML_OPAQUE_CALLBACK, and MXML_REAL_CALLBACK.

    -

    The mxmlLoadString - function loads XML node trees from a string:

    - - -
    -    char buffer[8192];
    -    mxml_node_t *tree;
    -
    -    ...
    -    tree = mxmlLoadString(NULL, buffer,
    -                          MXML_TEXT_CALLBACK);
    -
    -

    The first and third arguments are the same as used for -mxmlLoadFile(). The second argument specifies the string or - character buffer to load and must be a complete XML document including - the ?xml element if the parent node is NULL.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/MiniXML21mxmlNewCustom.html b/www/docfiles/MiniXML21mxmlNewCustom.html deleted file mode 100644 index cb1d9fe..0000000 --- a/www/docfiles/MiniXML21mxmlNewCustom.html +++ /dev/null @@ -1,65 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    - - Mini-XML 2.1 mxmlNewCustom()

    -

    Description

    -

    Create a new custom data 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.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlNewCustom( mxml_node_t - * parent, void * data, -mxml_custom_destroy_cb_t destroy);

    -

    Arguments

    -
    - - - - - - -
    NameDescription
    parentParent node or MXML_NO_PARENT
    dataPointer to data
    destroyFunction to destroy data
    -
    -

    Returns

    -

    New node

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/MiniXML21mxmlSetCustom.html b/www/docfiles/MiniXML21mxmlSetCustom.html deleted file mode 100644 index 5506271..0000000 --- a/www/docfiles/MiniXML21mxmlSetCustom.html +++ /dev/null @@ -1,62 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    - - Mini-XML 2.1 mxmlSetCustom()

    -

    Description

    -

    Set the data and destructor of a custom data node.

    -

    The node is not changed if it is not a custom node.

    -

    Syntax

    -

    int -
    mxmlSetCustom( mxml_node_t - * node, void * data, -mxml_custom_destroy_cb_t destroy);

    -

    Arguments

    -
    - - - - - - -
    NameDescription
    nodeNode to set
    dataNew data pointer
    destroyNew destructor function
    -
    -

    Returns

    -

    0 on success, -1 on failure

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/MiniXML21mxmlcustoms.html b/www/docfiles/MiniXML21mxmlcustoms.html deleted file mode 100644 index ca9ae0b..0000000 --- a/www/docfiles/MiniXML21mxmlcustoms.html +++ /dev/null @@ -1,58 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    - - Mini-XML 2.1 mxml_custom_s

    -

    Description

    -

    An XML custom value.

    -

    Definition

    -

    struct mxml_custom_s -
    { -
      void * data; -
       -mxml_custom_destroy_cb_t destroy; -
    };

    -

    Members

    -
    - - - - - -
    NameDescription
    dataPointer to (allocated) custom data
    destroyPointer to destructor function
    -
    - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/MiniXML21mxmlcustomt.html b/www/docfiles/MiniXML21mxmlcustomt.html deleted file mode 100644 index 2353184..0000000 --- a/www/docfiles/MiniXML21mxmlcustomt.html +++ /dev/null @@ -1,46 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    - - Mini-XML 2.1 mxml_custom_t

    -

    Description

    -

    An XML custom value.

    -

    Definition

    -

    typedef struct -mxml_custom_s mxml_custom_t;

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/MiniXML23mxmlElementSetAttrf.html b/www/docfiles/MiniXML23mxmlElementSetAttrf.html deleted file mode 100644 index d7b9108..0000000 --- a/www/docfiles/MiniXML23mxmlElementSetAttrf.html +++ /dev/null @@ -1,67 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    - - Mini-XML 2.3 mxmlElementSetAttrf() -

    -

    Description

    -

    Set an attribute with a formatted value.

    -

    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.

    -

    Syntax

    -

    void -
    mxmlElementSetAttrf( -mxml_node_t * node, const char * name, const char * format, ...);
    -

    -

    Arguments

    -
    - - - - - - - -
    NameDescription
    nodeElement node
    nameName of attribute
    formatPrintf-style attribute value
    ...Additional arguments as needed
    -
    -

    Returns

    -

    Nothing.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/MiniXML23mxmlNewCDATA.html b/www/docfiles/MiniXML23mxmlNewCDATA.html deleted file mode 100644 index 0b2e1c6..0000000 --- a/www/docfiles/MiniXML23mxmlNewCDATA.html +++ /dev/null @@ -1,63 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    - - Mini-XML 2.3 mxmlNewCDATA()

    -

    Description

    -

    Create a new CDATA 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 use the MXML_ELEMENT type.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlNewCDATA( mxml_node_t - * parent, const char * data);

    -

    Arguments

    -
    - - - - - -
    NameDescription
    parentParent node or MXML_NO_PARENT
    dataData string
    -
    -

    Returns

    -

    New node

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/MiniXML23mxmlNewXML.html b/www/docfiles/MiniXML23mxmlNewXML.html deleted file mode 100644 index 87fc009..0000000 --- a/www/docfiles/MiniXML23mxmlNewXML.html +++ /dev/null @@ -1,59 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    - - Mini-XML 2.3 mxmlNewXML()

    -

    Description

    -

    Create a new XML document tree.

    -

    The "version" argument specifies the version number to put in the - ?xml element node. If NULL, version 1.0 is assumed.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlNewXML( const char * version);

    -

    Arguments

    -
    - - - - -
    NameDescription
    versionVersion number to use
    -
    -

    Returns

    -

    New ?xml node

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/MiniXML23mxmlRelease.html b/www/docfiles/MiniXML23mxmlRelease.html deleted file mode 100644 index 5ab360c..0000000 --- a/www/docfiles/MiniXML23mxmlRelease.html +++ /dev/null @@ -1,60 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    - - Mini-XML 2.3 mxmlRelease()

    -

    Description

    -

    Release a node.

    -

    When the reference count reaches zero, the node (and any children) is - deleted via mxmlDelete().

    -

    Syntax

    -

    int -
    mxmlRelease( mxml_node_t * - node);

    -

    Arguments

    -
    - - - - -
    NameDescription
    nodeNode
    -
    -

    Returns

    -

    New reference count

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/MiniXML23mxmlRetain.html b/www/docfiles/MiniXML23mxmlRetain.html deleted file mode 100644 index 7b4069c..0000000 --- a/www/docfiles/MiniXML23mxmlRetain.html +++ /dev/null @@ -1,58 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    - - Mini-XML 2.3 mxmlRetain()

    -

    Description

    -

    Retain a node.

    -

    Syntax

    -

    int -
    mxmlRetain( mxml_node_t * - node);

    -

    Arguments

    -
    - - - - -
    NameDescription
    nodeNode
    -
    -

    Returns

    -

    New reference count

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/MiniXML23mxmlSAXLoadFd.html b/www/docfiles/MiniXML23mxmlSAXLoadFd.html deleted file mode 100644 index 6f62267..0000000 --- a/www/docfiles/MiniXML23mxmlSAXLoadFd.html +++ /dev/null @@ -1,76 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    - - Mini-XML 2.3 mxmlSAXLoadFd()

    -

    Description

    -

    Load a file descriptor into an XML node tree using a SAX callback.

    -

    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. If - MXML_NO_CALLBACK is specified then all child nodes will be either - MXML_ELEMENT or MXML_TEXT 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.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlSAXLoadFd( mxml_node_t - * top, int fd, mxml_load_cb_t - cb, mxml_sax_cb_t sax_cb, - void * sax_data);

    -

    Arguments

    -
    - - - - - - - - -
    NameDescription
    topTop node
    fdFile descriptor to read from
    cbCallback function or MXML_NO_CALLBACK
    sax_cbSAX callback or MXML_NO_CALLBACK
    sax_dataSAX user data
    -
    -

    Returns

    -

    First node or NULL if the file could not be read.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/MiniXML23mxmlSAXLoadFile.html b/www/docfiles/MiniXML23mxmlSAXLoadFile.html deleted file mode 100644 index dfd7c9e..0000000 --- a/www/docfiles/MiniXML23mxmlSAXLoadFile.html +++ /dev/null @@ -1,76 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    - - Mini-XML 2.3 mxmlSAXLoadFile()

    -

    Description

    -

    Load a file into an XML node tree using a SAX callback.

    -

    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. If - MXML_NO_CALLBACK is specified then all child nodes will be either - MXML_ELEMENT or MXML_TEXT 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.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlSAXLoadFile( mxml_node_t - * top, FILE * fp, -mxml_load_cb_t cb, -mxml_sax_cb_t sax_cb, void * sax_data);

    -

    Arguments

    -
    - - - - - - - - -
    NameDescription
    topTop node
    fpFile to read from
    cbCallback function or MXML_NO_CALLBACK
    sax_cbSAX callback or MXML_NO_CALLBACK
    sax_dataSAX user data
    -
    -

    Returns

    -

    First node or NULL if the file could not be read.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/MiniXML23mxmlSAXLoadString.html b/www/docfiles/MiniXML23mxmlSAXLoadString.html deleted file mode 100644 index 0ff9018..0000000 --- a/www/docfiles/MiniXML23mxmlSAXLoadString.html +++ /dev/null @@ -1,76 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    - - Mini-XML 2.3 mxmlSAXLoadString()

    -

    Description

    -

    Load a string into an XML node tree using a SAX callback.

    -

    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. If MXML_NO_CALLBACK is specified then all child nodes will be - either MXML_ELEMENT or MXML_TEXT 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.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlSAXLoadString( mxml_node_t - * top, const char * s, -mxml_load_cb_t cb, -mxml_sax_cb_t sax_cb, void * sax_data);

    -

    Arguments

    -
    - - - - - - - - -
    NameDescription
    topTop node
    sString to load
    cbCallback function or MXML_NO_CALLBACK
    sax_cbSAX callback or MXML_NO_CALLBACK
    sax_dataSAX user data
    -
    -

    Returns

    -

    First node or NULL if the string has errors.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/MiniXML23mxmlSetCDATA.html b/www/docfiles/MiniXML23mxmlSetCDATA.html deleted file mode 100644 index f81a6bf..0000000 --- a/www/docfiles/MiniXML23mxmlSetCDATA.html +++ /dev/null @@ -1,60 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    - - Mini-XML 2.3 mxmlSetCDATA()

    -

    Description

    -

    Set the element name of a CDATA node.

    -

    The node is not changed if it is not a CDATA element node.

    -

    Syntax

    -

    int -
    mxmlSetCDATA( mxml_node_t - * node, const char * data);

    -

    Arguments

    -
    - - - - - -
    NameDescription
    nodeNode to set
    dataNew data string
    -
    -

    Returns

    -

    0 on success, -1 on failure

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/MiniXML23mxmlSetWrapMargin.html b/www/docfiles/MiniXML23mxmlSetWrapMargin.html deleted file mode 100644 index 01a6ac5..0000000 --- a/www/docfiles/MiniXML23mxmlSetWrapMargin.html +++ /dev/null @@ -1,58 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    - - Mini-XML 2.3 mxmlSetWrapMargin()

    -

    Description

    -

    Set the the wrap margin when saving XML data.

    -

    Wrapping is disabled when "column" is <= 0.

    -

    Syntax

    -

    void -
    mxmlSetWrapMargin( int column);

    -

    Arguments

    -
    - - - - -
    NameDescription
    columnColumn for wrapping
    -
    -

    Returns

    -

    Nothing.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/MoreMiniXMLProgrammingTechniques.html b/www/docfiles/MoreMiniXMLProgrammingTechniques.html deleted file mode 100644 index 94d72d2..0000000 --- a/www/docfiles/MoreMiniXMLProgrammingTechniques.html +++ /dev/null @@ -1,41 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    3More Mini-XML Programming - Techniques

    -

    This chapter shows additional ways to use the Mini-XML library in - your programs.

    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/Nodes.html b/www/docfiles/Nodes.html deleted file mode 100644 index 1456a67..0000000 --- a/www/docfiles/Nodes.html +++ /dev/null @@ -1,118 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Nodes

    -

    Every piece of information in an XML file (elements, text, numbers) - is stored in memory in "nodes". Nodes are defined by the -mxml_node_t structure. The type - member defines the node type (element, integer, opaque, real, or - text) which determines which value you want to look at in the -value union.

    - - -
    - - - - - - - - - -
    Table 2-1: Mini-XML Node Value - Members
    ValueTypeNode member
    Customvoid * -node->value.custom.data
    Elementchar * -node->value.element.name
    Integerintnode->value.integer -
    Opaque (string)char * -node->value.opaque
    Realdoublenode->value.real
    Textchar *node->value.text.string -
    -
    -

    Each node also has a user_data member which allows you to - associate application-specific data with each node as needed.

    -

    New nodes are created using the -mxmlNewElement, -mxmlNewInteger, -mxmlNewOpaque, -mxmlNewReal, -mxmlNewText -mxmlNewTextf -mxmlNewXML functions. Only elements can have child nodes, and - the top node must be an element, usually the <?xml version="1.0"?> - node created by mxmlNewXML().

    -

    Nodes have pointers to the node above (parent), below ( -child), left (prev), and right (next) of the - current node. If you have an XML file like the following:

    -
    -    <?xml version="1.0"?>
    -    <data>
    -        <node>val1</node>
    -        <node>val2</node>
    -        <node>val3</node>
    -        <group>
    -            <node>val4</node>
    -            <node>val5</node>
    -            <node>val6</node>
    -        </group>
    -        <node>val7</node>
    -        <node>val8</node>
    -    </data>
    -
    -

    the node tree for the file would look like the following in memory:

    -
    -    ?xml
    -      |
    -    data
    -      |
    -    node - node - node - group - node - node
    -      |      |      |      |       |      |
    -    val1   val2   val3     |     val7   val8
    -                           |
    -                         node - node - node
    -                           |      |      |
    -                         val4   val5   val6
    -
    -

    where "-" is a pointer to the next node and "|" is a pointer to the - first child node.

    -

    Once you are done with the XML data, use the -mxmlDelete function to recursively free the memory that is - used for a particular node or the entire tree:

    -
    -    mxmlDelete(tree);
    -
    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/NotationConventions.html b/www/docfiles/NotationConventions.html deleted file mode 100644 index 3cf4f34..0000000 --- a/www/docfiles/NotationConventions.html +++ /dev/null @@ -1,68 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Notation Conventions

    -

    Various font and syntax conventions are used in this guide. Examples - and their meanings and uses are explained below:

    -
    -
    lpstat -
    lpstat(1)
    -
    The names of commands; the first mention of a command or function in - a chapter is followed by a manual page section number. -
    -
    -
    /var -
    /usr/share/cups/data/testprint.ps
    -
    File and directory names. -
    -
    -
    Request ID is Printer-123
    -
    Screen output. -
    -
    -
    lp -d printer filename ENTER
    -
    Literal user input; special keys like ENTER are in ALL - CAPS. -
    -
    -
    12.3
    -
    Numbers in the text are written using the period (.) to indicate the - decimal point. -
    -
    -
    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/OrganizationofThisDocument.html b/www/docfiles/OrganizationofThisDocument.html deleted file mode 100644 index fa89726..0000000 --- a/www/docfiles/OrganizationofThisDocument.html +++ /dev/null @@ -1,64 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Organization of This Document

    -

    This manual is organized into the following chapters and appendices:

    - - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/OtherReferences.html b/www/docfiles/OtherReferences.html deleted file mode 100644 index e2c1143..0000000 --- a/www/docfiles/OtherReferences.html +++ /dev/null @@ -1,51 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Other References

    -
    -
    The Unicode Standard, Version 4.0, Addison-Wesley, ISBN - 0-321-18578-1
    -
    The definition of the Unicode character set which is used for XML. -
    -
    -
    Extensible - Markup Language (XML) 1.0 (Third Edition)
    -
    The XML specification from the World Wide Web Consortium (W3C) -
    -
    -
    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/SAXStreamLoadingofDocuments.html b/www/docfiles/SAXStreamLoadingofDocuments.html deleted file mode 100644 index 5fb3ab1..0000000 --- a/www/docfiles/SAXStreamLoadingofDocuments.html +++ /dev/null @@ -1,164 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    SAX (Stream) Loading of Documents

    -

    Mini-XML supports an implementation of the Simple API for XML (SAX) - which allows you to load and process an XML document as a stream of - nodes. Aside from allowing you to process XML documents of any size, - the Mini-XML implementation also allows you to retain portions of the - document in memory for later processing.

    -

    The mxmlSAXLoadFd, -mxmlSAXLoadFile, and -mxmlSAXLoadString functions provide the SAX loading APIs. - Each function works like the corresponding mxmlLoad function - but uses a callback to process each node as it is read.

    -

    The callback function receives the node, an event code, and a user - data pointer you supply:

    -
    -    void
    -    sax_cb(mxml_node_t *node,
    -           mxml_sax_event_t event,
    -           void *data)
    -    {
    -      ... do something ...
    -    }
    -
    -

    The event will be one of the following:

    - -

    Elements are released after the close element is processed. - All other nodes are released after they are processed. The SAX callback - can retain the node using the -mxmlRetain function. For example, the following SAX - callback will retain all nodes, effectively simulating a normal - in-memory load:

    -
    -    void
    -    sax_cb(mxml_node_t *node,
    -           mxml_sax_event_t event,
    -           void *data)
    -    {
    -      if (event != MXML_SAX_ELEMENT_CLOSE)
    -        mxmlRetain(node);
    -    }
    -
    -

    More typically the SAX callback will only retain a small portion of - the document that is needed for post-processing. For example, the - following SAX callback will retain the title and headings in an XHTML - file. It also retains the (parent) elements like <html>, -<head>, and <body>, and processing directives like -<?xml ... ?> and <!DOCTYPE ... >:

    - - -
    -    void
    -    sax_cb(mxml_node_t *node,
    -           mxml_sax_event_t event,
    -           void *data)
    -    {
    -      if (event == MXML_SAX_ELEMENT_OPEN)
    -      {
    -       /*
    -        * Retain headings and titles...
    -        */
    -
    -        char *name = node->value.element.name;
    -
    -        if (!strcmp(name, "html") ||
    -            !strcmp(name, "head") ||
    -            !strcmp(name, "title") ||
    -            !strcmp(name, "body") ||
    -            !strcmp(name, "h1") ||
    -            !strcmp(name, "h2") ||
    -            !strcmp(name, "h3") ||
    -            !strcmp(name, "h4") ||
    -            !strcmp(name, "h5") ||
    -            !strcmp(name, "h6"))
    -          mxmlRetain(node);
    -      }
    -      else if (event == MXML_SAX_DIRECTIVE)
    -        mxmlRetain(node);
    -      else if (event == MXML_SAX_DATA &&
    -               node->parent->ref_count > 1)
    -      {
    -       /*
    -        * If the parent was retained, then retain
    -        * this data node as well.
    -        */
    -
    -        mxmlRetain(node);
    -      }
    -    }
    -
    -

    The resulting skeleton document tree can then be searched just like - one loaded using the mxmlLoad functions. For example, a filter - that reads an XHTML document from stdin and then shows the title and - headings in the document would look like:

    -
    -    mxml_node_t *doc, *title, *body, *heading;
    -
    -    doc = mxmlSAXLoadFd(NULL, 0,
    -                        MXML_TEXT_CALLBACK,
    -                        sax_cb, NULL);
    -
    -    title = mxmlFindElement(doc, doc, "title",
    -                            NULL, NULL,
    -                            MXML_DESCEND);
    -
    -    if (title)
    -      print_children(title);
    -
    -    body = mxmlFindElement(doc, doc, "body",
    -                           NULL, NULL,
    -                           MXML_DESCEND);
    -
    -    if (body)
    -    {
    -      for (heading = body->child;
    -           heading;
    -           heading = heading->next)
    -        print_children(heading);
    -    }
    -
    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/SaveCallbacks.html b/www/docfiles/SaveCallbacks.html deleted file mode 100644 index b13e041..0000000 --- a/www/docfiles/SaveCallbacks.html +++ /dev/null @@ -1,133 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Save Callbacks

    -

    Chapter 2 also introduced the -mxmlSaveFile(), -mxmlSaveString(), and -mxmlSaveAllocString() functions. The last argument to these - functions is a callback function which is used to automatically insert - whitespace in an XML document.

    -

    Your callback function will be called up to four times for each - element node with a pointer to the node and a "where" value of -MXML_WS_BEFORE_OPEN, MXML_WS_AFTER_OPEN, -MXML_WS_BEFORE_CLOSE, or MXML_WS_AFTER_CLOSE. The callback - function should return NULL if no whitespace should be added - and the string to insert (spaces, tabs, carriage returns, and newlines) - otherwise.

    -

    The following whitespace callback can be used to add whitespace to - XHTML output to make it more readable in a standard text editor:

    -
    -    const char *
    -    whitespace_cb(mxml_node_t *node,
    -                  int where)
    -    {
    -      const char *name;
    -
    -     /*
    -      * We can conditionally break to a new line
    -      * before or after any element. These are
    -      * just common HTML elements...
    -      */
    -
    -      name = node->value.element.name;
    -
    -      if (!strcmp(name, "html") ||
    -          !strcmp(name, "head") ||
    -          !strcmp(name, "body") ||
    -	  !strcmp(name, "pre") ||
    -          !strcmp(name, "p") ||
    -	  !strcmp(name, "h1") ||
    -          !strcmp(name, "h2") ||
    -          !strcmp(name, "h3") ||
    -	  !strcmp(name, "h4") ||
    -          !strcmp(name, "h5") ||
    -          !strcmp(name, "h6"))
    -      {
    -       /*
    -	* Newlines before open and after
    -        * close...
    -	*/
    -
    -	if (where == MXML_WS_BEFORE_OPEN ||
    -            where == MXML_WS_AFTER_CLOSE)
    -	  return ("\n");
    -      }
    -      else if (!strcmp(name, "dl") ||
    -               !strcmp(name, "ol") ||
    -               !strcmp(name, "ul"))
    -      {
    -       /*
    -	* Put a newline before and after list
    -        * elements...
    -	*/
    -
    -	return ("\n");
    -      }
    -      else if (!strcmp(name, "dd") ||
    -               !strcmp(name, "dt") ||
    -               !strcmp(name, "li"))
    -      {
    -       /*
    -	* Put a tab before <li>'s, * <dd>'s,
    -        * and <dt>'s, and a newline after them...
    -	*/
    -
    -	if (where == MXML_WS_BEFORE_OPEN)
    -	  return ("\t");
    -	else if (where == MXML_WS_AFTER_CLOSE)
    -	  return ("\n");
    -      }
    -
    -     /*
    -      * Return NULL for no added whitespace...
    -      */
    -
    -      return (NULL);
    -    }
    -
    -

    To use this callback function, simply use the name when you call any - of the save functions:

    -
    -    FILE *fp;
    -    mxml_node_t *tree;
    -
    -    fp = fopen("filename.xml", "w");
    -    mxmlSaveFile(tree, fp, whitespace_cb);
    -    fclose(fp);
    -
    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/SavingXML.html b/www/docfiles/SavingXML.html deleted file mode 100644 index 6b1426f..0000000 --- a/www/docfiles/SavingXML.html +++ /dev/null @@ -1,76 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Saving XML

    -

    You save an XML file using the -mxmlSaveFile function:

    -
    -    FILE *fp;
    -    mxml_node_t *tree;
    -
    -    fp = fopen("filename.xml", "w");
    -    mxmlSaveFile(tree, fp, MXML_NO_CALLBACK);
    -    fclose(fp);
    -
    -

    The first argument is the XML node tree to save. It should normally - be a pointer to the top-level ?xml node in your XML document.

    -

    The second argument is the stdio file to write to, as opened by -fopen() or popen(). You can also use stdout if - you are implementing an XML filter program.

    -

    The third argument is the whitespace callback to use when saving the - file. Whitespace callbacks are covered in detail in -Chapter 3. The previous example code uses the MXML_NO_CALLBACK - constant to specify that no special whitespace handling is required.

    -

    The -mxmlSaveAllocString, and -mxmlSaveString functions save XML node trees to strings:

    -
    -    char buffer[8192];
    -    char *ptr;
    -    mxml_node_t *tree;
    -
    -    ...
    -    mxmlSaveString(tree, buffer, sizeof(buffer),
    -                   MXML_NO_CALLBACK);
    -
    -    ...
    -    ptr = mxmlSaveAllocString(tree, MXML_NO_CALLBACK);
    -
    -

    The first and last arguments are the same as used for -mxmlSaveFile(). The mxmlSaveString function takes pointer - and size arguments for saving the XML document to a fixed-size buffer, - while mxmlSaveAllocString() returns a string buffer that was - allocated using malloc().

    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/Structures.html b/www/docfiles/Structures.html deleted file mode 100644 index fd57cbb..0000000 --- a/www/docfiles/Structures.html +++ /dev/null @@ -1,51 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Structures

    - - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/TheBasics.html b/www/docfiles/TheBasics.html deleted file mode 100644 index 51b2f79..0000000 --- a/www/docfiles/TheBasics.html +++ /dev/null @@ -1,53 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    The Basics

    -

    Mini-XML provides a single header file which you include:

    -
    -    #include <mxml.h>
    -
    -

    The Mini-XML library is included with your program using the --lmxml option:

    -
    -    gcc -o myprogram myprogram.c -lmxml ENTER
    -
    -

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

    -
    -    pkg-config --cflags mxml ENTER
    -    pkg-config --libs mxml ENTER
    -
    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/TheBasics1.html b/www/docfiles/TheBasics1.html deleted file mode 100644 index 0fca6a8..0000000 --- a/www/docfiles/TheBasics1.html +++ /dev/null @@ -1,80 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    The Basics

    -

    Originally developed to generate the Mini-XML and CUPS API - documentation, mxmldoc is now a general-purpose utility which - scans C and C++ source files to produce HTML and man page documentation - along with an XML file representing the functions, types, and - definitions in those source files. Unlike popular documentation - generators like Doxygen or Javadoc, mxmldoc uses in-line - comments rather than comment headers, allowing for more "natural" code - documentation.

    -

    By default, mxmldoc produces HTML documentation. For - example, the following command will scan all of the C source and header - files in the current directory and produce a HTML documentation file - called filename.html:

    -
    -    mxmldoc *.h *.c >filename.html ENTER
    -
    -

    You can also specify an XML file to create which contains all of the - information from the source files. For example, the following command - creates an XML file called filename.xml in addition to the - HTML file:

    -
    -    mxmldoc filename.xml *.h *.c >filename.html ENTER
    -
    -

    The --no-output option disables the normal HTML output:

    -
    -    mxmldoc --no-output filename.xml *.h *.c ENTER
    -
    -

    You can then run mxmldoc again with the XML file alone to - generate the HTML documentation:

    -
    -    mxmldoc filename.xml >filename.html ENTER
    -
    -

    The --man filename option tells mxmldoc to create a - man page instead of HTML documentation, for example:

    -
    -    mxmldoc --man filename filename.xml \
    -        >filename.man ENTER
    -
    -    mxmldoc --man filename *.h *.c \
    -        >filename.man ENTER
    -
    -    mxmldoc --man filename filename.xml *.h *.c \
    -        >filename.man ENTER
    -
    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/TitlesSectionsandIntroductions.html b/www/docfiles/TitlesSectionsandIntroductions.html deleted file mode 100644 index 847cb38..0000000 --- a/www/docfiles/TitlesSectionsandIntroductions.html +++ /dev/null @@ -1,66 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Titles, Sections, and Introductions

    -

    Mxmldoc also provides options to set the title, section, and - introduction text for the generated documentation. The --title text - option specifies the title for the documentation. The title string is - usually put in quotes:

    -
    -    mxmldoc filename.xml \
    -        --title "My Famous Documentation" \
    -        >filename.html ENTER
    -
    -

    The --section name option specifies the section for the - documentation. For HTML documentation, the name is placed in a HTML - comment such as:

    -
    -    <!-- SECTION: name -->
    -
    -

    For man pages, the section name is usually just a number ("3"), or a - number followed by a vendor name ("3acme"). The section name is used in - the .TH directive in the man page:

    -
    -    .TH mylibrary 3acme "My Title" ...
    -
    -

    The default section name for man page output is "3". There is no - default section name for HTML output.

    -

    Finally, the --intro filename option specifies a file to - embed after the title and section but before the generated - documentation. For HTML documentation, the file must consist of valid - HTML without the usual DOCTYPE, html, and body - elements. For man page documentation, the file must consist of valid -nroff(1) text.

    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/Types.html b/www/docfiles/Types.html deleted file mode 100644 index 2fc5ea8..0000000 --- a/www/docfiles/Types.html +++ /dev/null @@ -1,67 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Types

    - - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/Unions.html b/www/docfiles/Unions.html deleted file mode 100644 index c1f110d..0000000 --- a/www/docfiles/Unions.html +++ /dev/null @@ -1,42 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    Unions

    - - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/UsingthemxmldocUtility.html b/www/docfiles/UsingthemxmldocUtility.html deleted file mode 100644 index 43759ec..0000000 --- a/www/docfiles/UsingthemxmldocUtility.html +++ /dev/null @@ -1,40 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    4Using the mxmldoc Utility

    -

    This chapter describes how to use mxmldoc(1) program to - automatically generate documentation from C and C++ source files.

    -
    -Contents -Previous -Next - - diff --git a/www/docfiles/advanced.html b/www/docfiles/advanced.html new file mode 100644 index 0000000..ddb0725 --- /dev/null +++ b/www/docfiles/advanced.html @@ -0,0 +1,578 @@ + + + +Mini-XML Programmers Manual, Version 2.3 + + + + + + + + + + +Contents +Previous +Next +
    +

    3More Mini-XML Programming + Techniques

    +

    This chapter shows additional ways to use the Mini-XML library in + your programs.

    +

    Load Callbacks

    +

    Chapter 2 introduced the +mxmlLoadFile() and +mxmlLoadString() functions. The last argument to these + functions is a callback function which is used to determine the value + type of each data node in an XML document.

    +

    Mini-XML defines several standard callbacks for simple XML data + files:

    + +

    You can provide your own callback functions for more complex XML + documents. Your callback function will receive a pointer to the current + element node and must return the value type of the immediate children + for that element node: MXML_INTEGER, MXML_OPAQUE, +MXML_REAL, or MXML_TEXT. The function is called after + the element and its attributes have been read, so you can look at the + element name, attributes, and attribute values to determine the proper + value type to return.

    + + +

    The following callback function looks for an attribute named "type" + or the element name to determine the value type for its child nodes:

    +
    +    mxml_type_t
    +    type_cb(mxml_node_t *node)
    +    {
    +      const char *type;
    +
    +     /*
    +      * You can lookup attributes and/or use the
    +      * element name, hierarchy, etc...
    +      */
    +
    +      type = mxmlElementGetAttr(node, "type");
    +      if (type == NULL)
    +	type = node->value.element.name;
    +
    +      if (!strcmp(type, "integer"))
    +	return (MXML_INTEGER);
    +      else if (!strcmp(type, "opaque"))
    +	return (MXML_OPAQUE);
    +      else if (!strcmp(type, "real"))
    +	return (MXML_REAL);
    +      else
    +	return (MXML_TEXT);
    +    }
    +
    +

    To use this callback function, simply use the name when you call any + of the load functions:

    +
    +    FILE *fp;
    +    mxml_node_t *tree;
    +
    +    fp = fopen("filename.xml", "r");
    +    tree = mxmlLoadFile(NULL, fp, type_cb);
    +    fclose(fp);
    +
    +

    Save Callbacks

    +

    Chapter 2 also introduced the +mxmlSaveFile(), +mxmlSaveString(), and +mxmlSaveAllocString() functions. The last argument to these + functions is a callback function which is used to automatically insert + whitespace in an XML document.

    +

    Your callback function will be called up to four times for each + element node with a pointer to the node and a "where" value of +MXML_WS_BEFORE_OPEN, MXML_WS_AFTER_OPEN, +MXML_WS_BEFORE_CLOSE, or MXML_WS_AFTER_CLOSE. The callback + function should return NULL if no whitespace should be added + and the string to insert (spaces, tabs, carriage returns, and newlines) + otherwise.

    +

    The following whitespace callback can be used to add whitespace to + XHTML output to make it more readable in a standard text editor:

    +
    +    const char *
    +    whitespace_cb(mxml_node_t *node,
    +                  int where)
    +    {
    +      const char *name;
    +
    +     /*
    +      * We can conditionally break to a new line
    +      * before or after any element. These are
    +      * just common HTML elements...
    +      */
    +
    +      name = node->value.element.name;
    +
    +      if (!strcmp(name, "html") ||
    +          !strcmp(name, "head") ||
    +          !strcmp(name, "body") ||
    +	  !strcmp(name, "pre") ||
    +          !strcmp(name, "p") ||
    +	  !strcmp(name, "h1") ||
    +          !strcmp(name, "h2") ||
    +          !strcmp(name, "h3") ||
    +	  !strcmp(name, "h4") ||
    +          !strcmp(name, "h5") ||
    +          !strcmp(name, "h6"))
    +      {
    +       /*
    +	* Newlines before open and after
    +        * close...
    +	*/
    +
    +	if (where == MXML_WS_BEFORE_OPEN ||
    +            where == MXML_WS_AFTER_CLOSE)
    +	  return ("\n");
    +      }
    +      else if (!strcmp(name, "dl") ||
    +               !strcmp(name, "ol") ||
    +               !strcmp(name, "ul"))
    +      {
    +       /*
    +	* Put a newline before and after list
    +        * elements...
    +	*/
    +
    +	return ("\n");
    +      }
    +      else if (!strcmp(name, "dd") ||
    +               !strcmp(name, "dt") ||
    +               !strcmp(name, "li"))
    +      {
    +       /*
    +	* Put a tab before <li>'s, * <dd>'s,
    +        * and <dt>'s, and a newline after them...
    +	*/
    +
    +	if (where == MXML_WS_BEFORE_OPEN)
    +	  return ("\t");
    +	else if (where == MXML_WS_AFTER_CLOSE)
    +	  return ("\n");
    +      }
    +
    +     /*
    +      * Return NULL for no added whitespace...
    +      */
    +
    +      return (NULL);
    +    }
    +
    +

    To use this callback function, simply use the name when you call any + of the save functions:

    +
    +    FILE *fp;
    +    mxml_node_t *tree;
    +
    +    fp = fopen("filename.xml", "w");
    +    mxmlSaveFile(tree, fp, whitespace_cb);
    +    fclose(fp);
    +
    + + +

    Custom Data Types

    +

    Mini-XML supports custom data types via global load and save + callbacks. Only a single set of callbacks can be active at any time, + however your callbacks can store additional information in order to + support multiple custom data types as needed. The MXML_CUSTOM + node type identifies custom data nodes.

    +

    The load callback receives a pointer to the current data node and a + string of opaque character data from the XML source with character + entities converted to the corresponding UTF-8 characters. For example, + if we wanted to support a custom date/time type whose value is encoded + as "yyyy-mm-ddThh:mm:ssZ" (ISO format), the load callback would look + like the following:

    +
    +    typedef struct
    +    {
    +      unsigned      year,    /* Year */
    +                    month,   /* Month */
    +                    day,     /* Day */
    +                    hour,    /* Hour */
    +                    minute,  /* Minute */
    +                    second;  /* Second */
    +      time_t        unix;    /* UNIX time */
    +    } iso_date_time_t;
    +
    +    int
    +    load_custom(mxml_node_t *node,
    +                const char *data)
    +    {
    +      iso_date_time_t *dt;
    +      struct tm tmdata;
    +
    +     /*
    +      * Allocate data structure...
    +      */
    +
    +      dt = calloc(1, sizeof(iso_date_time_t));
    +
    +     /*
    +      * Try reading 6 unsigned integers from the
    +      * data string...
    +      */
    +
    +      if (sscanf(data, "%u-%u-%uT%u:%u:%uZ",
    +                 &(dt->year), &(dt->month),
    +                 &(dt->day), &(dt->hour),
    +                 &(dt->minute),
    +                 &(dt->second)) != 6)
    +      {
    +       /*
    +        * Unable to read numbers, free the data
    +        * structure and return an error...
    +        */
    +
    +        free(dt);
    +
    +        return (-1);
    +      }
    +
    +     /*
    +      * Range check values...
    +      */
    +
    +      if (dt->month <1 || dt->month > 12 ||
    +          dt->day  <1 || dt->day > 31 ||
    +          dt->hour  <0 || dt->hour > 23 ||
    +          dt->minute  <0 || dt->minute > 59 ||
    +          dt->second  <0 || dt->second > 59)
    +      {
    +       /*
    +        * Date information is out of range...
    +        */
    +
    +        free(dt);
    +
    +        return (-1);
    +      }
    +
    +     /*
    +      * Convert ISO time to UNIX time in
    +      * seconds...
    +      */
    +
    +      tmdata.tm_year = dt->year - 1900;
    +      tmdata.tm_mon  = dt->month - 1;
    +      tmdata.tm_day  = dt->day;
    +      tmdata.tm_hour = dt->hour;
    +      tmdata.tm_min  = dt->minute;
    +      tmdata.tm_sec  = dt->second;
    +
    +      dt->unix = gmtime(&tmdata);
    +
    +     /*
    +      * Assign custom node data and destroy
    +      * function pointers...
    +      */
    +
    +      node->value.custom.data    = dt;
    +      node->value.custom.destroy = free;
    +
    +     /*
    +      * Return with no errors...
    +      */
    +
    +      return (0);
    +    }
    +
    +

    The function itself can return 0 on success or -1 if it is unable to + decode the custom data or the data contains an error. Custom data nodes + contain a void pointer to the allocated custom data for the + node and a pointer to a destructor function which will free the custom + data when the node is deleted.

    +

    The save callback receives the node pointer and returns an allocated + string containing the custom data value. The following save callback + could be used for our ISO date/time type:

    +
    +    char *
    +    save_custom(mxml_node_t *node)
    +    {
    +      char data[255];
    +      iso_date_time_t *dt;
    +
    +
    +      dt = (iso_date_time_t *)node->custom.data;
    +
    +      snprintf(data, sizeof(data),
    +               "%04u-%02u-%02uT%02u:%02u:%02uZ",
    +               dt->year, dt->month, dt->day,
    +               dt->hour, dt->minute, dt->second);
    +
    +      return (strdup(data));
    +    }
    +
    +

    You register the callback functions using the +mxmlSetCustomHandlers() function:

    +
    +    mxmlSetCustomHandlers(load_custom,
    +                          save_custom);
    +
    + + +

    Changing Node Values

    +

    All of the examples so far have concentrated on creating and loading + new XML data nodes. Many applications, however, need to manipulate or + change the nodes during their operation, so Mini-XML provides functions + to change node values safely and without leaking memory.

    +

    Existing nodes can be changed using the +mxmlSetElement(), +mxmlSetInteger(), +mxmlSetOpaque(), +mxmlSetReal(), +mxmlSetText(), and +mxmlSetTextf() functions. For example, use the following + function call to change a text node to contain the text "new" with + leading whitespace:

    +
    +    mxml_node_t *node;
    +
    +    mxmlSetText(node, 1, "new");
    +
    +

    Formatted Text

    +

    The mxmlNewTextf() + and mxmlSetTextf() + functions create and change text nodes, respectively, using printf +-style format strings and arguments. For example, use the following + function call to create a new text node containing a constructed + filename:

    +
    +    mxml_node_t *node;
    +
    +    node = mxmlNewTextf(node, 1, "%s/%s",
    +                        path, filename);
    +
    +

    Indexing

    +

    Mini-XML provides functions for managing indices of nodes. The + current implementation provides the same functionality as +mxmlFindElement(). The advantage of using an index is that + searching and enumeration of elements is significantly faster. The only + disadvantage is that each index is a static snapshot of the XML + document, so indices are not well suited to XML data that is updated + more often than it is searched. The overhead of creating an index is + approximately equal to walking the XML document tree. Nodes in the + index are sorted by element name and attribute value.

    +

    Indices are stored in +mxml_index_t structures. The +mxmlIndexNew() function creates a new index:

    +
    +    mxml_node_t *tree;
    +    mxml_index_t *ind;
    +
    +    ind = mxmlIndexNew(tree, "element",
    +                       "attribute");
    +
    +

    The first argument is the XML node tree to index. Normally this will + be a pointer to the ?xml element.

    +

    The second argument contains the element to index; passing NULL + indexes all element nodes alphabetically.

    +

    The third argument contains the attribute to index; passing NULL + causes only the element name to be indexed.

    +

    Once the index is created, the +mxmlIndexEnum(), +mxmlIndexFind(), and +mxmlIndexReset() functions are used to access the nodes in the + index. The mxmlIndexReset() + function resets the "current" node pointer in the index, allowing + you to do new searches and enumerations on the same index. Typically + you will call this function prior to your calls to +mxmlIndexEnum() and +mxmlIndexFind().

    +

    The mxmlIndexEnum() + function enumerates each of the nodes in the index and can be used in a + loop as follows:

    +
    +    mxml_node_t *node;
    +
    +    mxmlIndexReset(ind);
    +
    +    while ((node = mxmlIndexEnum(ind)) != NULL)
    +    {
    +      // do something with node
    +    }
    +
    +

    The mxmlIndexFind() + function locates the next occurrence of the named element and attribute + value in the index. It can be used to find all matching elements in an + index, as follows:

    +
    +    mxml_node_t *node;
    +
    +    mxmlIndexReset(ind);
    +
    +    while ((node = mxmlIndexFind(ind, "element",
    +                                 "attr-value"))
    +                != NULL)
    +    {
    +      // do something with node
    +    }
    +
    +

    The second and third arguments represent the element name and + attribute value, respectively. A NULL pointer is used to + return all elements or attributes in the index. Passing NULL + for both the element name and attribute value is equivalent to calling +mxmlIndexEnum.

    +

    When you are done using the index, delete it using the +mxmlIndexDelete() function:

    +
    +    mxmlIndexDelete(ind);
    +
    +

    SAX (Stream) Loading of Documents

    +

    Mini-XML supports an implementation of the Simple API for XML (SAX) + which allows you to load and process an XML document as a stream of + nodes. Aside from allowing you to process XML documents of any size, + the Mini-XML implementation also allows you to retain portions of the + document in memory for later processing.

    +

    The mxmlSAXLoadFd, +mxmlSAXLoadFile, and +mxmlSAXLoadString functions provide the SAX loading APIs. + Each function works like the corresponding mxmlLoad function + but uses a callback to process each node as it is read.

    +

    The callback function receives the node, an event code, and a user + data pointer you supply:

    +
    +    void
    +    sax_cb(mxml_node_t *node,
    +           mxml_sax_event_t event,
    +           void *data)
    +    {
    +      ... do something ...
    +    }
    +
    +

    The event will be one of the following:

    + +

    Elements are released after the close element is processed. + All other nodes are released after they are processed. The SAX callback + can retain the node using the +mxmlRetain function. For example, the following SAX + callback will retain all nodes, effectively simulating a normal + in-memory load:

    +
    +    void
    +    sax_cb(mxml_node_t *node,
    +           mxml_sax_event_t event,
    +           void *data)
    +    {
    +      if (event != MXML_SAX_ELEMENT_CLOSE)
    +        mxmlRetain(node);
    +    }
    +
    +

    More typically the SAX callback will only retain a small portion of + the document that is needed for post-processing. For example, the + following SAX callback will retain the title and headings in an XHTML + file. It also retains the (parent) elements like <html>, +<head>, and <body>, and processing directives like +<?xml ... ?> and <!DOCTYPE ... >:

    + + +
    +    void
    +    sax_cb(mxml_node_t *node,
    +           mxml_sax_event_t event,
    +           void *data)
    +    {
    +      if (event == MXML_SAX_ELEMENT_OPEN)
    +      {
    +       /*
    +        * Retain headings and titles...
    +        */
    +
    +        char *name = node->value.element.name;
    +
    +        if (!strcmp(name, "html") ||
    +            !strcmp(name, "head") ||
    +            !strcmp(name, "title") ||
    +            !strcmp(name, "body") ||
    +            !strcmp(name, "h1") ||
    +            !strcmp(name, "h2") ||
    +            !strcmp(name, "h3") ||
    +            !strcmp(name, "h4") ||
    +            !strcmp(name, "h5") ||
    +            !strcmp(name, "h6"))
    +          mxmlRetain(node);
    +      }
    +      else if (event == MXML_SAX_DIRECTIVE)
    +        mxmlRetain(node);
    +      else if (event == MXML_SAX_DATA &&
    +               node->parent->ref_count > 1)
    +      {
    +       /*
    +        * If the parent was retained, then retain
    +        * this data node as well.
    +        */
    +
    +        mxmlRetain(node);
    +      }
    +    }
    +
    +

    The resulting skeleton document tree can then be searched just like + one loaded using the mxmlLoad functions. For example, a filter + that reads an XHTML document from stdin and then shows the title and + headings in the document would look like:

    +
    +    mxml_node_t *doc, *title, *body, *heading;
    +
    +    doc = mxmlSAXLoadFd(NULL, 0,
    +                        MXML_TEXT_CALLBACK,
    +                        sax_cb, NULL);
    +
    +    title = mxmlFindElement(doc, doc, "title",
    +                            NULL, NULL,
    +                            MXML_DESCEND);
    +
    +    if (title)
    +      print_children(title);
    +
    +    body = mxmlFindElement(doc, doc, "body",
    +                           NULL, NULL,
    +                           MXML_DESCEND);
    +
    +    if (body)
    +    {
    +      for (heading = body->child;
    +           heading;
    +           heading = heading->next)
    +        print_children(heading);
    +    }
    +
    +
    +Contents +Previous +Next + + diff --git a/www/docfiles/basics.html b/www/docfiles/basics.html new file mode 100644 index 0000000..16860b0 --- /dev/null +++ b/www/docfiles/basics.html @@ -0,0 +1,440 @@ + + + +Mini-XML Programmers Manual, Version 2.3 + + + + + + + + + + +Contents +Previous +Next +
    +

    2Getting Started with Mini-XML

    +

    This chapter describes how to write programs that use Mini-XML to + access data in an XML file. Mini-XML provides the following + functionality:

    + +

    Mini-XML doesn't do validation or other types of processing on the + data based upon schema files or other sources of definition + information, nor does it support character entities other than those + required by the XML specification.

    +

    The Basics

    +

    Mini-XML provides a single header file which you include:

    +
    +    #include <mxml.h>
    +
    +

    The Mini-XML library is included with your program using the +-lmxml option:

    +
    +    gcc -o myprogram myprogram.c -lmxml ENTER
    +
    +

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

    +
    +    pkg-config --cflags mxml ENTER
    +    pkg-config --libs mxml ENTER
    +
    +

    Nodes

    +

    Every piece of information in an XML file (elements, text, numbers) + is stored in memory in "nodes". Nodes are defined by the +mxml_node_t structure. The type + member defines the node type (element, integer, opaque, real, or + text) which determines which value you want to look at in the +value union.

    + + +
    + + + + + + + + + +
    Table 2-1: Mini-XML Node Value + Members
    ValueTypeNode member
    Customvoid * +node->value.custom.data
    Elementchar * +node->value.element.name
    Integerintnode->value.integer +
    Opaque (string)char * +node->value.opaque
    Realdoublenode->value.real
    Textchar *node->value.text.string +
    +
    +

    Each node also has a user_data member which allows you to + associate application-specific data with each node as needed.

    +

    New nodes are created using the +mxmlNewElement, +mxmlNewInteger, +mxmlNewOpaque, +mxmlNewReal, mxmlNewText + mxmlNewTextf +mxmlNewXML functions. Only elements can have child nodes, + and the top node must be an element, usually the <?xml + version="1.0"?> node created by mxmlNewXML().

    +

    Nodes have pointers to the node above (parent), below ( +child), left (prev), and right (next) of the + current node. If you have an XML file like the following:

    +
    +    <?xml version="1.0"?>
    +    <data>
    +        <node>val1</node>
    +        <node>val2</node>
    +        <node>val3</node>
    +        <group>
    +            <node>val4</node>
    +            <node>val5</node>
    +            <node>val6</node>
    +        </group>
    +        <node>val7</node>
    +        <node>val8</node>
    +    </data>
    +
    +

    the node tree for the file would look like the following in memory:

    +
    +    ?xml
    +      |
    +    data
    +      |
    +    node - node - node - group - node - node
    +      |      |      |      |       |      |
    +    val1   val2   val3     |     val7   val8
    +                           |
    +                         node - node - node
    +                           |      |      |
    +                         val4   val5   val6
    +
    +

    where "-" is a pointer to the next node and "|" is a pointer to the + first child node.

    +

    Once you are done with the XML data, use the +mxmlDelete function to recursively free the memory that is + used for a particular node or the entire tree:

    +
    +    mxmlDelete(tree);
    +
    + + +

    Creating XML Documents

    +

    You can create and update XML documents in memory using the various +mxmlNew functions. The following code will create the XML document + described in the previous section:

    +
    +    mxml_node_t *xml;    /* <?xml ... ?> */
    +    mxml_node_t *data;   /* <data> */
    +    mxml_node_t *node;   /* <node> */
    +    mxml_node_t *group;  /* <group> */
    +
    +    xml = mxmlNewXML("1.0");
    +
    +    data = mxmlNewElement(xml, "data");
    +
    +        node = mxmlNewElement(data, "node");
    +        mxmlNewText(node, 0, "val1");
    +        node = mxmlNewElement(data, "node");
    +        mxmlNewText(node, 0, "val2");
    +        node = mxmlNewElement(data, "node");
    +        mxmlNewText(node, 0, "val3");
    +
    +        group = mxmlNewElement(data, "group");
    +
    +            node = mxmlNewElement(group, "node");
    +            mxmlNewText(node, 0, "val4");
    +            node = mxmlNewElement(group, "node");
    +            mxmlNewText(node, 0, "val5");
    +            node = mxmlNewElement(group, "node");
    +            mxmlNewText(node, 0, "val6");
    +
    +        node = mxmlNewElement(data, "node");
    +        mxmlNewText(node, 0, "val7");
    +        node = mxmlNewElement(data, "node");
    +        mxmlNewText(node, 0, "val8");
    +
    +

    We start by creating the <?xml version="1.0"?> node common + to all XML files using the +mxmlNewXML function:

    +
    +    xml = mxmlNewXML("1.0");
    +
    +

    We then create the <data> node used for this document using + the mxmlNewElement + function. The first argument specifies the parent node (xml) + while the second specifies the element name (data):

    +
    +    data = mxmlNewElement(xml, "data");
    +
    +

    Each <node>...</node> in the file is created using the +mxmlNewElement and +mxmlNewText functions. The first argument of mxmlNewText + specifies the parent node (node). The second argument + specifies whether whitespace appears before the text - 0 or false in + this case. The last argument specifies the actual text to add:

    +
    +    node = mxmlNewElement(data, "node");
    +    mxmlNewText(node, 0, "val1");
    +
    +

    The resulting in-memory XML document can then be saved or processed + just like one loaded from disk or a string.

    + + +

    Loading XML

    +

    You load an XML file using the +mxmlLoadFile function:

    +
    +    FILE *fp;
    +    mxml_node_t *tree;
    +
    +    fp = fopen("filename.xml", "r");
    +    tree = mxmlLoadFile(NULL, fp,
    +                        MXML_TEXT_CALLBACK);
    +    fclose(fp);
    +
    +

    The first argument specifies an existing XML parent node, if any. + Normally you will pass NULL for this argument unless you are + combining multiple XML sources. The XML file must contain a complete + XML document including the ?xml element if the parent node is +NULL.

    +

    The second argument specifies the stdio file to read from, as opened + by fopen() or popen(). You can also use stdin + if you are implementing an XML filter program.

    +

    The third argument specifies a callback function which returns the + value type of the immediate children for a new element node: +MXML_CUSTOM, MXML_IGNORE, MXML_INTEGER, +MXML_OPAQUE, MXML_REAL, or MXML_TEXT. Load + callbacks are described in detail in +Chapter 3. The example code uses the MXML_TEXT_CALLBACK + constant which specifies that all data nodes in the document contain + whitespace-separated text values. Other standard callbacks include +MXML_IGNORE_CALLBACK, MXML_INTEGER_CALLBACK, +MXML_OPAQUE_CALLBACK, and MXML_REAL_CALLBACK.

    +

    The mxmlLoadString + function loads XML node trees from a string:

    + + +
    +    char buffer[8192];
    +    mxml_node_t *tree;
    +
    +    ...
    +    tree = mxmlLoadString(NULL, buffer,
    +                          MXML_TEXT_CALLBACK);
    +
    +

    The first and third arguments are the same as used for +mxmlLoadFile(). The second argument specifies the string or + character buffer to load and must be a complete XML document including + the ?xml element if the parent node is NULL.

    + + +

    Saving XML

    +

    You save an XML file using the +mxmlSaveFile function:

    +
    +    FILE *fp;
    +    mxml_node_t *tree;
    +
    +    fp = fopen("filename.xml", "w");
    +    mxmlSaveFile(tree, fp, MXML_NO_CALLBACK);
    +    fclose(fp);
    +
    +

    The first argument is the XML node tree to save. It should normally + be a pointer to the top-level ?xml node in your XML document.

    +

    The second argument is the stdio file to write to, as opened by +fopen() or popen(). You can also use stdout if + you are implementing an XML filter program.

    +

    The third argument is the whitespace callback to use when saving the + file. Whitespace callbacks are covered in detail in +Chapter 3. The previous example code uses the MXML_NO_CALLBACK + constant to specify that no special whitespace handling is required.

    +

    The mxmlSaveAllocString +, and mxmlSaveString + functions save XML node trees to strings:

    +
    +    char buffer[8192];
    +    char *ptr;
    +    mxml_node_t *tree;
    +
    +    ...
    +    mxmlSaveString(tree, buffer, sizeof(buffer),
    +                   MXML_NO_CALLBACK);
    +
    +    ...
    +    ptr = mxmlSaveAllocString(tree, MXML_NO_CALLBACK);
    +
    +

    The first and last arguments are the same as used for +mxmlSaveFile(). The mxmlSaveString function takes pointer + and size arguments for saving the XML document to a fixed-size buffer, + while mxmlSaveAllocString() returns a string buffer that was + allocated using malloc().

    +

    Controlling Line Wrapping

    +

    When saving XML documents, Mini-XML normally wraps output lines at + column 75 so that the text is readable in terminal windows. The +mxmlSetWrapMargin function overrides the default wrap + margin:

    +
    +    /* Set the margin to 132 columns */
    +    mxmlSetWrapMargin(132);
    +
    +    /* Disable wrapping */
    +    mxmlSetWrapMargin(0);
    +
    + + +

    Finding and Iterating Nodes

    +

    The mxmlWalkPrev and mxmlWalkNextfunctions can + be used to iterate through the XML node tree:

    +
    +    mxml_node_t *node;
    +    
    +    node = mxmlWalkPrev(current, tree,
    +                        MXML_DESCEND);
    +
    +    node = mxmlWalkNext(current, tree,
    +                        MXML_DESCEND);
    +
    +

    In addition, you can find a named element/node using the +mxmlFindElement function:

    +
    +    mxml_node_t *node;
    +    
    +    node = mxmlFindElement(tree, tree, "name",
    +                           "attr", "value",
    +                           MXML_DESCEND);
    +
    +

    The name, attr, and value arguments can be + passed as NULL to act as wildcards, e.g.:

    + + +
    +    /* Find the first "a" element */
    +    node = mxmlFindElement(tree, tree, "a",
    +                           NULL, NULL,
    +                           MXML_DESCEND);
    +
    + + +
    +    /* Find the first "a" element with "href"
    +       attribute */
    +    node = mxmlFindElement(tree, tree, "a",
    +                           "href", NULL,
    +                           MXML_DESCEND);
    +
    + + +
    +    /* Find the first "a" element with "href"
    +       to a URL */
    +    node = mxmlFindElement(tree, tree, "a",
    +                           "href",
    +                           "http://www.easysw.com/",
    +                           MXML_DESCEND);
    +
    + + +
    +    /* Find the first element with a "src"
    +       attribute */
    +    node = mxmlFindElement(tree, tree, NULL,
    +                           "src", NULL,
    +                           MXML_DESCEND);
    +
    + + +
    +    /* Find the first element with a "src"
    +       = "foo.jpg" */
    +    node = mxmlFindElement(tree, tree, NULL,
    +                           "src", "foo.jpg",
    +                           MXML_DESCEND);
    +
    +

    You can also iterate with the same function:

    +
    +    mxml_node_t *node;
    +
    +    for (node = mxmlFindElement(tree, tree,
    +                                "name",
    +                                NULL, NULL,
    +                                MXML_DESCEND);
    +         node != NULL;
    +         node = mxmlFindElement(node, tree,
    +                                "name",
    +                                NULL, NULL,
    +                                MXML_DESCEND))
    +    {
    +      ... do something ...
    +    }
    +
    + + +

    The MXML_DESCEND argument can actually be one of three + constants:

    + +
    +Contents +Previous +Next + + diff --git a/www/docfiles/index.html b/www/docfiles/index.html index a8ba612..c6e4550 100644 --- a/www/docfiles/index.html +++ b/www/docfiles/index.html @@ -24,185 +24,166 @@ A { text-decoration: none }

    Table of Contents


    -
    Introduction +
    Introduction - -Building, Installing, and Packaging Mini-XML +Building, Installing, and Packaging + Mini-XML -Getting Started with - Mini-XML +Getting Started with Mini-XML -More - Mini-XML Programming Techniques +More Mini-XML Programming Techniques + -Using the mxmldoc - Utility +Using the mxmldoc Utility -Mini-XML License +Mini-XML License
    -
    Release Notes +
    Release Notes -Library Reference +Library Reference -XML Schema +XML Schema -
    diff --git a/www/docfiles/install.html b/www/docfiles/install.html new file mode 100644 index 0000000..abab826 --- /dev/null +++ b/www/docfiles/install.html @@ -0,0 +1,115 @@ + + + +Mini-XML Programmers Manual, Version 2.3 + + + + + + + + + + +Contents +Previous +Next +
    +

    1Building, Installing, and + Packaging Mini-XML

    +

    This chapter describes how to build, install, and package Mini-XML on + your system from the source archive. You will need an ANSI/ISO-C + compatible compiler to build Mini-XML - GCC works, as do most vendors' + C compilers. If you are building Mini-XML on Windows, we recommend + using the Visual C++ environment with the supplied solution file. For + other operating systems, you'll need a POSIX-compatible shell and +make program in addition to the C compiler.

    +

    Compiling Mini-XML

    +

    Mini-XML comes with both an autoconf-based configure script and a + Visual C++ solution that can be used to compile the library and + associated tools.

    +

    Compiling with Visual C++

    +

    Open the mxml.sln solution in the vcnet folder. + Choose the desired build configuration, "Debug" (the default) or + "Release", and then choose Build Solution from the + Build menu.

    +

    Compiling with Command-Line Tools

    +

    Type the following command to configure the Mini-XML source code for + your system:

    +
    +    ./configure ENTER
    +
    +

    The default install prefix is /usr/local, which can be + overridden using the --prefix option:

    +
    +    ./configure --prefix=/foo ENTER
    +
    +

    Other configure options can be found using the --help + option:

    +
    +    ./configure --help ENTER
    +
    +

    Once you have configured the software, use the make(1) + program to do the build and run the test program to verify that things + are working, as follows:

    +
    +    make ENTER
    +
    +

    Installing Mini-XML

    +

    If you are using Visual C++, copy the mxml.lib and and + mxml.h files to the Visual C++ lib and include + directories, respectively.

    +

    Otherwise, use the make command with the install + target to install Mini-XML in the configured directories:

    +
    +    make install ENTER
    +
    +

    Creating Mini-XML Packages

    +

    Mini-XML includes two files that can be used to create binary + packages. The first file is mxml.spec which is used by the +rpmbuild(8) software to create Red Hat Package Manager ("RPM") + packages which are commonly used on Linux. Since rpmbuild + wants to compile the software on its own, you can provide it with the + Mini-XML tar file to build the package:

    +
    +    rpmbuild -ta mxml-version.tar.gz ENTER
    +
    +

    The second file is mxml.list which is used by the +epm(1) program to create software packages in a variety of formats. + The epm program is available from the following URL:

    +
    +    http://www.easysw.com/epm/
    +
    +

    Use the make command with the epm target to + create portable and native packages for your system:

    +
    +    make epm ENTER
    +
    +

    The packages are stored in a subdirectory named dist for + your convenience. The portable packages utilize scripts and tar files + to install the software on the target system. After extracting the + package archive, use the mxml.install script to install the + software.

    +

    The native packages will be in the local OS's native format: RPM for + Red Hat Linux, DPKG for Debian Linux, PKG for Solaris, and so forth. + Use the corresponding commands to install the native packages.

    +
    +Contents +Previous +Next + + diff --git a/www/docfiles/intro.html b/www/docfiles/intro.html new file mode 100644 index 0000000..4dba03e --- /dev/null +++ b/www/docfiles/intro.html @@ -0,0 +1,182 @@ + + + +Mini-XML Programmers Manual, Version 2.3 + + + + + + + + + +Contents +Next +
    +

    0Introduction

    +

    This programmers manual describes Mini-XML version 2.3, a small XML + parsing library that you can use to read and write XML data files in + your C and C++ applications.

    +

    Mini-XML was initially developed for the +Gutenprint project to replace the rather large and unwieldy +libxml2 library with something substantially smaller and + easier-to-use. It all began one morning in June of 2003 when Robert + posted the following sentence to the developer's list:

    +
    It's bad enough that we require libxml2, but rolling our + own XML parser is a bit more than we can handle.
    +

    I then replied with:

    +
    Given the limited scope of what you use in XML, it + should be trivial to code a mini-XML API in a few hundred lines of + code.
    +

    I took my own challenge and coded furiously for two days to produced + the initial public release of Mini-XML, total lines of code: 696. + Robert promptly integrated Mini-XML into Gutenprint and removed + libxml2.

    +

    Thanks to lots of feedback and support from various developers, + Mini-XML has evolved since then to provide a more complete XML + implementation and now stands at a whopping 3,441 lines of code, + compared to 103,893 lines of code for libxml2 version 2.6.9.

    +

    Aside from Gutenprint, Mini-XML is used for the following + projects/software applications:

    + +

    Please email me (mxml @ easysw . com) if you would like your project + added or removed from this list, or if you have any comments/quotes you + would like me to publish about your experiences with Mini-XML.

    +

    Organization of This Document

    +

    This manual is organized into the following chapters and appendices:

    + + + +

    Notation Conventions

    +

    Various font and syntax conventions are used in this guide. Examples + and their meanings and uses are explained below:

    +
    +
    lpstat +
    lpstat(1)
    +
    The names of commands; the first mention of a command or function in + a chapter is followed by a manual page section number. +
    +
    +
    /var +
    /usr/share/cups/data/testprint.ps
    +
    File and directory names. +
    +
    +
    Request ID is Printer-123
    +
    Screen output. +
    +
    +
    lp -d printer filename ENTER
    +
    Literal user input; special keys like ENTER are in ALL + CAPS. +
    +
    +
    12.3
    +
    Numbers in the text are written using the period (.) to indicate the + decimal point. +
    +
    +
    + + +

    Abbreviations

    +

    The following abbreviations are used throughout this manual:

    +
    +
    Gb
    +
    Gigabytes, or 1073741824 bytes +
    +
    +
    kb
    +
    Kilobytes, or 1024 bytes +
    +
    +
    Mb
    +
    Megabytes, or 1048576 bytes +
    +
    +
    UTF-8, UTF-16
    +
    Unicode Transformation Format, 8-bit or 16-bit +
    +
    +
    W3C
    +
    World Wide Web Consortium +
    +
    +
    XML
    +
    Extensible Markup Language +
    +
    +
    + + +

    Other References

    +
    +
    The Unicode Standard, Version 4.0, Addison-Wesley, ISBN + 0-321-18578-1
    +
    The definition of the Unicode character set which is used for XML. +
    +
    +
    Extensible + Markup Language (XML) 1.0 (Third Edition)
    +
    The XML specification from the World Wide Web Consortium (W3C) +
    +
    +
    + + +

    Legal Stuff

    +

    The Mini-XML library is copyright 2003-2007 by Michael Sweet.

    +

    This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Library + General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any + later version.

    +

    This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details.

    +
    +Contents +Next + + diff --git a/www/docfiles/MiniXMLLicense.html b/www/docfiles/license.html similarity index 98% rename from www/docfiles/MiniXMLLicense.html rename to www/docfiles/license.html index 07fc528..bfe30f6 100644 --- a/www/docfiles/MiniXMLLicense.html +++ b/www/docfiles/license.html @@ -7,8 +7,8 @@ - - + + - - -Contents -Previous -Next -
    -

    mxmlAdd()

    -

    Description

    -

    Add a node to a tree.

    -

    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.

    -

    Syntax

    -

    void -
    mxmlAdd( mxml_node_t * - parent, int where, mxml_node_t - * child, mxml_node_t * node);
    -

    -

    Arguments

    -
    - - - - - - - -
    NameDescription
    parentParent node
    whereWhere to add, MXML_ADD_BEFORE or - MXML_ADD_AFTER
    childChild node for where or - MXML_ADD_TO_PARENT
    nodeNode to add
    -
    -

    Returns

    -

    Nothing.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlDelete.html b/www/docfiles/mxmlDelete.html deleted file mode 100644 index 6a9ce90..0000000 --- a/www/docfiles/mxmlDelete.html +++ /dev/null @@ -1,58 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlDelete()

    -

    Description

    -

    Delete a node and all of its children.

    -

    If the specified node has a parent, this function first removes the - node from its parent using the mxmlRemove() function.

    -

    Syntax

    -

    void -
    mxmlDelete( mxml_node_t * - node);

    -

    Arguments

    -
    - - - - -
    NameDescription
    nodeNode to delete
    -
    -

    Returns

    -

    Nothing.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlElementGetAttr.html b/www/docfiles/mxmlElementGetAttr.html deleted file mode 100644 index d3e93ce..0000000 --- a/www/docfiles/mxmlElementGetAttr.html +++ /dev/null @@ -1,59 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlElementGetAttr()

    -

    Description

    -

    Get an attribute.

    -

    This function returns NULL if the node is not an element or the named - attribute does not exist.

    -

    Syntax

    -

    const char * -
    mxmlElementGetAttr( -mxml_node_t * node, const char * name);

    -

    Arguments

    -
    - - - - - -
    NameDescription
    nodeElement node
    nameName of attribute
    -
    -

    Returns

    -

    Attribute value or NULL

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlElementSetAttr.html b/www/docfiles/mxmlElementSetAttr.html deleted file mode 100644 index 411cf92..0000000 --- a/www/docfiles/mxmlElementSetAttr.html +++ /dev/null @@ -1,61 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlElementSetAttr()

    -

    Description

    -

    Set an attribute.

    -

    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.

    -

    Syntax

    -

    void -
    mxmlElementSetAttr( -mxml_node_t * node, const char * name, const char * value);

    -

    Arguments

    -
    - - - - - - -
    NameDescription
    nodeElement node
    nameName of attribute
    valueAttribute value
    -
    -

    Returns

    -

    Nothing.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlEntityAddCallback.html b/www/docfiles/mxmlEntityAddCallback.html deleted file mode 100644 index 58fbc60..0000000 --- a/www/docfiles/mxmlEntityAddCallback.html +++ /dev/null @@ -1,49 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    -mxmlEntityAddCallback()

    -

    Description

    -

    Add a callback to convert entities to Unicode.

    -

    Syntax

    -

    int -
    mxmlEntityAddCallback(void);

    -

    Arguments

    -

    None.

    -

    Returns

    -

    0 on success, -1 on failure

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlEntityGetName.html b/www/docfiles/mxmlEntityGetName.html deleted file mode 100644 index c54067a..0000000 --- a/www/docfiles/mxmlEntityGetName.html +++ /dev/null @@ -1,57 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlEntityGetName()

    -

    Description

    -

    Get the name that corresponds to the character value.

    -

    If val does not need to be represented by a named entity, NULL is - returned.

    -

    Syntax

    -

    const char * -
    mxmlEntityGetName( int val);

    -

    Arguments

    -
    - - - - -
    NameDescription
    valCharacter value
    -
    -

    Returns

    -

    Entity name or NULL

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlEntityGetValue.html b/www/docfiles/mxmlEntityGetValue.html deleted file mode 100644 index dc7bf44..0000000 --- a/www/docfiles/mxmlEntityGetValue.html +++ /dev/null @@ -1,57 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlEntityGetValue()

    -

    Description

    -

    Get the character corresponding to a named entity.

    -

    The entity name can also be a numeric constant. -1 is returned if the - name is not known.

    -

    Syntax

    -

    int -
    mxmlEntityGetValue( const char * name);

    -

    Arguments

    -
    - - - - -
    NameDescription
    nameEntity name
    -
    -

    Returns

    -

    Character value or -1 on error

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlEntityRemoveCallback.html b/www/docfiles/mxmlEntityRemoveCallback.html deleted file mode 100644 index 93d041a..0000000 --- a/www/docfiles/mxmlEntityRemoveCallback.html +++ /dev/null @@ -1,49 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    -mxmlEntityRemoveCallback()

    -

    Description

    -

    Remove a callback.

    -

    Syntax

    -

    void -
    mxmlEntityRemoveCallback(void);

    -

    Arguments

    -

    None.

    -

    Returns

    -

    Nothing.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlFindElement.html b/www/docfiles/mxmlFindElement.html deleted file mode 100644 index a8bf92d..0000000 --- a/www/docfiles/mxmlFindElement.html +++ /dev/null @@ -1,72 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlFindElement()

    -

    Description

    -

    Find the named element.

    -

    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.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlFindElement( mxml_node_t - * node, mxml_node_t * top, - const char * name, const char * attr, const char * value, int descend);
    -

    -

    Arguments

    -
    - - - - - - - - - -
    NameDescription
    nodeCurrent node
    topTop node
    nameElement name or NULL for any
    attrAttribute name, or NULL for none
    valueAttribute value, or NULL for any
    descendDescend into tree - MXML_DESCEND, - MXML_NO_DESCEND, or MXML_DESCEND_FIRST
    -
    -

    Returns

    -

    Element node or NULL

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlIndexDelete.html b/www/docfiles/mxmlIndexDelete.html deleted file mode 100644 index c611ab5..0000000 --- a/www/docfiles/mxmlIndexDelete.html +++ /dev/null @@ -1,56 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlIndexDelete()

    -

    Description

    -

    Delete an index.

    -

    Syntax

    -

    void -
    mxmlIndexDelete( -mxml_index_t * ind);

    -

    Arguments

    -
    - - - - -
    NameDescription
    indIndex to delete
    -
    -

    Returns

    -

    Nothing.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlIndexEnum.html b/www/docfiles/mxmlIndexEnum.html deleted file mode 100644 index 8a87805..0000000 --- a/www/docfiles/mxmlIndexEnum.html +++ /dev/null @@ -1,57 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlIndexEnum()

    -

    Description

    -

    Return the next node in the index.

    -

    Nodes are returned in the sorted order of the index.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlIndexEnum( mxml_index_t - * ind);

    -

    Arguments

    -
    - - - - -
    NameDescription
    indIndex to enumerate
    -
    -

    Returns

    -

    Next node or NULL if there is none

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlIndexFind.html b/www/docfiles/mxmlIndexFind.html deleted file mode 100644 index 7611639..0000000 --- a/www/docfiles/mxmlIndexFind.html +++ /dev/null @@ -1,62 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlIndexFind()

    -

    Description

    -

    Find the next matching node.

    -

    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().

    -

    Syntax

    -

    mxml_node_t * -
    mxmlIndexFind( mxml_index_t - * ind, const char * element, const char * value);

    -

    Arguments

    -
    - - - - - - -
    NameDescription
    indIndex to search
    elementElement name to find, if any
    valueAttribute value, if any
    -
    -

    Returns

    -

    Node or NULL if none found

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlIndexNew.html b/www/docfiles/mxmlIndexNew.html deleted file mode 100644 index b311a0d..0000000 --- a/www/docfiles/mxmlIndexNew.html +++ /dev/null @@ -1,63 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlIndexNew()

    -

    Description

    -

    Create a 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.

    -

    Syntax

    -

    mxml_index_t * -
    mxmlIndexNew( mxml_node_t - * node, const char * element, const char * attr);

    -

    Arguments

    -
    - - - - - - -
    NameDescription
    nodeXML node tree
    elementElement to index or NULL for all
    attrAttribute to index or NULL for none
    -
    -

    Returns

    -

    New index

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlIndexReset.html b/www/docfiles/mxmlIndexReset.html deleted file mode 100644 index d63ba10..0000000 --- a/www/docfiles/mxmlIndexReset.html +++ /dev/null @@ -1,59 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlIndexReset()

    -

    Description

    -

    Reset the enumeration/find pointer in the index and return the first - node in the index.

    -

    This function should be called prior to using mxmlIndexEnum() or - mxmlIndexFind() for the first time.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlIndexReset( mxml_index_t - * ind);

    -

    Arguments

    -
    - - - - -
    NameDescription
    indIndex to reset
    -
    -

    Returns

    -

    First node or NULL if there is none

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlLoadFd.html b/www/docfiles/mxmlLoadFd.html deleted file mode 100644 index 776aece..0000000 --- a/www/docfiles/mxmlLoadFd.html +++ /dev/null @@ -1,68 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlLoadFd()

    -

    Description

    -

    Load a file descriptor into an XML node tree.

    -

    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. If - MXML_NO_CALLBACK is specified then all child nodes will be either - MXML_ELEMENT or MXML_TEXT 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.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlLoadFd( mxml_node_t * - top, int fd, mxml_load_cb_t - cb);

    -

    Arguments

    -
    - - - - - - -
    NameDescription
    topTop node
    fdFile descriptor to read from
    cbCallback function or MXML_NO_CALLBACK
    -
    -

    Returns

    -

    First node or NULL if the file could not be read.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlLoadFile.html b/www/docfiles/mxmlLoadFile.html deleted file mode 100644 index 7687c10..0000000 --- a/www/docfiles/mxmlLoadFile.html +++ /dev/null @@ -1,68 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlLoadFile()

    -

    Description

    -

    Load a file into an XML node tree.

    -

    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. If - MXML_NO_CALLBACK is specified then all child nodes will be either - MXML_ELEMENT or MXML_TEXT 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.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlLoadFile( mxml_node_t - * top, FILE * fp, -mxml_load_cb_t cb);

    -

    Arguments

    -
    - - - - - - -
    NameDescription
    topTop node
    fpFile to read from
    cbCallback function or MXML_NO_CALLBACK
    -
    -

    Returns

    -

    First node or NULL if the file could not be read.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlLoadString.html b/www/docfiles/mxmlLoadString.html deleted file mode 100644 index c974d69..0000000 --- a/www/docfiles/mxmlLoadString.html +++ /dev/null @@ -1,68 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlLoadString()

    -

    Description

    -

    Load a string into an XML node tree.

    -

    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. If MXML_NO_CALLBACK is specified then all child nodes will be - either MXML_ELEMENT or MXML_TEXT 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.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlLoadString( mxml_node_t - * top, const char * s, -mxml_load_cb_t cb);

    -

    Arguments

    -
    - - - - - - -
    NameDescription
    topTop node
    sString to load
    cbCallback function or MXML_NO_CALLBACK
    -
    -

    Returns

    -

    First node or NULL if the string has errors.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlNewElement.html b/www/docfiles/mxmlNewElement.html deleted file mode 100644 index 30e386d..0000000 --- a/www/docfiles/mxmlNewElement.html +++ /dev/null @@ -1,60 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlNewElement()

    -

    Description

    -

    Create a new element 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.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlNewElement( mxml_node_t - * parent, const char * name);

    -

    Arguments

    -
    - - - - - -
    NameDescription
    parentParent node or MXML_NO_PARENT
    nameName of element
    -
    -

    Returns

    -

    New node

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlNewInteger.html b/www/docfiles/mxmlNewInteger.html deleted file mode 100644 index eafab03..0000000 --- a/www/docfiles/mxmlNewInteger.html +++ /dev/null @@ -1,60 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlNewInteger()

    -

    Description

    -

    Create a new integer 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.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlNewInteger( mxml_node_t - * parent, int integer);

    -

    Arguments

    -
    - - - - - -
    NameDescription
    parentParent node or MXML_NO_PARENT
    integerInteger value
    -
    -

    Returns

    -

    New node

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlNewOpaque.html b/www/docfiles/mxmlNewOpaque.html deleted file mode 100644 index c57d156..0000000 --- a/www/docfiles/mxmlNewOpaque.html +++ /dev/null @@ -1,61 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlNewOpaque()

    -

    Description

    -

    Create a new opaque string.

    -

    The new opaque 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 node has no parent. The opaque string must be nul-terminated - and is copied into the new node.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlNewOpaque( mxml_node_t - * parent, const char * opaque);

    -

    Arguments

    -
    - - - - - -
    NameDescription
    parentParent node or MXML_NO_PARENT
    opaqueOpaque string
    -
    -

    Returns

    -

    New node

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlNewReal.html b/www/docfiles/mxmlNewReal.html deleted file mode 100644 index f3c3ebd..0000000 --- a/www/docfiles/mxmlNewReal.html +++ /dev/null @@ -1,60 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlNewReal()

    -

    Description

    -

    Create a new real number 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.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlNewReal( mxml_node_t * - parent, double real);

    -

    Arguments

    -
    - - - - - -
    NameDescription
    parentParent node or MXML_NO_PARENT
    realReal number value
    -
    -

    Returns

    -

    New node

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlNewText.html b/www/docfiles/mxmlNewText.html deleted file mode 100644 index e201660..0000000 --- a/www/docfiles/mxmlNewText.html +++ /dev/null @@ -1,64 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlNewText()

    -

    Description

    -

    Create a new text fragment 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.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlNewText( mxml_node_t * - parent, int whitespace, const char * string);

    -

    Arguments

    -
    - - - - - - -
    NameDescription
    parentParent node or MXML_NO_PARENT
    whitespace1 = leading whitespace, 0 = no - whitespace
    stringString
    -
    -

    Returns

    -

    New node

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlNewTextf.html b/www/docfiles/mxmlNewTextf.html deleted file mode 100644 index 0db383e..0000000 --- a/www/docfiles/mxmlNewTextf.html +++ /dev/null @@ -1,65 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlNewTextf()

    -

    Description

    -

    Create a new formatted text fragment 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.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlNewTextf( mxml_node_t - * parent, int whitespace, const char * format, ...);

    -

    Arguments

    -
    - - - - - - - -
    NameDescription
    parentParent node or MXML_NO_PARENT
    whitespace1 = leading whitespace, 0 = no - whitespace
    formatPrintf-style frmat string
    ...Additional args as needed
    -
    -

    Returns

    -

    New node

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlRemove.html b/www/docfiles/mxmlRemove.html deleted file mode 100644 index eeacaf5..0000000 --- a/www/docfiles/mxmlRemove.html +++ /dev/null @@ -1,58 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlRemove()

    -

    Description

    -

    Remove a node from its parent.

    -

    Does not free memory used by the node - use mxmlDelete() for that. - This function does nothing if the node has no parent.

    -

    Syntax

    -

    void -
    mxmlRemove( mxml_node_t * - node);

    -

    Arguments

    -
    - - - - -
    NameDescription
    nodeNode to remove
    -
    -

    Returns

    -

    Nothing.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlSaveAllocString.html b/www/docfiles/mxmlSaveAllocString.html deleted file mode 100644 index 24f787e..0000000 --- a/www/docfiles/mxmlSaveAllocString.html +++ /dev/null @@ -1,69 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlSaveAllocString() -

    -

    Description

    -

    Save an XML node tree to an allocated string.

    -

    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.

    -

    Syntax

    -

    char * -
    mxmlSaveAllocString( -mxml_node_t * node, -mxml_save_cb_t cb);

    -

    Arguments

    -
    - - - - - -
    NameDescription
    nodeNode to write
    cbWhitespace callback or MXML_NO_CALLBACK
    -
    -

    Returns

    -

    Allocated string or NULL

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlSaveFd.html b/www/docfiles/mxmlSaveFd.html deleted file mode 100644 index ba11a3a..0000000 --- a/www/docfiles/mxmlSaveFd.html +++ /dev/null @@ -1,64 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlSaveFd()

    -

    Description

    -

    Save an XML tree to a file descriptor.

    -

    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.

    -

    Syntax

    -

    int -
    mxmlSaveFd( mxml_node_t * - node, int fd, mxml_save_cb_t - cb);

    -

    Arguments

    -
    - - - - - - -
    NameDescription
    nodeNode to write
    fdFile descriptor to write to
    cbWhitespace callback or MXML_NO_CALLBACK
    -
    -

    Returns

    -

    0 on success, -1 on error.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlSaveFile.html b/www/docfiles/mxmlSaveFile.html deleted file mode 100644 index 84afc4f..0000000 --- a/www/docfiles/mxmlSaveFile.html +++ /dev/null @@ -1,64 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlSaveFile()

    -

    Description

    -

    Save an XML tree to a file.

    -

    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.

    -

    Syntax

    -

    int -
    mxmlSaveFile( mxml_node_t - * node, FILE * fp, -mxml_save_cb_t cb);

    -

    Arguments

    -
    - - - - - - -
    NameDescription
    nodeNode to write
    fpFile to write to
    cbWhitespace callback or MXML_NO_CALLBACK
    -
    -

    Returns

    -

    0 on success, -1 on error.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlSaveString.html b/www/docfiles/mxmlSaveString.html deleted file mode 100644 index 4c5a70d..0000000 --- a/www/docfiles/mxmlSaveString.html +++ /dev/null @@ -1,68 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlSaveString()

    -

    Description

    -

    Save an XML node tree to a 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.

    -

    Syntax

    -

    int -
    mxmlSaveString( mxml_node_t - * node, char * buffer, int bufsize, -mxml_save_cb_t cb);

    -

    Arguments

    -
    - - - - - - - -
    NameDescription
    nodeNode to write
    bufferString buffer
    bufsizeSize of string buffer
    cbWhitespace callback or MXML_NO_CALLBACK
    -
    -

    Returns

    -

    Size of string

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlSetCustomHandlers.html b/www/docfiles/mxmlSetCustomHandlers.html deleted file mode 100644 index 072cb86..0000000 --- a/www/docfiles/mxmlSetCustomHandlers.html +++ /dev/null @@ -1,63 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    -mxmlSetCustomHandlers()

    -

    Description

    -

    Set the handling functions for custom data.

    -

    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.

    -

    Syntax

    -

    void -
    mxmlSetCustomHandlers( -mxml_custom_load_cb_t load, -mxml_custom_save_cb_t save);

    -

    Arguments

    -
    - - - - - -
    NameDescription
    loadLoad function
    saveSave function
    -
    -

    Returns

    -

    Nothing.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlSetElement.html b/www/docfiles/mxmlSetElement.html deleted file mode 100644 index b752a06..0000000 --- a/www/docfiles/mxmlSetElement.html +++ /dev/null @@ -1,58 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlSetElement()

    -

    Description

    -

    Set the name of an element node.

    -

    The node is not changed if it is not an element node.

    -

    Syntax

    -

    int -
    mxmlSetElement( mxml_node_t - * node, const char * name);

    -

    Arguments

    -
    - - - - - -
    NameDescription
    nodeNode to set
    nameNew name string
    -
    -

    Returns

    -

    0 on success, -1 on failure

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlSetErrorCallback.html b/www/docfiles/mxmlSetErrorCallback.html deleted file mode 100644 index caf473e..0000000 --- a/www/docfiles/mxmlSetErrorCallback.html +++ /dev/null @@ -1,57 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlSetErrorCallback() -

    -

    Description

    -

    Set the error message callback.

    -

    Syntax

    -

    void -
    mxmlSetErrorCallback( -mxml_error_cb_t cb);

    -

    Arguments

    -
    - - - - -
    NameDescription
    cbError callback function
    -
    -

    Returns

    -

    Nothing.

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlSetInteger.html b/www/docfiles/mxmlSetInteger.html deleted file mode 100644 index 696be00..0000000 --- a/www/docfiles/mxmlSetInteger.html +++ /dev/null @@ -1,58 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlSetInteger()

    -

    Description

    -

    Set the value of an integer node.

    -

    The node is not changed if it is not an integer node.

    -

    Syntax

    -

    int -
    mxmlSetInteger( mxml_node_t - * node, int integer);

    -

    Arguments

    -
    - - - - - -
    NameDescription
    nodeNode to set
    integerInteger value
    -
    -

    Returns

    -

    0 on success, -1 on failure

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlSetOpaque.html b/www/docfiles/mxmlSetOpaque.html deleted file mode 100644 index 590b13b..0000000 --- a/www/docfiles/mxmlSetOpaque.html +++ /dev/null @@ -1,58 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlSetOpaque()

    -

    Description

    -

    Set the value of an opaque node.

    -

    The node is not changed if it is not an opaque node.

    -

    Syntax

    -

    int -
    mxmlSetOpaque( mxml_node_t - * node, const char * opaque);

    -

    Arguments

    -
    - - - - - -
    NameDescription
    nodeNode to set
    opaqueOpaque string
    -
    -

    Returns

    -

    0 on success, -1 on failure

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlSetReal.html b/www/docfiles/mxmlSetReal.html deleted file mode 100644 index 70ffec1..0000000 --- a/www/docfiles/mxmlSetReal.html +++ /dev/null @@ -1,58 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlSetReal()

    -

    Description

    -

    Set the value of a real number node.

    -

    The node is not changed if it is not a real number node.

    -

    Syntax

    -

    int -
    mxmlSetReal( mxml_node_t * - node, double real);

    -

    Arguments

    -
    - - - - - -
    NameDescription
    nodeNode to set
    realReal number value
    -
    -

    Returns

    -

    0 on success, -1 on failure

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlSetText.html b/www/docfiles/mxmlSetText.html deleted file mode 100644 index 724a542..0000000 --- a/www/docfiles/mxmlSetText.html +++ /dev/null @@ -1,60 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlSetText()

    -

    Description

    -

    Set the value of a text node.

    -

    The node is not changed if it is not a text node.

    -

    Syntax

    -

    int -
    mxmlSetText( mxml_node_t * - node, int whitespace, const char * string);

    -

    Arguments

    -
    - - - - - - -
    NameDescription
    nodeNode to set
    whitespace1 = leading whitespace, 0 = no - whitespace
    stringString
    -
    -

    Returns

    -

    0 on success, -1 on failure

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlSetTextf.html b/www/docfiles/mxmlSetTextf.html deleted file mode 100644 index bf30429..0000000 --- a/www/docfiles/mxmlSetTextf.html +++ /dev/null @@ -1,61 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlSetTextf()

    -

    Description

    -

    Set the value of a text node to a formatted string.

    -

    The node is not changed if it is not a text node.

    -

    Syntax

    -

    int -
    mxmlSetTextf( mxml_node_t - * node, int whitespace, const char * format, ...);

    -

    Arguments

    -
    - - - - - - - -
    NameDescription
    nodeNode to set
    whitespace1 = leading whitespace, 0 = no - whitespace
    formatPrintf-style format string
    ...Additional arguments as needed
    -
    -

    Returns

    -

    0 on success, -1 on failure

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlWalkNext.html b/www/docfiles/mxmlWalkNext.html deleted file mode 100644 index d448661..0000000 --- a/www/docfiles/mxmlWalkNext.html +++ /dev/null @@ -1,63 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlWalkNext()

    -

    Description

    -

    Walk to the next logical node in the tree.

    -

    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.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlWalkNext( mxml_node_t - * node, mxml_node_t * top, int - descend);

    -

    Arguments

    -
    - - - - - - -
    NameDescription
    nodeCurrent node
    topTop node
    descendDescend into tree - MXML_DESCEND, - MXML_NO_DESCEND, or MXML_DESCEND_FIRST
    -
    -

    Returns

    -

    Next node or NULL

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlWalkPrev.html b/www/docfiles/mxmlWalkPrev.html deleted file mode 100644 index cd52805..0000000 --- a/www/docfiles/mxmlWalkPrev.html +++ /dev/null @@ -1,63 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxmlWalkPrev()

    -

    Description

    -

    Walk to the previous logical node in the tree.

    -

    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.

    -

    Syntax

    -

    mxml_node_t * -
    mxmlWalkPrev( mxml_node_t - * node, mxml_node_t * top, int - descend);

    -

    Arguments

    -
    - - - - - - -
    NameDescription
    nodeCurrent node
    topTop node
    descendDescend into tree - MXML_DESCEND, - MXML_NO_DESCEND, or MXML_DESCEND_FIRST
    -
    -

    Returns

    -

    Previous node or NULL

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlattrs.html b/www/docfiles/mxmlattrs.html deleted file mode 100644 index 3b69a2d..0000000 --- a/www/docfiles/mxmlattrs.html +++ /dev/null @@ -1,55 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_attr_s

    -

    Description

    -

    An XML element attribute value.

    -

    Definition

    -

    struct mxml_attr_s -
    { -
      char * name; -
      char * value; -
    };

    -

    Members

    -
    - - - - - -
    NameDescription
    nameAttribute name
    valueAttribute value
    -
    - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlattrt.html b/www/docfiles/mxmlattrt.html deleted file mode 100644 index 9628624..0000000 --- a/www/docfiles/mxmlattrt.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_attr_t

    -

    Description

    -

    An XML element attribute value.

    -

    Definition

    -

    typedef struct mxml_attr_s - mxml_attr_t;

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlcustomdestroycbt.html b/www/docfiles/mxmlcustomdestroycbt.html deleted file mode 100644 index 6c1e934..0000000 --- a/www/docfiles/mxmlcustomdestroycbt.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    -mxml_custom_destroy_cb_t

    -

    Description

    -

    Custom data destructor

    -

    Definition

    -

    typedef void (*mxml_custom_destroy_cb_t)(void *);

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlcustomloadcbt.html b/www/docfiles/mxmlcustomloadcbt.html deleted file mode 100644 index 21bf553..0000000 --- a/www/docfiles/mxmlcustomloadcbt.html +++ /dev/null @@ -1,45 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_custom_load_cb_t -

    -

    Description

    -

    Custom data load callback function

    -

    Definition

    -

    typedef int (*mxml_custom_load_cb_t)( -mxml_node_t *, const char *);

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlcustomsavecbt.html b/www/docfiles/mxmlcustomsavecbt.html deleted file mode 100644 index 0cc51e9..0000000 --- a/www/docfiles/mxmlcustomsavecbt.html +++ /dev/null @@ -1,45 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_custom_save_cb_t -

    -

    Description

    -

    Custom data save callback function

    -

    Definition

    -

    typedef char * (*mxml_custom_save_cb_t)( -mxml_node_t *);

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmldoc.html b/www/docfiles/mxmldoc.html new file mode 100644 index 0000000..d0b8974 --- /dev/null +++ b/www/docfiles/mxmldoc.html @@ -0,0 +1,180 @@ + + + +Mini-XML Programmers Manual, Version 2.3 + + + + + + + + + + +Contents +Previous +Next +
    +

    4Using the mxmldoc Utility

    +

    This chapter describes how to use mxmldoc(1) program to + automatically generate documentation from C and C++ source files.

    +

    The Basics

    +

    Originally developed to generate the Mini-XML and CUPS API + documentation, mxmldoc is now a general-purpose utility which + scans C and C++ source files to produce HTML and man page documentation + along with an XML file representing the functions, types, and + definitions in those source files. Unlike popular documentation + generators like Doxygen or Javadoc, mxmldoc uses in-line + comments rather than comment headers, allowing for more "natural" code + documentation.

    +

    By default, mxmldoc produces HTML documentation. For + example, the following command will scan all of the C source and header + files in the current directory and produce a HTML documentation file + called filename.html:

    +
    +    mxmldoc *.h *.c >filename.html ENTER
    +
    +

    You can also specify an XML file to create which contains all of the + information from the source files. For example, the following command + creates an XML file called filename.xml in addition to the + HTML file:

    +
    +    mxmldoc filename.xml *.h *.c >filename.html ENTER
    +
    +

    The --no-output option disables the normal HTML output:

    +
    +    mxmldoc --no-output filename.xml *.h *.c ENTER
    +
    +

    You can then run mxmldoc again with the XML file alone to + generate the HTML documentation:

    +
    +    mxmldoc filename.xml >filename.html ENTER
    +
    +

    The --man filename option tells mxmldoc to create a + man page instead of HTML documentation, for example:

    +
    +    mxmldoc --man filename filename.xml \
    +        >filename.man ENTER
    +
    +    mxmldoc --man filename *.h *.c \
    +        >filename.man ENTER
    +
    +    mxmldoc --man filename filename.xml *.h *.c \
    +        >filename.man ENTER
    +
    +

    Commenting Your Code

    +

    As noted previously, mxmldoc looks for in-line comments to + describe the functions, types, and constants in your code. Mxmldoc + will document all public names it finds in your source files - any + names starting with the underscore character (_) or names that are + documented with the @private@ directive are + treated as private and are undocumented.

    +

    Comments appearing directly before a function or type definition are + used to document that function or type. Comments appearing after + argument, definition, return type, or variable declarations are used to + document that argument, definition, return type, or variable. For + example, the following code excerpt defines a key/value structure and a + function that creates a new instance of that structure:

    +
    +    /* A key/value pair. This is used with the
    +       dictionary structure. */
    +
    +    struct keyval
    +    {
    +      char *key; /* Key string */
    +      char *val; /* Value string */
    +    };
    +
    +    /* Create a new key/value pair. */
    +
    +    struct keyval * /* New key/value pair */
    +    new_keyval(
    +        const char *key, /* Key string */
    +	const char *val) /* Value string */
    +    {
    +      ...
    +    }
    +
    +

    Mxmldoc also knows to remove extra asterisks (*) from the + comment string, so the comment string:

    +
    +    /*
    +     * Compute the value of PI.
    +     *
    +     * The function connects to an Internet server
    +     * that streams audio of mathematical monks
    +     * chanting the first 100 digits of PI.
    +     */
    +
    +

    will be shown as:

    +
    +    Compute the value of PI.
    +
    +    The function connects to an Internet server
    +    that streams audio of mathematical monks
    +    chanting the first 100 digits of PI.
    +
    +

    Comments can also include the following + special @name ...@ directive strings:

    + + + +

    Titles, Sections, and Introductions

    +

    Mxmldoc also provides options to set the title, section, and + introduction text for the generated documentation. The --title text + option specifies the title for the documentation. The title string is + usually put in quotes:

    +
    +    mxmldoc filename.xml \
    +        --title "My Famous Documentation" \
    +        >filename.html ENTER
    +
    +

    The --section name option specifies the section for the + documentation. For HTML documentation, the name is placed in a HTML + comment such as:

    +
    +    <!-- SECTION: name -->
    +
    +

    For man pages, the section name is usually just a number ("3"), or a + number followed by a vendor name ("3acme"). The section name is used in + the .TH directive in the man page:

    +
    +    .TH mylibrary 3acme "My Title" ...
    +
    +

    The default section name for man page output is "3". There is no + default section name for HTML output.

    +

    Finally, the --intro filename option specifies a file to + embed after the title and section but before the generated + documentation. For HTML documentation, the file must consist of valid + HTML without the usual DOCTYPE, html, and body + elements. For man page documentation, the file must consist of valid +nroff(1) text.

    +
    +Contents +Previous +Next + + diff --git a/www/docfiles/mxmlelements.html b/www/docfiles/mxmlelements.html deleted file mode 100644 index ad1d037..0000000 --- a/www/docfiles/mxmlelements.html +++ /dev/null @@ -1,57 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_element_s

    -

    Description

    -

    An XML element value.

    -

    Definition

    -

    struct mxml_element_s -
    { -
      mxml_attr_t * attrs; -
      char * name; -
      int num_attrs; -
    };

    -

    Members

    -
    - - - - - - -
    NameDescription
    attrsAttributes
    nameName of element
    num_attrsNumber of attributes
    -
    - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlelementt.html b/www/docfiles/mxmlelementt.html deleted file mode 100644 index 0b44295..0000000 --- a/www/docfiles/mxmlelementt.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_element_t

    -

    Description

    -

    An XML element value.

    -

    Definition

    -

    typedef struct -mxml_element_s mxml_element_t;

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlerrorcbt.html b/www/docfiles/mxmlerrorcbt.html deleted file mode 100644 index 494c571..0000000 --- a/www/docfiles/mxmlerrorcbt.html +++ /dev/null @@ -1,43 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_error_cb_t

    -

    Description

    -

    Error callback function

    -

    Definition

    -

    typedef void (*mxml_error_cb_t)(const char *);

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlindexs.html b/www/docfiles/mxmlindexs.html deleted file mode 100644 index 15d8425..0000000 --- a/www/docfiles/mxmlindexs.html +++ /dev/null @@ -1,61 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_index_s

    -

    Description

    -

    An XML node index.

    -

    Definition

    -

    struct mxml_index_s -
    { -
      int alloc_nodes; -
      char * attr; -
      int cur_node; -
      mxml_node_t ** nodes; -
      int num_nodes; -
    };

    -

    Members

    -
    - - - - - - - - -
    NameDescription
    alloc_nodesAllocated nodes in index
    attrAttribute used for indexing or NULL
    cur_nodeCurrent node
    nodesNode array
    num_nodesNumber of nodes in index
    -
    - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlindext.html b/www/docfiles/mxmlindext.html deleted file mode 100644 index d14e46d..0000000 --- a/www/docfiles/mxmlindext.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_index_t

    -

    Description

    -

    An XML node index.

    -

    Definition

    -

    typedef struct -mxml_index_s mxml_index_t;

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlloadcbt.html b/www/docfiles/mxmlloadcbt.html deleted file mode 100644 index 260c0d3..0000000 --- a/www/docfiles/mxmlloadcbt.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_load_cb_t

    -

    Description

    -

    Load callback function

    -

    Definition

    -

    typedef mxml_type_t (*mxml_load_cb_t)( -mxml_node_t *);

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlnodes.html b/www/docfiles/mxmlnodes.html deleted file mode 100644 index dd8728b..0000000 --- a/www/docfiles/mxmlnodes.html +++ /dev/null @@ -1,69 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_node_s

    -

    Description

    -

    An XML node.

    -

    Definition

    -

    struct mxml_node_s -
    { -
      struct mxml_node_s * child; -
      struct mxml_node_s * last_child; -
      struct mxml_node_s * next; -
      struct mxml_node_s * parent; -
      struct mxml_node_s * prev; -
      int ref_count; -
      mxml_type_t type; -
      void * user_data; -
      mxml_value_t value; -
    };

    -

    Members

    -
    - - - - - - - - - - - - -
    NameDescription
    childFirst child node
    last_childLast child node
    nextNext node under same parent
    parentParent node
    prevPrevious node under same parent
    ref_countUse count
    typeNode type
    user_dataUser data
    valueNode value
    -
    - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlnodet.html b/www/docfiles/mxmlnodet.html deleted file mode 100644 index dd3219a..0000000 --- a/www/docfiles/mxmlnodet.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_node_t

    -

    Description

    -

    An XML node.

    -

    Definition

    -

    typedef struct mxml_node_s - mxml_node_t;

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlsavecbt.html b/www/docfiles/mxmlsavecbt.html deleted file mode 100644 index c319c04..0000000 --- a/www/docfiles/mxmlsavecbt.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_save_cb_t

    -

    Description

    -

    Save callback function

    -

    Definition

    -

    typedef const char * (*mxml_save_cb_t)( -mxml_node_t *, int);

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlsaxcbt.html b/www/docfiles/mxmlsaxcbt.html deleted file mode 100644 index 1252999..0000000 --- a/www/docfiles/mxmlsaxcbt.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_sax_cb_t

    -

    Description

    -

    SAX callback function

    -

    Definition

    -

    typedef void (*mxml_sax_cb_t)( -mxml_node_t *, mxml_sax_event_t, void *);

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlsaxevente.html b/www/docfiles/mxmlsaxevente.html deleted file mode 100644 index 7cd9a3d..0000000 --- a/www/docfiles/mxmlsaxevente.html +++ /dev/null @@ -1,54 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_sax_event_e

    -

    Description

    -

    SAX event type.

    -

    Values

    -
    - - - - - - - - - - -
    NameDescription
    MXML_SAX_CDATACDATA node
    MXML_SAX_COMMENTComment node
    MXML_SAX_DATAData node
    MXML_SAX_DIRECTIVEProcessing directive node
    MXML_SAX_ELEMENT_CLOSEElement closed
    MXML_SAX_ELEMENT_OPENElement opened
    -
    - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlsaxeventt.html b/www/docfiles/mxmlsaxeventt.html deleted file mode 100644 index bb3b432..0000000 --- a/www/docfiles/mxmlsaxeventt.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_sax_event_t

    -

    Description

    -

    SAX event type.

    -

    Definition

    -

    typedef enum -mxml_sax_event_e mxml_sax_event_t;

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmltexts.html b/www/docfiles/mxmltexts.html deleted file mode 100644 index f663340..0000000 --- a/www/docfiles/mxmltexts.html +++ /dev/null @@ -1,55 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_text_s

    -

    Description

    -

    An XML text value.

    -

    Definition

    -

    struct mxml_text_s -
    { -
      char * string; -
      int whitespace; -
    };

    -

    Members

    -
    - - - - - -
    NameDescription
    stringFragment string
    whitespaceLeading whitespace?
    -
    - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmltextt.html b/www/docfiles/mxmltextt.html deleted file mode 100644 index bf2795e..0000000 --- a/www/docfiles/mxmltextt.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_text_t

    -

    Description

    -

    An XML text value.

    -

    Definition

    -

    typedef struct mxml_text_s - mxml_text_t;

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmltypee.html b/www/docfiles/mxmltypee.html deleted file mode 100644 index b370cea..0000000 --- a/www/docfiles/mxmltypee.html +++ /dev/null @@ -1,58 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_type_e

    -

    Description

    -

    The XML node type.

    -

    Values

    -
    - - - - - - - - - - -
    NameDescription
    MXML_CUSTOM - -  Mini-XML 2.1 Custom data
    MXML_ELEMENTXML element with attributes
    MXML_IGNORE - -  Mini-XML 2.3 Ignore/throw away node
    MXML_INTEGERInteger value
    MXML_OPAQUEOpaque string
    MXML_REALReal value
    MXML_TEXTText fragment
    -
    - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlvaluet.html b/www/docfiles/mxmlvaluet.html deleted file mode 100644 index 5ae502e..0000000 --- a/www/docfiles/mxmlvaluet.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_value_t

    -

    Description

    -

    An XML node value.

    -

    Definition

    -

    typedef union -mxml_value_u mxml_value_t;

    - - -
    -Contents -Previous -Next - - diff --git a/www/docfiles/mxmlvalueu.html b/www/docfiles/mxmlvalueu.html deleted file mode 100644 index 9c80853..0000000 --- a/www/docfiles/mxmlvalueu.html +++ /dev/null @@ -1,65 +0,0 @@ - - - -Mini-XML Programmers Manual, Version 2.3 - - - - - - - - - - -Contents -Previous -Next -
    -

    mxml_value_u

    -

    Description

    -

    An XML node value.

    -

    Definition

    -

    union mxml_value_u -
    { -
      mxml_custom_t - custom; -
      mxml_element_t - element; -
      int integer; -
      char * opaque; -
      double real; -
      mxml_text_t text; -
    };

    -

    Members

    -
    - - - - - - - - - -
    NameDescription
    custom - -  Mini-XML 2.1 Custom data
    elementElement
    integerInteger number
    opaqueOpaque string
    realReal number
    textText fragment
    -

    -Contents -Previous -Next - - diff --git a/www/docfiles/refapp.html b/www/docfiles/refapp.html new file mode 100644 index 0000000..2443bf2 --- /dev/null +++ b/www/docfiles/refapp.html @@ -0,0 +1,1794 @@ + + + +Mini-XML Programmers Manual, Version 2.3 + + + + + + + + + + +Contents +Previous +Next +
    +

    CLibrary Reference

    +

    Contents

    + + + +

    Enumerations

    + + + +

    mxml_sax_event_e

    +

    Description

    +

    SAX event type.

    +

    Values

    +
    + + + + + + + + + + +
    NameDescription
    MXML_SAX_CDATACDATA node
    MXML_SAX_COMMENTComment node
    MXML_SAX_DATAData node
    MXML_SAX_DIRECTIVEProcessing directive node
    MXML_SAX_ELEMENT_CLOSEElement closed
    MXML_SAX_ELEMENT_OPENElement opened
    +
    + +

    mxml_type_e

    +

    Description

    +

    The XML node type.

    +

    Values

    +
    + + + + + + + + + + +
    NameDescription
    MXML_CUSTOM + +  Mini-XML 2.1 Custom data
    MXML_ELEMENTXML element with attributes
    MXML_IGNORE + +  Mini-XML 2.3 Ignore/throw away node
    MXML_INTEGERInteger value
    MXML_OPAQUEOpaque string
    MXML_REALReal value
    MXML_TEXTText fragment
    +
    + +

    Functions

    + + + +

    mxmlAdd()

    +

    Description

    +

    Add a node to a tree.

    +

    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.

    +

    Syntax

    +

    void +
    mxmlAdd( mxml_node_t * parent, int + where, mxml_node_t * child, +mxml_node_t * node);

    +

    Arguments

    +
    + + + + + + + +
    NameDescription
    parentParent node
    whereWhere to add, MXML_ADD_BEFORE or + MXML_ADD_AFTER
    childChild node for where or + MXML_ADD_TO_PARENT
    nodeNode to add
    +
    +

    Returns

    +

    Nothing.

    + + +

    mxmlDelete()

    +

    Description

    +

    Delete a node and all of its children.

    +

    If the specified node has a parent, this function first removes the + node from its parent using the mxmlRemove() function.

    +

    Syntax

    +

    void +
    mxmlDelete( mxml_node_t * node);

    +

    Arguments

    +
    + + + + +
    NameDescription
    nodeNode to delete
    +
    +

    Returns

    +

    Nothing.

    + + +

    mxmlElementGetAttr()

    +

    Description

    +

    Get an attribute.

    +

    This function returns NULL if the node is not an element or the named + attribute does not exist.

    +

    Syntax

    +

    const char * +
    mxmlElementGetAttr( mxml_node_t * node, + const char * name);

    +

    Arguments

    +
    + + + + + +
    NameDescription
    nodeElement node
    nameName of attribute
    +
    +

    Returns

    +

    Attribute value or NULL

    + + +

    mxmlElementSetAttr()

    +

    Description

    +

    Set an attribute.

    +

    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.

    +

    Syntax

    +

    void +
    mxmlElementSetAttr( mxml_node_t * node, + const char * name, const char * value);

    +

    Arguments

    +
    + + + + + + +
    NameDescription
    nodeElement node
    nameName of attribute
    valueAttribute value
    +
    +

    Returns

    +

    Nothing.

    + + +

    + + Mini-XML 2.3 mxmlElementSetAttrf() +

    +

    Description

    +

    Set an attribute with a formatted value.

    +

    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.

    +

    Syntax

    +

    void +
    mxmlElementSetAttrf( mxml_node_t * node, + const char * name, const char * format, ...);

    +

    Arguments

    +
    + + + + + + + +
    NameDescription
    nodeElement node
    nameName of attribute
    formatPrintf-style attribute value
    ...Additional arguments as needed
    +
    +

    Returns

    +

    Nothing.

    + + +

    +mxmlEntityAddCallback()

    +

    Description

    +

    Add a callback to convert entities to Unicode.

    +

    Syntax

    +

    int +
    mxmlEntityAddCallback(void);

    +

    Arguments

    +

    None.

    +

    Returns

    +

    0 on success, -1 on failure

    + + +

    mxmlEntityGetName()

    +

    Description

    +

    Get the name that corresponds to the character value.

    +

    If val does not need to be represented by a named entity, NULL is + returned.

    +

    Syntax

    +

    const char * +
    mxmlEntityGetName( int val);

    +

    Arguments

    +
    + + + + +
    NameDescription
    valCharacter value
    +
    +

    Returns

    +

    Entity name or NULL

    + + +

    mxmlEntityGetValue()

    +

    Description

    +

    Get the character corresponding to a named entity.

    +

    The entity name can also be a numeric constant. -1 is returned if the + name is not known.

    +

    Syntax

    +

    int +
    mxmlEntityGetValue( const char * name);

    +

    Arguments

    +
    + + + + +
    NameDescription
    nameEntity name
    +
    +

    Returns

    +

    Character value or -1 on error

    + + +

    +mxmlEntityRemoveCallback()

    +

    Description

    +

    Remove a callback.

    +

    Syntax

    +

    void +
    mxmlEntityRemoveCallback(void);

    +

    Arguments

    +

    None.

    +

    Returns

    +

    Nothing.

    + + +

    mxmlFindElement()

    +

    Description

    +

    Find the named element.

    +

    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.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlFindElement( mxml_node_t * node, +mxml_node_t * top, const char * name, const char * attr, const char + * value, int descend);

    +

    Arguments

    +
    + + + + + + + + + +
    NameDescription
    nodeCurrent node
    topTop node
    nameElement name or NULL for any
    attrAttribute name, or NULL for none
    valueAttribute value, or NULL for any
    descendDescend into tree - MXML_DESCEND, + MXML_NO_DESCEND, or MXML_DESCEND_FIRST
    +
    +

    Returns

    +

    Element node or NULL

    + + +

    mxmlIndexDelete()

    +

    Description

    +

    Delete an index.

    +

    Syntax

    +

    void +
    mxmlIndexDelete( mxml_index_t * ind);
    +

    +

    Arguments

    +
    + + + + +
    NameDescription
    indIndex to delete
    +
    +

    Returns

    +

    Nothing.

    + + +

    mxmlIndexEnum()

    +

    Description

    +

    Return the next node in the index.

    +

    Nodes are returned in the sorted order of the index.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlIndexEnum( mxml_index_t * ind);
    +

    +

    Arguments

    +
    + + + + +
    NameDescription
    indIndex to enumerate
    +
    +

    Returns

    +

    Next node or NULL if there is none

    + + +

    mxmlIndexFind()

    +

    Description

    +

    Find the next matching node.

    +

    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().

    +

    Syntax

    +

    mxml_node_t * +
    mxmlIndexFind( mxml_index_t * ind, + const char * element, const char * value);

    +

    Arguments

    +
    + + + + + + +
    NameDescription
    indIndex to search
    elementElement name to find, if any
    valueAttribute value, if any
    +
    +

    Returns

    +

    Node or NULL if none found

    + + +

    mxmlIndexNew()

    +

    Description

    +

    Create a 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.

    +

    Syntax

    +

    mxml_index_t * +
    mxmlIndexNew( mxml_node_t * node, const + char * element, const char * attr);

    +

    Arguments

    +
    + + + + + + +
    NameDescription
    nodeXML node tree
    elementElement to index or NULL for all
    attrAttribute to index or NULL for none
    +
    +

    Returns

    +

    New index

    + + +

    mxmlIndexReset()

    +

    Description

    +

    Reset the enumeration/find pointer in the index and return the first + node in the index.

    +

    This function should be called prior to using mxmlIndexEnum() or + mxmlIndexFind() for the first time.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlIndexReset( mxml_index_t * ind);
    +

    +

    Arguments

    +
    + + + + +
    NameDescription
    indIndex to reset
    +
    +

    Returns

    +

    First node or NULL if there is none

    + + +

    mxmlLoadFd()

    +

    Description

    +

    Load a file descriptor into an XML node tree.

    +

    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. If + MXML_NO_CALLBACK is specified then all child nodes will be either + MXML_ELEMENT or MXML_TEXT 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.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlLoadFd( mxml_node_t * top, int fd, mxml_load_cb_t cb);

    +

    Arguments

    +
    + + + + + + +
    NameDescription
    topTop node
    fdFile descriptor to read from
    cbCallback function or MXML_NO_CALLBACK
    +
    +

    Returns

    +

    First node or NULL if the file could not be read.

    + + +

    mxmlLoadFile()

    +

    Description

    +

    Load a file into an XML node tree.

    +

    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. If + MXML_NO_CALLBACK is specified then all child nodes will be either + MXML_ELEMENT or MXML_TEXT 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.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlLoadFile( mxml_node_t * top, FILE * + fp, mxml_load_cb_t cb);

    +

    Arguments

    +
    + + + + + + +
    NameDescription
    topTop node
    fpFile to read from
    cbCallback function or MXML_NO_CALLBACK
    +
    +

    Returns

    +

    First node or NULL if the file could not be read.

    + + +

    mxmlLoadString()

    +

    Description

    +

    Load a string into an XML node tree.

    +

    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. If MXML_NO_CALLBACK is specified then all child nodes will be + either MXML_ELEMENT or MXML_TEXT 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.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlLoadString( mxml_node_t * top, const + char * s, mxml_load_cb_t cb);

    +

    Arguments

    +
    + + + + + + +
    NameDescription
    topTop node
    sString to load
    cbCallback function or MXML_NO_CALLBACK
    +
    +

    Returns

    +

    First node or NULL if the string has errors.

    + + +

    + + Mini-XML 2.3 mxmlNewCDATA()

    +

    Description

    +

    Create a new CDATA 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 use the MXML_ELEMENT type.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlNewCDATA( mxml_node_t * parent, + const char * data);

    +

    Arguments

    +
    + + + + + +
    NameDescription
    parentParent node or MXML_NO_PARENT
    dataData string
    +
    +

    Returns

    +

    New node

    + + +

    + + Mini-XML 2.1 mxmlNewCustom()

    +

    Description

    +

    Create a new custom data 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.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlNewCustom( mxml_node_t * parent, + void * data, +mxml_custom_destroy_cb_t destroy);

    +

    Arguments

    +
    + + + + + + +
    NameDescription
    parentParent node or MXML_NO_PARENT
    dataPointer to data
    destroyFunction to destroy data
    +
    +

    Returns

    +

    New node

    + + +

    mxmlNewElement()

    +

    Description

    +

    Create a new element 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.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlNewElement( mxml_node_t * parent, + const char * name);

    +

    Arguments

    +
    + + + + + +
    NameDescription
    parentParent node or MXML_NO_PARENT
    nameName of element
    +
    +

    Returns

    +

    New node

    + + +

    mxmlNewInteger()

    +

    Description

    +

    Create a new integer 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.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlNewInteger( mxml_node_t * parent, + int integer);

    +

    Arguments

    +
    + + + + + +
    NameDescription
    parentParent node or MXML_NO_PARENT
    integerInteger value
    +
    +

    Returns

    +

    New node

    + + +

    mxmlNewOpaque()

    +

    Description

    +

    Create a new opaque string.

    +

    The new opaque 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 node has no parent. The opaque string must be nul-terminated + and is copied into the new node.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlNewOpaque( mxml_node_t * parent, + const char * opaque);

    +

    Arguments

    +
    + + + + + +
    NameDescription
    parentParent node or MXML_NO_PARENT
    opaqueOpaque string
    +
    +

    Returns

    +

    New node

    + + +

    mxmlNewReal()

    +

    Description

    +

    Create a new real number 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.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlNewReal( mxml_node_t * parent, + double real);

    +

    Arguments

    +
    + + + + + +
    NameDescription
    parentParent node or MXML_NO_PARENT
    realReal number value
    +
    +

    Returns

    +

    New node

    + + +

    mxmlNewText()

    +

    Description

    +

    Create a new text fragment 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.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlNewText( mxml_node_t * parent, int + whitespace, const char * string);

    +

    Arguments

    +
    + + + + + + +
    NameDescription
    parentParent node or MXML_NO_PARENT
    whitespace1 = leading whitespace, 0 = no + whitespace
    stringString
    +
    +

    Returns

    +

    New node

    + + +

    mxmlNewTextf()

    +

    Description

    +

    Create a new formatted text fragment 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.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlNewTextf( mxml_node_t * parent, int + whitespace, const char * format, ...);

    +

    Arguments

    +
    + + + + + + + +
    NameDescription
    parentParent node or MXML_NO_PARENT
    whitespace1 = leading whitespace, 0 = no + whitespace
    formatPrintf-style frmat string
    ...Additional args as needed
    +
    +

    Returns

    +

    New node

    + + +

    + + Mini-XML 2.3 mxmlNewXML()

    +

    Description

    +

    Create a new XML document tree.

    +

    The "version" argument specifies the version number to put in the + ?xml element node. If NULL, version 1.0 is assumed.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlNewXML( const char * version);

    +

    Arguments

    +
    + + + + +
    NameDescription
    versionVersion number to use
    +
    +

    Returns

    +

    New ?xml node

    + + +

    + + Mini-XML 2.3 mxmlRelease()

    +

    Description

    +

    Release a node.

    +

    When the reference count reaches zero, the node (and any children) is + deleted via mxmlDelete().

    +

    Syntax

    +

    int +
    mxmlRelease( mxml_node_t * node);

    +

    Arguments

    +
    + + + + +
    NameDescription
    nodeNode
    +
    +

    Returns

    +

    New reference count

    + + +

    mxmlRemove()

    +

    Description

    +

    Remove a node from its parent.

    +

    Does not free memory used by the node - use mxmlDelete() for that. + This function does nothing if the node has no parent.

    +

    Syntax

    +

    void +
    mxmlRemove( mxml_node_t * node);

    +

    Arguments

    +
    + + + + +
    NameDescription
    nodeNode to remove
    +
    +

    Returns

    +

    Nothing.

    + + +

    + + Mini-XML 2.3 mxmlRetain()

    +

    Description

    +

    Retain a node.

    +

    Syntax

    +

    int +
    mxmlRetain( mxml_node_t * node);

    +

    Arguments

    +
    + + + + +
    NameDescription
    nodeNode
    +
    +

    Returns

    +

    New reference count

    + + +

    + + Mini-XML 2.3 mxmlSAXLoadFd()

    +

    Description

    +

    Load a file descriptor into an XML node tree using a SAX callback.

    +

    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. If + MXML_NO_CALLBACK is specified then all child nodes will be either + MXML_ELEMENT or MXML_TEXT 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.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlSAXLoadFd( mxml_node_t * top, int + fd, mxml_load_cb_t cb, +mxml_sax_cb_t sax_cb, void * sax_data);

    +

    Arguments

    +
    + + + + + + + + +
    NameDescription
    topTop node
    fdFile descriptor to read from
    cbCallback function or MXML_NO_CALLBACK
    sax_cbSAX callback or MXML_NO_CALLBACK
    sax_dataSAX user data
    +
    +

    Returns

    +

    First node or NULL if the file could not be read.

    + + +

    + + Mini-XML 2.3 mxmlSAXLoadFile()

    +

    Description

    +

    Load a file into an XML node tree using a SAX callback.

    +

    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. If + MXML_NO_CALLBACK is specified then all child nodes will be either + MXML_ELEMENT or MXML_TEXT 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.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlSAXLoadFile( mxml_node_t * top, FILE + * fp, mxml_load_cb_t cb, +mxml_sax_cb_t sax_cb, void * sax_data);

    +

    Arguments

    +
    + + + + + + + + +
    NameDescription
    topTop node
    fpFile to read from
    cbCallback function or MXML_NO_CALLBACK
    sax_cbSAX callback or MXML_NO_CALLBACK
    sax_dataSAX user data
    +
    +

    Returns

    +

    First node or NULL if the file could not be read.

    + + +

    + + Mini-XML 2.3 mxmlSAXLoadString()

    +

    Description

    +

    Load a string into an XML node tree using a SAX callback.

    +

    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. If MXML_NO_CALLBACK is specified then all child nodes will be + either MXML_ELEMENT or MXML_TEXT 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.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlSAXLoadString( mxml_node_t * top, + const char * s, mxml_load_cb_t cb, +mxml_sax_cb_t sax_cb, void * sax_data);

    +

    Arguments

    +
    + + + + + + + + +
    NameDescription
    topTop node
    sString to load
    cbCallback function or MXML_NO_CALLBACK
    sax_cbSAX callback or MXML_NO_CALLBACK
    sax_dataSAX user data
    +
    +

    Returns

    +

    First node or NULL if the string has errors.

    + + +

    mxmlSaveAllocString() +

    +

    Description

    +

    Save an XML node tree to an allocated string.

    +

    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.

    +

    Syntax

    +

    char * +
    mxmlSaveAllocString( mxml_node_t * node, + mxml_save_cb_t cb);

    +

    Arguments

    +
    + + + + + +
    NameDescription
    nodeNode to write
    cbWhitespace callback or MXML_NO_CALLBACK
    +
    +

    Returns

    +

    Allocated string or NULL

    + + +

    mxmlSaveFd()

    +

    Description

    +

    Save an XML tree to a file descriptor.

    +

    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.

    +

    Syntax

    +

    int +
    mxmlSaveFd( mxml_node_t * node, int fd, mxml_save_cb_t cb);

    +

    Arguments

    +
    + + + + + + +
    NameDescription
    nodeNode to write
    fdFile descriptor to write to
    cbWhitespace callback or MXML_NO_CALLBACK
    +
    +

    Returns

    +

    0 on success, -1 on error.

    + + +

    mxmlSaveFile()

    +

    Description

    +

    Save an XML tree to a file.

    +

    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.

    +

    Syntax

    +

    int +
    mxmlSaveFile( mxml_node_t * node, FILE * + fp, mxml_save_cb_t cb);

    +

    Arguments

    +
    + + + + + + +
    NameDescription
    nodeNode to write
    fpFile to write to
    cbWhitespace callback or MXML_NO_CALLBACK
    +
    +

    Returns

    +

    0 on success, -1 on error.

    + + +

    mxmlSaveString()

    +

    Description

    +

    Save an XML node tree to a 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.

    +

    Syntax

    +

    int +
    mxmlSaveString( mxml_node_t * node, char + * buffer, int bufsize, mxml_save_cb_t + cb);

    +

    Arguments

    +
    + + + + + + + +
    NameDescription
    nodeNode to write
    bufferString buffer
    bufsizeSize of string buffer
    cbWhitespace callback or MXML_NO_CALLBACK
    +
    +

    Returns

    +

    Size of string

    + + +

    + + Mini-XML 2.3 mxmlSetCDATA()

    +

    Description

    +

    Set the element name of a CDATA node.

    +

    The node is not changed if it is not a CDATA element node.

    +

    Syntax

    +

    int +
    mxmlSetCDATA( mxml_node_t * node, const + char * data);

    +

    Arguments

    +
    + + + + + +
    NameDescription
    nodeNode to set
    dataNew data string
    +
    +

    Returns

    +

    0 on success, -1 on failure

    + + +

    + + Mini-XML 2.1 mxmlSetCustom()

    +

    Description

    +

    Set the data and destructor of a custom data node.

    +

    The node is not changed if it is not a custom node.

    +

    Syntax

    +

    int +
    mxmlSetCustom( mxml_node_t * node, void + * data, mxml_custom_destroy_cb_t + destroy);

    +

    Arguments

    +
    + + + + + + +
    NameDescription
    nodeNode to set
    dataNew data pointer
    destroyNew destructor function
    +
    +

    Returns

    +

    0 on success, -1 on failure

    + + +

    +mxmlSetCustomHandlers()

    +

    Description

    +

    Set the handling functions for custom data.

    +

    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.

    +

    Syntax

    +

    void +
    mxmlSetCustomHandlers( +mxml_custom_load_cb_t load, +mxml_custom_save_cb_t save);

    +

    Arguments

    +
    + + + + + +
    NameDescription
    loadLoad function
    saveSave function
    +
    +

    Returns

    +

    Nothing.

    + + +

    mxmlSetElement()

    +

    Description

    +

    Set the name of an element node.

    +

    The node is not changed if it is not an element node.

    +

    Syntax

    +

    int +
    mxmlSetElement( mxml_node_t * node, + const char * name);

    +

    Arguments

    +
    + + + + + +
    NameDescription
    nodeNode to set
    nameNew name string
    +
    +

    Returns

    +

    0 on success, -1 on failure

    + + +

    mxmlSetErrorCallback() +

    +

    Description

    +

    Set the error message callback.

    +

    Syntax

    +

    void +
    mxmlSetErrorCallback( mxml_error_cb_t + cb);

    +

    Arguments

    +
    + + + + +
    NameDescription
    cbError callback function
    +
    +

    Returns

    +

    Nothing.

    + + +

    mxmlSetInteger()

    +

    Description

    +

    Set the value of an integer node.

    +

    The node is not changed if it is not an integer node.

    +

    Syntax

    +

    int +
    mxmlSetInteger( mxml_node_t * node, int + integer);

    +

    Arguments

    +
    + + + + + +
    NameDescription
    nodeNode to set
    integerInteger value
    +
    +

    Returns

    +

    0 on success, -1 on failure

    + + +

    mxmlSetOpaque()

    +

    Description

    +

    Set the value of an opaque node.

    +

    The node is not changed if it is not an opaque node.

    +

    Syntax

    +

    int +
    mxmlSetOpaque( mxml_node_t * node, const + char * opaque);

    +

    Arguments

    +
    + + + + + +
    NameDescription
    nodeNode to set
    opaqueOpaque string
    +
    +

    Returns

    +

    0 on success, -1 on failure

    + + +

    mxmlSetReal()

    +

    Description

    +

    Set the value of a real number node.

    +

    The node is not changed if it is not a real number node.

    +

    Syntax

    +

    int +
    mxmlSetReal( mxml_node_t * node, double + real);

    +

    Arguments

    +
    + + + + + +
    NameDescription
    nodeNode to set
    realReal number value
    +
    +

    Returns

    +

    0 on success, -1 on failure

    + + +

    mxmlSetText()

    +

    Description

    +

    Set the value of a text node.

    +

    The node is not changed if it is not a text node.

    +

    Syntax

    +

    int +
    mxmlSetText( mxml_node_t * node, int + whitespace, const char * string);

    +

    Arguments

    +
    + + + + + + +
    NameDescription
    nodeNode to set
    whitespace1 = leading whitespace, 0 = no + whitespace
    stringString
    +
    +

    Returns

    +

    0 on success, -1 on failure

    + + +

    mxmlSetTextf()

    +

    Description

    +

    Set the value of a text node to a formatted string.

    +

    The node is not changed if it is not a text node.

    +

    Syntax

    +

    int +
    mxmlSetTextf( mxml_node_t * node, int + whitespace, const char * format, ...);

    +

    Arguments

    +
    + + + + + + + +
    NameDescription
    nodeNode to set
    whitespace1 = leading whitespace, 0 = no + whitespace
    formatPrintf-style format string
    ...Additional arguments as needed
    +
    +

    Returns

    +

    0 on success, -1 on failure

    + + +

    + + Mini-XML 2.3 mxmlSetWrapMargin()

    +

    Description

    +

    Set the the wrap margin when saving XML data.

    +

    Wrapping is disabled when "column" is <= 0.

    +

    Syntax

    +

    void +
    mxmlSetWrapMargin( int column);

    +

    Arguments

    +
    + + + + +
    NameDescription
    columnColumn for wrapping
    +
    +

    Returns

    +

    Nothing.

    + + +

    mxmlWalkNext()

    +

    Description

    +

    Walk to the next logical node in the tree.

    +

    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.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlWalkNext( mxml_node_t * node, +mxml_node_t * top, int descend);

    +

    Arguments

    +
    + + + + + + +
    NameDescription
    nodeCurrent node
    topTop node
    descendDescend into tree - MXML_DESCEND, + MXML_NO_DESCEND, or MXML_DESCEND_FIRST
    +
    +

    Returns

    +

    Next node or NULL

    + + +

    mxmlWalkPrev()

    +

    Description

    +

    Walk to the previous logical node in the tree.

    +

    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.

    +

    Syntax

    +

    mxml_node_t * +
    mxmlWalkPrev( mxml_node_t * node, +mxml_node_t * top, int descend);

    +

    Arguments

    +
    + + + + + + +
    NameDescription
    nodeCurrent node
    topTop node
    descendDescend into tree - MXML_DESCEND, + MXML_NO_DESCEND, or MXML_DESCEND_FIRST
    +
    +

    Returns

    +

    Previous node or NULL

    + + +

    Structures

    + + + +

    mxml_attr_s

    +

    Description

    +

    An XML element attribute value.

    +

    Definition

    +

    struct mxml_attr_s +
    { +
      char * name; +
      char * value; +
    };

    +

    Members

    +
    + + + + + +
    NameDescription
    nameAttribute name
    valueAttribute value
    +
    + +

    + + Mini-XML 2.1 mxml_custom_s

    +

    Description

    +

    An XML custom value.

    +

    Definition

    +

    struct mxml_custom_s +
    { +
      void * data; +
      mxml_custom_destroy_cb_t + destroy; +
    };

    +

    Members

    +
    + + + + + +
    NameDescription
    dataPointer to (allocated) custom data
    destroyPointer to destructor function
    +
    + +

    mxml_element_s

    +

    Description

    +

    An XML element value.

    +

    Definition

    +

    struct mxml_element_s +
    { +
      mxml_attr_t * attrs; +
      char * name; +
      int num_attrs; +
    };

    +

    Members

    +
    + + + + + + +
    NameDescription
    attrsAttributes
    nameName of element
    num_attrsNumber of attributes
    +
    + +

    mxml_index_s

    +

    Description

    +

    An XML node index.

    +

    Definition

    +

    struct mxml_index_s +
    { +
      int alloc_nodes; +
      char * attr; +
      int cur_node; +
      mxml_node_t ** nodes; +
      int num_nodes; +
    };

    +

    Members

    +
    + + + + + + + + +
    NameDescription
    alloc_nodesAllocated nodes in index
    attrAttribute used for indexing or NULL
    cur_nodeCurrent node
    nodesNode array
    num_nodesNumber of nodes in index
    +
    + +

    mxml_node_s

    +

    Description

    +

    An XML node.

    +

    Definition

    +

    struct mxml_node_s +
    { +
      struct mxml_node_s * child; +
      struct mxml_node_s * last_child; +
      struct mxml_node_s * next; +
      struct mxml_node_s * parent; +
      struct mxml_node_s * prev; +
      int ref_count; +
      mxml_type_t type; +
      void * user_data; +
      mxml_value_t value; +
    };

    +

    Members

    +
    + + + + + + + + + + + + +
    NameDescription
    childFirst child node
    last_childLast child node
    nextNext node under same parent
    parentParent node
    prevPrevious node under same parent
    ref_countUse count
    typeNode type
    user_dataUser data
    valueNode value
    +
    + +

    mxml_text_s

    +

    Description

    +

    An XML text value.

    +

    Definition

    +

    struct mxml_text_s +
    { +
      char * string; +
      int whitespace; +
    };

    +

    Members

    +
    + + + + + +
    NameDescription
    stringFragment string
    whitespaceLeading whitespace?
    +
    + +

    Types

    + + + +

    mxml_attr_t

    +

    Description

    +

    An XML element attribute value.

    +

    Definition

    +

    typedef struct mxml_attr_s + mxml_attr_t;

    + + +

    +mxml_custom_destroy_cb_t

    +

    Description

    +

    Custom data destructor

    +

    Definition

    +

    typedef void (*mxml_custom_destroy_cb_t)(void *);

    + + +

    mxml_custom_load_cb_t +

    +

    Description

    +

    Custom data load callback function

    +

    Definition

    +

    typedef int (*mxml_custom_load_cb_t)( +mxml_node_t *, const char *);

    + + +

    mxml_custom_save_cb_t +

    +

    Description

    +

    Custom data save callback function

    +

    Definition

    +

    typedef char * (*mxml_custom_save_cb_t)( +mxml_node_t *);

    + + +

    + + Mini-XML 2.1 mxml_custom_t

    +

    Description

    +

    An XML custom value.

    +

    Definition

    +

    typedef struct mxml_custom_s + mxml_custom_t;

    + + +

    mxml_element_t

    +

    Description

    +

    An XML element value.

    +

    Definition

    +

    typedef struct mxml_element_s + mxml_element_t;

    + + +

    mxml_error_cb_t

    +

    Description

    +

    Error callback function

    +

    Definition

    +

    typedef void (*mxml_error_cb_t)(const char *);

    + + +

    mxml_index_t

    +

    Description

    +

    An XML node index.

    +

    Definition

    +

    typedef struct mxml_index_s + mxml_index_t;

    + + +

    mxml_load_cb_t

    +

    Description

    +

    Load callback function

    +

    Definition

    +

    typedef mxml_type_t (*mxml_load_cb_t)( +mxml_node_t *);

    + + +

    mxml_node_t

    +

    Description

    +

    An XML node.

    +

    Definition

    +

    typedef struct mxml_node_s + mxml_node_t;

    + + +

    mxml_save_cb_t

    +

    Description

    +

    Save callback function

    +

    Definition

    +

    typedef const char * (*mxml_save_cb_t)( +mxml_node_t *, int);

    + + +

    mxml_sax_cb_t

    +

    Description

    +

    SAX callback function

    +

    Definition

    +

    typedef void (*mxml_sax_cb_t)(mxml_node_t + *, mxml_sax_event_t, void *);

    + + +

    mxml_sax_event_t

    +

    Description

    +

    SAX event type.

    +

    Definition

    +

    typedef enum mxml_sax_event_e + mxml_sax_event_t;

    + + +

    mxml_text_t

    +

    Description

    +

    An XML text value.

    +

    Definition

    +

    typedef struct mxml_text_s + mxml_text_t;

    + + +

    mxml_value_t

    +

    Description

    +

    An XML node value.

    +

    Definition

    +

    typedef union mxml_value_u + mxml_value_t;

    + + +

    Unions

    + + + +

    mxml_value_u

    +

    Description

    +

    An XML node value.

    +

    Definition

    +

    union mxml_value_u +
    { +
      mxml_custom_t custom; +
      mxml_element_t element; +
      int integer; +
      char * opaque; +
      double real; +
      mxml_text_t text; +
    };

    +

    Members

    +
    + + + + + + + + + +
    NameDescription
    custom + +  Mini-XML 2.1 Custom data
    elementElement
    integerInteger number
    opaqueOpaque string
    realReal number
    textText fragment
    +

    +Contents +Previous +Next + + diff --git a/www/docfiles/ReleaseNotes.html b/www/docfiles/relnotes.html similarity index 97% rename from www/docfiles/ReleaseNotes.html rename to www/docfiles/relnotes.html index 0e20e09..0cbeba7 100644 --- a/www/docfiles/ReleaseNotes.html +++ b/www/docfiles/relnotes.html @@ -7,8 +7,8 @@ - - + +