Bump version to 2.3.

Add @since ...@ comments.

Fix parsing of @...@ comments.

Add comments to end of each list item.

Use "-Os -g" as the default optimization with GCC.

Change string functions to use _mxml prefix instead.
pull/193/head
Michael R Sweet 19 years ago
parent 62376c5156
commit a5ea819842
  1. 6
      CHANGES
  2. 24
      Makefile.in
  3. 12
      config.h.in
  4. 35
      configure
  5. 35
      configure.in
  6. 99
      doc/reference.html
  7. 5
      doc/relnotes.html
  8. 10
      mxml-node.c
  9. 8
      mxml-set.c
  10. 36
      mxml-string.c
  11. 12
      mxml.h
  12. 58
      mxml.xml
  13. 92
      mxmldoc.c

@ -1,8 +1,10 @@
CHANGES - 09/28/2005 CHANGES - 10/13/2005
-------------------- --------------------
CHANGES IN Mini-XML 2.2.3 CHANGES IN Mini-XML 2.3
- The mxmldoc program now supports "@since version@" and
"@deprecated@" comments.
- Fixed function and enumeraion type bugs in mxmldoc. - Fixed function and enumeraion type bugs in mxmldoc.
- Fixed XML schema for mxmldoc. - Fixed XML schema for mxmldoc.
- The mxmldoc program now supports --title and --intro - The mxmldoc program now supports --title and --intro

@ -148,13 +148,13 @@ install-libmxml.a:
$(INSTALL_DIR) $(BUILDROOT)$(libdir) $(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml.a $(BUILDROOT)$(libdir) $(INSTALL_LIB) libmxml.a $(BUILDROOT)$(libdir)
install-libmxml.so.1.1: install-libmxml.so.1.2:
$(INSTALL_DIR) $(BUILDROOT)$(libdir) $(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml.so.1.1 $(BUILDROOT)$(libdir) $(INSTALL_LIB) libmxml.so.1.2 $(BUILDROOT)$(libdir)
$(RM) $(BUILDROOT)$(libdir)/libmxml.so $(RM) $(BUILDROOT)$(libdir)/libmxml.so
$(LN) libmxml.so.1.1 $(BUILDROOT)$(libdir)/libmxml.so $(LN) libmxml.so.1.2 $(BUILDROOT)$(libdir)/libmxml.so
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.1 $(RM) $(BUILDROOT)$(libdir)/libmxml.so.1
$(LN) libmxml.so.1.1 $(BUILDROOT)$(libdir)/libmxml.so.1 $(LN) libmxml.so.1.2 $(BUILDROOT)$(libdir)/libmxml.so.1
install-libmxml.sl.1: install-libmxml.sl.1:
$(INSTALL_DIR) $(BUILDROOT)$(libdir) $(INSTALL_DIR) $(BUILDROOT)$(libdir)
@ -186,10 +186,10 @@ uninstall: uninstall-$(LIBMXML) uninstall-libmxml.a
uninstall-libmxml.a: uninstall-libmxml.a:
$(RM) $(BUILDROOT)$(libdir)/libmxml.a $(RM) $(BUILDROOT)$(libdir)/libmxml.a
uninstall-libmxml.so.1.1: uninstall-libmxml.so.1.2:
$(RM) $(BUILDROOT)$(libdir)/libmxml.so $(RM) $(BUILDROOT)$(libdir)/libmxml.so
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.1 $(RM) $(BUILDROOT)$(libdir)/libmxml.so.1
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.1.1 $(RM) $(BUILDROOT)$(libdir)/libmxml.so.1.2
uninstall-libmxml.sl.1: uninstall-libmxml.sl.1:
$(RM) $(BUILDROOT)$(libdir)/libmxml.sl $(RM) $(BUILDROOT)$(libdir)/libmxml.sl
@ -258,14 +258,14 @@ $(LIBOBJS): mxml.h
# #
# libmxml.so.1.1 # libmxml.so.1.2
# #
libmxml.so.1.1: $(LIBOBJS) libmxml.so.1.2: $(LIBOBJS)
$(DSO) $(DSOFLAGS) -o libmxml.so.1.1 $(LIBOBJS) $(DSO) $(DSOFLAGS) -o libmxml.so.1.2 $(LIBOBJS)
$(RM) libmxml.so libmxml.so.1 $(RM) libmxml.so libmxml.so.1
$(LN) libmxml.so.1.1 libmxml.so $(LN) libmxml.so.1.2 libmxml.so
$(LN) libmxml.so.1.1 libmxml.so.1 $(LN) libmxml.so.1.2 libmxml.so.1
# #
@ -285,7 +285,7 @@ libmxml.sl.1: $(LIBOBJS)
libmxml.1.dylib: $(LIBOBJS) libmxml.1.dylib: $(LIBOBJS)
$(DSO) $(DSOFLAGS) -o libmxml.1.dylib \ $(DSO) $(DSOFLAGS) -o libmxml.1.dylib \
-install_name $(libdir)/libmxml.dylib \ -install_name $(libdir)/libmxml.dylib \
-current_version 1.1.0 \ -current_version 1.2.0 \
-compatibility_version 1.0.0 \ -compatibility_version 1.0.0 \
$(LIBOBJS) $(LIBOBJS)
$(RM) libmxml.dylib libmxml.1.dylib $(RM) libmxml.dylib libmxml.1.dylib

@ -53,16 +53,16 @@
*/ */
# ifndef HAVE_STRDUP # ifndef HAVE_STRDUP
extern char *mxml_strdup(const char *); extern char *_mxml_strdup(const char *);
# define strdup mxml_strdup # define strdup _mxml_strdup
# endif /* !HAVE_STRDUP */ # endif /* !HAVE_STRDUP */
extern char *mxml_strdupf(const char *, ...); extern char *_mxml_strdupf(const char *, ...);
extern char *mxml_vstrdupf(const char *, va_list); extern char *_mxml_vstrdupf(const char *, va_list);
# ifndef HAVE_VSNPRINTF # ifndef HAVE_VSNPRINTF
extern int mxml_vsnprintf(char *, size_t, const char *, va_list); extern int _mxml_vsnprintf(char *, size_t, const char *, va_list);
# define vsnprintf mxml_vsnprintf # define vsnprintf _mxml_vsnprintf
# endif /* !HAVE_VSNPRINTF */ # endif /* !HAVE_VSNPRINTF */
/* /*

35
configure vendored

@ -1236,7 +1236,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_config_headers="$ac_config_headers config.h" ac_config_headers="$ac_config_headers config.h"
VERSION=2.2.3 VERSION=2.3
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
#define MXML_VERSION "Mini-XML v$VERSION" #define MXML_VERSION "Mini-XML v$VERSION"
@ -1247,7 +1247,7 @@ CFLAGS="${CFLAGS:=}"
CXXFLAGS="${CXXFLAGS:=}" CXXFLAGS="${CXXFLAGS:=}"
LDFLAGS="${LDFLAGS:=}" LDFLAGS="${LDFLAGS:=}"
OPTIM="-O" OPTIM=""
@ -1264,8 +1264,6 @@ if test "${enable_debug+set}" = set; then
enableval="$enable_debug" enableval="$enable_debug"
if eval "test x$enable_debug = xyes"; then if eval "test x$enable_debug = xyes"; then
OPTIM="-g" OPTIM="-g"
else
LDFLAGS="$LDFLAGS -s"
fi fi
fi; fi;
@ -3154,7 +3152,7 @@ echo $ECHO_N "checking for shared library support... $ECHO_C" >&6
SunOS* | UNIX_S*) SunOS* | UNIX_S*)
echo "$as_me:$LINENO: result: yes" >&5 echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6 echo "${ECHO_T}yes" >&6
LIBMXML="libmxml.so.1.1" LIBMXML="libmxml.so.1.2"
DSO="\$(CC)" DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-h,libmxml.so.1 -G -R\$(libdir) \$(OPTIM)" DSOFLAGS="$DSOFLAGS -Wl,-h,libmxml.so.1 -G -R\$(libdir) \$(OPTIM)"
LDFLAGS="$LDFLAGS -R\$(libdir)" LDFLAGS="$LDFLAGS -R\$(libdir)"
@ -3163,7 +3161,7 @@ echo "${ECHO_T}yes" >&6
HP-UX*) HP-UX*)
echo "$as_me:$LINENO: result: yes" >&5 echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6 echo "${ECHO_T}yes" >&6
LIBMXML="libmxml.sl.1" LIBMXML="libmxml.sl.2"
DSO="ld" DSO="ld"
DSOFLAGS="$DSOFLAGS -b -z +h libmxml.sl.1 +s +b \$(libdir)" DSOFLAGS="$DSOFLAGS -b -z +h libmxml.sl.1 +s +b \$(libdir)"
LDFLAGS="$LDFLAGS -Wl,+s,+b,\$(libdir)" LDFLAGS="$LDFLAGS -Wl,+s,+b,\$(libdir)"
@ -3172,7 +3170,7 @@ echo "${ECHO_T}yes" >&6
IRIX) IRIX)
echo "$as_me:$LINENO: result: yes" >&5 echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6 echo "${ECHO_T}yes" >&6
LIBMXML="libmxml.so.1.1" LIBMXML="libmxml.so.1.2"
DSO="\$(CC)" DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-rpath,\$(libdir),-set_version,sgi1.0,-soname,libmxml.so.1 -shared \$(OPTIM)" DSOFLAGS="$DSOFLAGS -Wl,-rpath,\$(libdir),-set_version,sgi1.0,-soname,libmxml.so.1 -shared \$(OPTIM)"
;; ;;
@ -3180,7 +3178,7 @@ echo "${ECHO_T}yes" >&6
OSF1* | Linux | GNU) OSF1* | Linux | GNU)
echo "$as_me:$LINENO: result: yes" >&5 echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6 echo "${ECHO_T}yes" >&6
LIBMXML="libmxml.so.1.1" LIBMXML="libmxml.so.1.2"
DSO="\$(CC)" DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-rpath,\$(libdir) -shared \$(OPTIM)" DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-rpath,\$(libdir) -shared \$(OPTIM)"
LDFLAGS="$LDFLAGS -Wl,-rpath,\$(libdir)" LDFLAGS="$LDFLAGS -Wl,-rpath,\$(libdir)"
@ -3189,7 +3187,7 @@ echo "${ECHO_T}yes" >&6
*BSD*) *BSD*)
echo "$as_me:$LINENO: result: yes" >&5 echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6 echo "${ECHO_T}yes" >&6
LIBMXML="libmxml.so.1.1" LIBMXML="libmxml.so.1.2"
DSO="\$(CC)" DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-R\$(libdir) -shared \$(OPTIM)" DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-R\$(libdir) -shared \$(OPTIM)"
LDFLAGS="$LDFLAGS -Wl,-R\$(libdir)" LDFLAGS="$LDFLAGS -Wl,-R\$(libdir)"
@ -3225,6 +3223,10 @@ fi
if test -n "$GCC"; then if test -n "$GCC"; then
CFLAGS="-Wall $CFLAGS" CFLAGS="-Wall $CFLAGS"
if test "x$OPTIM" = x; then
OPTIM="-Os -g"
fi
if test "x$use_ansi" = xyes; then if test "x$use_ansi" = xyes; then
CFLAGS="-ansi -pedantic $CFLAGS" CFLAGS="-ansi -pedantic $CFLAGS"
fi fi
@ -3236,6 +3238,11 @@ else
case $uname in case $uname in
HP-UX*) HP-UX*)
CFLAGS="-Ae $CFLAGS" CFLAGS="-Ae $CFLAGS"
if test "x$OPTIM" = x; then
OPTIM="-O2"
fi
OPTIM="+DAportable $OPTIM" OPTIM="+DAportable $OPTIM"
if test $PICFLAG = 1; then if test $PICFLAG = 1; then
@ -3244,10 +3251,20 @@ else
;; ;;
UNIX_SVR* | SunOS*) UNIX_SVR* | SunOS*)
if test "x$OPTIM" = x; then
OPTIM="-O2"
fi
if test $PICFLAG = 1; then if test $PICFLAG = 1; then
OPTIM="-KPIC $OPTIM" OPTIM="-KPIC $OPTIM"
fi fi
;; ;;
*)
if test "x$OPTIM" = x; then
OPTIM="-O2"
fi
;;
esac esac
fi fi

@ -23,7 +23,7 @@ dnl Set the name of the config header file...
AC_CONFIG_HEADER(config.h) AC_CONFIG_HEADER(config.h)
dnl Version number... dnl Version number...
VERSION=2.2.3 VERSION=2.3
AC_SUBST(VERSION) AC_SUBST(VERSION)
AC_DEFINE_UNQUOTED(MXML_VERSION, "Mini-XML v$VERSION") AC_DEFINE_UNQUOTED(MXML_VERSION, "Mini-XML v$VERSION")
@ -33,7 +33,7 @@ CFLAGS="${CFLAGS:=}"
CXXFLAGS="${CXXFLAGS:=}" CXXFLAGS="${CXXFLAGS:=}"
LDFLAGS="${LDFLAGS:=}" LDFLAGS="${LDFLAGS:=}"
AC_SUBST(LDFLAGS) AC_SUBST(LDFLAGS)
OPTIM="-O" OPTIM=""
AC_SUBST(OPTIM) AC_SUBST(OPTIM)
AC_ARG_WITH(ansi, [ --with-ansi set full ANSI C mode, default=no], AC_ARG_WITH(ansi, [ --with-ansi set full ANSI C mode, default=no],
@ -43,8 +43,6 @@ AC_ARG_WITH(ansi, [ --with-ansi set full ANSI C mode, default=no],
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging, default=no], AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging, default=no],
if eval "test x$enable_debug = xyes"; then if eval "test x$enable_debug = xyes"; then
OPTIM="-g" OPTIM="-g"
else
LDFLAGS="$LDFLAGS -s"
fi) fi)
AC_ARG_WITH(docdir, [ --with-docdir set directory for documentation, default=${prefix}/share/doc/mxml], AC_ARG_WITH(docdir, [ --with-docdir set directory for documentation, default=${prefix}/share/doc/mxml],
@ -122,7 +120,7 @@ if test x$enable_shared = xyes; then
case "$uname" in case "$uname" in
SunOS* | UNIX_S*) SunOS* | UNIX_S*)
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
LIBMXML="libmxml.so.1.1" LIBMXML="libmxml.so.1.2"
DSO="\$(CC)" DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-h,libmxml.so.1 -G -R\$(libdir) \$(OPTIM)" DSOFLAGS="$DSOFLAGS -Wl,-h,libmxml.so.1 -G -R\$(libdir) \$(OPTIM)"
LDFLAGS="$LDFLAGS -R\$(libdir)" LDFLAGS="$LDFLAGS -R\$(libdir)"
@ -130,7 +128,7 @@ if test x$enable_shared = xyes; then
HP-UX*) HP-UX*)
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
LIBMXML="libmxml.sl.1" LIBMXML="libmxml.sl.2"
DSO="ld" DSO="ld"
DSOFLAGS="$DSOFLAGS -b -z +h libmxml.sl.1 +s +b \$(libdir)" DSOFLAGS="$DSOFLAGS -b -z +h libmxml.sl.1 +s +b \$(libdir)"
LDFLAGS="$LDFLAGS -Wl,+s,+b,\$(libdir)" LDFLAGS="$LDFLAGS -Wl,+s,+b,\$(libdir)"
@ -138,14 +136,14 @@ if test x$enable_shared = xyes; then
IRIX) IRIX)
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
LIBMXML="libmxml.so.1.1" LIBMXML="libmxml.so.1.2"
DSO="\$(CC)" DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-rpath,\$(libdir),-set_version,sgi1.0,-soname,libmxml.so.1 -shared \$(OPTIM)" DSOFLAGS="$DSOFLAGS -Wl,-rpath,\$(libdir),-set_version,sgi1.0,-soname,libmxml.so.1 -shared \$(OPTIM)"
;; ;;
OSF1* | Linux | GNU) OSF1* | Linux | GNU)
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
LIBMXML="libmxml.so.1.1" LIBMXML="libmxml.so.1.2"
DSO="\$(CC)" DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-rpath,\$(libdir) -shared \$(OPTIM)" DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-rpath,\$(libdir) -shared \$(OPTIM)"
LDFLAGS="$LDFLAGS -Wl,-rpath,\$(libdir)" LDFLAGS="$LDFLAGS -Wl,-rpath,\$(libdir)"
@ -153,7 +151,7 @@ if test x$enable_shared = xyes; then
*BSD*) *BSD*)
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
LIBMXML="libmxml.so.1.1" LIBMXML="libmxml.so.1.2"
DSO="\$(CC)" DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-R\$(libdir) -shared \$(OPTIM)" DSOFLAGS="$DSOFLAGS -Wl,-soname,libmxml.so.1,-R\$(libdir) -shared \$(OPTIM)"
LDFLAGS="$LDFLAGS -Wl,-R\$(libdir)" LDFLAGS="$LDFLAGS -Wl,-R\$(libdir)"
@ -187,6 +185,10 @@ dnl Add -Wall for GCC...
if test -n "$GCC"; then if test -n "$GCC"; then
CFLAGS="-Wall $CFLAGS" CFLAGS="-Wall $CFLAGS"
if test "x$OPTIM" = x; then
OPTIM="-Os -g"
fi
if test "x$use_ansi" = xyes; then if test "x$use_ansi" = xyes; then
CFLAGS="-ansi -pedantic $CFLAGS" CFLAGS="-ansi -pedantic $CFLAGS"
fi fi
@ -198,6 +200,11 @@ else
case $uname in case $uname in
HP-UX*) HP-UX*)
CFLAGS="-Ae $CFLAGS" CFLAGS="-Ae $CFLAGS"
if test "x$OPTIM" = x; then
OPTIM="-O2"
fi
OPTIM="+DAportable $OPTIM" OPTIM="+DAportable $OPTIM"
if test $PICFLAG = 1; then if test $PICFLAG = 1; then
@ -206,10 +213,20 @@ else
;; ;;
UNIX_SVR* | SunOS*) UNIX_SVR* | SunOS*)
if test "x$OPTIM" = x; then
OPTIM="-O2"
fi
if test $PICFLAG = 1; then if test $PICFLAG = 1; then
OPTIM="-KPIC $OPTIM" OPTIM="-KPIC $OPTIM"
fi fi
;; ;;
*)
if test "x$OPTIM" = x; then
OPTIM="-O2"
fi
;;
esac esac
fi fi

@ -2,12 +2,13 @@
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head> <head>
<title>Documentation</title> <title>Documentation</title>
<meta name='creator' content='Mini-XML v2.2.3'/> <meta name='creator' content='Mini-XML v2.3'/>
<style><!-- <style><!--
h1, h2, h3, p { font-family: sans-serif; text-align: justify; } h1, h2, h3, p { font-family: sans-serif; text-align: justify; }
tt, pre a:link, pre a:visited, tt a:link, tt a:visited { font-weight: bold; color: #7f0000; } tt, pre a:link, pre a:visited, tt a:link, tt a:visited { font-weight: bold; color: #7f0000; }
pre { font-weight: bold; color: #7f0000; margin-left: 2em; } pre { font-weight: bold; color: #7f0000; margin-left: 2em; }
span.info { font-weight: bold; padding: 2; color: #ffffff; background: #000000; float: right; } span.info { font-weight: bold; font-style: italic; color: #ffffff; background: #000000; }
h3 span.info { float: right; }
--></style> --></style>
</head> </head>
<body> <body>
@ -33,9 +34,9 @@
<p class='table'><table align='center' border='1' width='80%'> <p class='table'><table align='center' border='1' width='80%'>
<thead><tr><th>Name</th><th>Description</th></tr></thead> <thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody> <tbody>
<tr><td><tt>MXML_CUSTOM</tt></td><td>Custom data</td></tr> <tr><td><tt>MXML_CUSTOM</tt> <span class='info'>&nbsp;Mini-XML 2.1&nbsp;</span></td><td>Custom data </td></tr>
<tr><td><tt>MXML_ELEMENT</tt> </td><td>XML element with attributes</td></tr> <tr><td><tt>MXML_ELEMENT</tt> </td><td>XML element with attributes</td></tr>
<tr><td><tt>MXML_IGNORE</tt></td><td>Ignore/throw away node</td></tr> <tr><td><tt>MXML_IGNORE</tt> <span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span></td><td>Ignore/throw away node </td></tr>
<tr><td><tt>MXML_INTEGER</tt> </td><td>Integer value</td></tr> <tr><td><tt>MXML_INTEGER</tt> </td><td>Integer value</td></tr>
<tr><td><tt>MXML_OPAQUE</tt> </td><td>Opaque string</td></tr> <tr><td><tt>MXML_OPAQUE</tt> </td><td>Opaque string</td></tr>
<tr><td><tt>MXML_REAL</tt> </td><td>Real value</td></tr> <tr><td><tt>MXML_REAL</tt> </td><td>Real value</td></tr>
@ -61,8 +62,8 @@
<li><a href='#mxmlLoadFd'><tt>mxmlLoadFd()</tt></a> </li> <li><a href='#mxmlLoadFd'><tt>mxmlLoadFd()</tt></a> </li>
<li><a href='#mxmlLoadFile'><tt>mxmlLoadFile()</tt></a> </li> <li><a href='#mxmlLoadFile'><tt>mxmlLoadFile()</tt></a> </li>
<li><a href='#mxmlLoadString'><tt>mxmlLoadString()</tt></a> </li> <li><a href='#mxmlLoadString'><tt>mxmlLoadString()</tt></a> </li>
<li><a href='#mxmlNewCDATA'><tt>mxmlNewCDATA()</tt></a></li> <li><a href='#mxmlNewCDATA'><tt>mxmlNewCDATA()</tt></a> <span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span></li>
<li><a href='#mxmlNewCustom'><tt>mxmlNewCustom()</tt></a></li> <li><a href='#mxmlNewCustom'><tt>mxmlNewCustom()</tt></a> <span class='info'>&nbsp;Mini-XML 2.1&nbsp;</span></li>
<li><a href='#mxmlNewElement'><tt>mxmlNewElement()</tt></a> </li> <li><a href='#mxmlNewElement'><tt>mxmlNewElement()</tt></a> </li>
<li><a href='#mxmlNewInteger'><tt>mxmlNewInteger()</tt></a> </li> <li><a href='#mxmlNewInteger'><tt>mxmlNewInteger()</tt></a> </li>
<li><a href='#mxmlNewOpaque'><tt>mxmlNewOpaque()</tt></a> </li> <li><a href='#mxmlNewOpaque'><tt>mxmlNewOpaque()</tt></a> </li>
@ -74,8 +75,8 @@
<li><a href='#mxmlSaveFd'><tt>mxmlSaveFd()</tt></a> </li> <li><a href='#mxmlSaveFd'><tt>mxmlSaveFd()</tt></a> </li>
<li><a href='#mxmlSaveFile'><tt>mxmlSaveFile()</tt></a> </li> <li><a href='#mxmlSaveFile'><tt>mxmlSaveFile()</tt></a> </li>
<li><a href='#mxmlSaveString'><tt>mxmlSaveString()</tt></a> </li> <li><a href='#mxmlSaveString'><tt>mxmlSaveString()</tt></a> </li>
<li><a href='#mxmlSetCDATA'><tt>mxmlSetCDATA()</tt></a></li> <li><a href='#mxmlSetCDATA'><tt>mxmlSetCDATA()</tt></a> <span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span></li>
<li><a href='#mxmlSetCustom'><tt>mxmlSetCustom()</tt></a></li> <li><a href='#mxmlSetCustom'><tt>mxmlSetCustom()</tt></a> <span class='info'>&nbsp;Mini-XML 2.1&nbsp;</span></li>
<li><a href='#mxmlSetCustomHandlers'><tt>mxmlSetCustomHandlers()</tt></a> </li> <li><a href='#mxmlSetCustomHandlers'><tt>mxmlSetCustomHandlers()</tt></a> </li>
<li><a href='#mxmlSetElement'><tt>mxmlSetElement()</tt></a> </li> <li><a href='#mxmlSetElement'><tt>mxmlSetElement()</tt></a> </li>
<li><a href='#mxmlSetErrorCallback'><tt>mxmlSetErrorCallback()</tt></a> </li> <li><a href='#mxmlSetErrorCallback'><tt>mxmlSetErrorCallback()</tt></a> </li>
@ -519,7 +520,7 @@ mxmlLoadString(
<h4>Returns</h4> <h4>Returns</h4>
<p>First node or NULL if the string has errors.</p> <p>First node or NULL if the string has errors.</p>
<!-- NEW PAGE --> <!-- NEW PAGE -->
<h3><a name='mxmlNewCDATA'>mxmlNewCDATA()</a></h3> <h3><a name='mxmlNewCDATA'>mxmlNewCDATA()</a> <span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span></h3>
<hr noshade/> <hr noshade/>
<h4>Description</h4> <h4>Description</h4>
<p>Create a new CDATA node. <p>Create a new CDATA node.
@ -527,7 +528,9 @@ mxmlLoadString(
The new CDATA node is added to the end of the specified parent's child 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 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 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.</p> is copied into the new node. CDATA nodes use the MXML_ELEMENT type.
</p>
<h4>Syntax</h4> <h4>Syntax</h4>
<pre> <pre>
<a href='#mxml_node_t'>mxml_node_t</a> * <a href='#mxml_node_t'>mxml_node_t</a> *
@ -545,7 +548,7 @@ mxmlNewCDATA(
<h4>Returns</h4> <h4>Returns</h4>
<p>New node</p> <p>New node</p>
<!-- NEW PAGE --> <!-- NEW PAGE -->
<h3><a name='mxmlNewCustom'>mxmlNewCustom()</a></h3> <h3><a name='mxmlNewCustom'>mxmlNewCustom()</a> <span class='info'>&nbsp;Mini-XML 2.1&nbsp;</span></h3>
<hr noshade/> <hr noshade/>
<h4>Description</h4> <h4>Description</h4>
<p>Create a new custom data node. <p>Create a new custom data node.
@ -553,7 +556,9 @@ mxmlNewCDATA(
The new custom node is added to the end of the specified parent's child 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 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 element node has no parent. NULL can be passed when the data in the
node is not dynamically allocated or is separately managed.</p> node is not dynamically allocated or is separately managed.
</p>
<h4>Syntax</h4> <h4>Syntax</h4>
<pre> <pre>
<a href='#mxml_node_t'>mxml_node_t</a> * <a href='#mxml_node_t'>mxml_node_t</a> *
@ -872,12 +877,14 @@ mxmlSaveString(
<h4>Returns</h4> <h4>Returns</h4>
<p>Size of string</p> <p>Size of string</p>
<!-- NEW PAGE --> <!-- NEW PAGE -->
<h3><a name='mxmlSetCDATA'>mxmlSetCDATA()</a></h3> <h3><a name='mxmlSetCDATA'>mxmlSetCDATA()</a> <span class='info'>&nbsp;Mini-XML 2.3&nbsp;</span></h3>
<hr noshade/> <hr noshade/>
<h4>Description</h4> <h4>Description</h4>
<p>Set the element name of a CDATA node. <p>Set the element name of a CDATA node.
The node is not changed if it is not a CDATA element node.</p> The node is not changed if it is not a CDATA element node.
</p>
<h4>Syntax</h4> <h4>Syntax</h4>
<pre> <pre>
int int
@ -895,12 +902,14 @@ mxmlSetCDATA(
<h4>Returns</h4> <h4>Returns</h4>
<p>0 on success, -1 on failure</p> <p>0 on success, -1 on failure</p>
<!-- NEW PAGE --> <!-- NEW PAGE -->
<h3><a name='mxmlSetCustom'>mxmlSetCustom()</a></h3> <h3><a name='mxmlSetCustom'>mxmlSetCustom()</a> <span class='info'>&nbsp;Mini-XML 2.1&nbsp;</span></h3>
<hr noshade/> <hr noshade/>
<h4>Description</h4> <h4>Description</h4>
<p>Set the data and destructor of a custom data node. <p>Set the data and destructor of a custom data node.
The node is not changed if it is not a custom node.</p> The node is not changed if it is not a custom node.
</p>
<h4>Syntax</h4> <h4>Syntax</h4>
<pre> <pre>
int int
@ -1160,11 +1169,11 @@ mxmlWalkPrev(
<h2><a name='_structures'>Structures</a></h2> <h2><a name='_structures'>Structures</a></h2>
<ul> <ul>
<li><a href='#mxml_attr_s'><tt>mxml_attr_s</tt></a> </li> <li><a href='#mxml_attr_s'><tt>mxml_attr_s</tt></a> </li>
<li><a href='#mxml_custom_s'><tt>mxml_custom_s</tt></a></li> <li><a href='#mxml_custom_s'><tt>mxml_custom_s</tt></a> <span class='info'>&nbsp;Mini-XML 2.1&nbsp;</span></li>
<li><a href='#mxml_element_s'><tt>mxml_element_s</tt></a> </li>
<li><a href='#mxml_index_s'><tt>mxml_index_s</tt></a> </li> <li><a href='#mxml_index_s'><tt>mxml_index_s</tt></a> </li>
<li><a href='#mxml_node_s'><tt>mxml_node_s</tt></a> </li> <li><a href='#mxml_node_s'><tt>mxml_node_s</tt></a> </li>
<li><a href='#mxml_text_s'><tt>mxml_text_s</tt></a> </li> <li><a href='#mxml_text_s'><tt>mxml_text_s</tt></a> </li>
<li><a href='#mxml_value_s'><tt>mxml_value_s</tt></a></li>
</ul> </ul>
<!-- NEW PAGE --> <!-- NEW PAGE -->
<h3><a name='mxml_attr_s'>mxml_attr_s</a> </h3> <h3><a name='mxml_attr_s'>mxml_attr_s</a> </h3>
@ -1187,7 +1196,7 @@ struct mxml_attr_s
<tr><td><tt>value</tt> </td><td>Attribute value</td></tr> <tr><td><tt>value</tt> </td><td>Attribute value</td></tr>
</tbody></table></p> </tbody></table></p>
<!-- NEW PAGE --> <!-- NEW PAGE -->
<h3><a name='mxml_custom_s'>mxml_custom_s</a></h3> <h3><a name='mxml_custom_s'>mxml_custom_s</a> <span class='info'>&nbsp;Mini-XML 2.1&nbsp;</span></h3>
<hr noshade/> <hr noshade/>
<h4>Description</h4> <h4>Description</h4>
<p>An XML custom value. </p> <p>An XML custom value. </p>
@ -1205,6 +1214,28 @@ struct mxml_custom_s
<tr><td><tt>data</tt> </td><td>Pointer to (allocated) custom data</td></tr> <tr><td><tt>data</tt> </td><td>Pointer to (allocated) custom data</td></tr>
</tbody></table></p> </tbody></table></p>
<!-- NEW PAGE --> <!-- NEW PAGE -->
<h3><a name='mxml_element_s'>mxml_element_s</a> </h3>
<hr noshade/>
<h4>Description</h4>
<p>An XML element value.</p>
<h4>Definition</h4>
<pre>
struct mxml_element_s
{
<a href='#mxml_attr_t'>mxml_attr_t</a> * attrs;
char * name;
int num_attrs;
};
</pre>
<h4>Members</h4>
<p class='table'><table align='center' border='1' width='80%'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>attrs</tt> </td><td>Attributes</td></tr>
<tr><td><tt>name</tt> </td><td>Name of element</td></tr>
<tr><td><tt>num_attrs</tt> </td><td>Number of attributes</td></tr>
</tbody></table></p>
<!-- NEW PAGE -->
<h3><a name='mxml_index_s'>mxml_index_s</a> </h3> <h3><a name='mxml_index_s'>mxml_index_s</a> </h3>
<hr noshade/> <hr noshade/>
<h4>Description</h4> <h4>Description</h4>
@ -1281,34 +1312,12 @@ struct mxml_text_s
<tr><td><tt>whitespace</tt> </td><td>Leading whitespace?</td></tr> <tr><td><tt>whitespace</tt> </td><td>Leading whitespace?</td></tr>
</tbody></table></p> </tbody></table></p>
<!-- NEW PAGE --> <!-- NEW PAGE -->
<h3><a name='mxml_value_s'>mxml_value_s</a></h3>
<hr noshade/>
<h4>Description</h4>
<p>An XML element value.</p>
<h4>Definition</h4>
<pre>
struct mxml_value_s
{
<a href='#mxml_attr_t'>mxml_attr_t</a> * attrs;
char * name;
int num_attrs;
};
</pre>
<h4>Members</h4>
<p class='table'><table align='center' border='1' width='80%'>
<thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody>
<tr><td><tt>attrs</tt></td><td>Attributes</td></tr>
<tr><td><tt>name</tt></td><td>Name of element</td></tr>
<tr><td><tt>num_attrs</tt></td><td>Number of attributes</td></tr>
</tbody></table></p>
<!-- NEW PAGE -->
<h2><a name='_types'>Types</a></h2> <h2><a name='_types'>Types</a></h2>
<ul> <ul>
<li><a href='#mxml_attr_t'><tt>mxml_attr_t</tt></a> </li> <li><a href='#mxml_attr_t'><tt>mxml_attr_t</tt></a> </li>
<li><a href='#mxml_custom_load_cb_t'><tt>mxml_custom_load_cb_t</tt></a> </li> <li><a href='#mxml_custom_load_cb_t'><tt>mxml_custom_load_cb_t</tt></a> </li>
<li><a href='#mxml_custom_save_cb_t'><tt>mxml_custom_save_cb_t</tt></a> </li> <li><a href='#mxml_custom_save_cb_t'><tt>mxml_custom_save_cb_t</tt></a> </li>
<li><a href='#mxml_custom_t'><tt>mxml_custom_t</tt></a></li> <li><a href='#mxml_custom_t'><tt>mxml_custom_t</tt></a> <span class='info'>&nbsp;Mini-XML 2.1&nbsp;</span></li>
<li><a href='#mxml_element_t'><tt>mxml_element_t</tt></a> </li> <li><a href='#mxml_element_t'><tt>mxml_element_t</tt></a> </li>
<li><a href='#mxml_index_t'><tt>mxml_index_t</tt></a> </li> <li><a href='#mxml_index_t'><tt>mxml_index_t</tt></a> </li>
<li><a href='#mxml_node_t'><tt>mxml_node_t</tt></a> </li> <li><a href='#mxml_node_t'><tt>mxml_node_t</tt></a> </li>
@ -1343,7 +1352,7 @@ typedef int (*mxml_custom_load_cb_t)(<a href='#mxml_node_t'>mxml_node_t</a> *, c
typedef char * (*mxml_custom_save_cb_t)(<a href='#mxml_node_t'>mxml_node_t</a> *); typedef char * (*mxml_custom_save_cb_t)(<a href='#mxml_node_t'>mxml_node_t</a> *);
</pre> </pre>
<!-- NEW PAGE --> <!-- NEW PAGE -->
<h3><a name='mxml_custom_t'>mxml_custom_t</a></h3> <h3><a name='mxml_custom_t'>mxml_custom_t</a> <span class='info'>&nbsp;Mini-XML 2.1&nbsp;</span></h3>
<hr noshade/> <hr noshade/>
<h4>Description</h4> <h4>Description</h4>
<p>An XML custom value. </p> <p>An XML custom value. </p>
@ -1358,7 +1367,7 @@ typedef struct <a href='#mxml_custom_s'>mxml_custom_s</a> mxml_custom_t;
<p>An XML element value.</p> <p>An XML element value.</p>
<h4>Definition</h4> <h4>Definition</h4>
<pre> <pre>
typedef struct <a href='#mxml_value_s'>mxml_value_s</a> mxml_element_t; typedef struct <a href='#mxml_element_s'>mxml_element_s</a> mxml_element_t;
</pre> </pre>
<!-- NEW PAGE --> <!-- NEW PAGE -->
<h3><a name='mxml_index_t'>mxml_index_t</a> </h3> <h3><a name='mxml_index_t'>mxml_index_t</a> </h3>
@ -1422,7 +1431,7 @@ union mxml_value_u
<p class='table'><table align='center' border='1' width='80%'> <p class='table'><table align='center' border='1' width='80%'>
<thead><tr><th>Name</th><th>Description</th></tr></thead> <thead><tr><th>Name</th><th>Description</th></tr></thead>
<tbody> <tbody>
<tr><td><tt>custom</tt></td><td>Custom data</td></tr> <tr><td><tt>custom</tt> <span class='info'>&nbsp;Mini-XML 2.1&nbsp;</span></td><td>Custom data </td></tr>
<tr><td><tt>element</tt> </td><td>Element</td></tr> <tr><td><tt>element</tt> </td><td>Element</td></tr>
<tr><td><tt>integer</tt> </td><td>Integer number</td></tr> <tr><td><tt>integer</tt> </td><td>Integer number</td></tr>
<tr><td><tt>opaque</tt> </td><td>Opaque string</td></tr> <tr><td><tt>opaque</tt> </td><td>Opaque string</td></tr>

@ -3,10 +3,13 @@
<h1 align='right'><a name='RELNOTES'>B - Release Notes</a></h1> <h1 align='right'><a name='RELNOTES'>B - Release Notes</a></h1>
<h2>Changes in Mini-XML 2.2.3</h2> <h2>Changes in Mini-XML 2.3</h2>
<ul> <ul>
<li>The mxmldoc program now supports "@since version@"
and "@deprecated@" comments.</li>
<li>Fixed function and enumeraion type bugs in <li>Fixed function and enumeraion type bugs in
mxmldoc.</li> mxmldoc.</li>

@ -19,6 +19,8 @@
* *
* mxmlAdd() - Add a node to a tree. * mxmlAdd() - Add a node to a tree.
* mxmlDelete() - Delete a node and all of its children. * mxmlDelete() - Delete a node and all of its children.
* mxmlNewCDATA() - Create a new CDATA node.
* mxmlNewCustom() - Create a new custom data node.
* mxmlNewElement() - Create a new element node. * mxmlNewElement() - Create a new element node.
* mxmlNewInteger() - Create a new integer node. * mxmlNewInteger() - Create a new integer node.
* mxmlNewOpaque() - Create a new opaque string. * mxmlNewOpaque() - Create a new opaque string.
@ -280,6 +282,8 @@ mxmlDelete(mxml_node_t *node) /* I - Node to delete */
* list. The constant MXML_NO_PARENT can be used to specify that the new * 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 * 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. * is copied into the new node. CDATA nodes use the MXML_ELEMENT type.
*
* @since Mini-XML 2.3@
*/ */
mxml_node_t * /* O - New node */ mxml_node_t * /* O - New node */
@ -306,7 +310,7 @@ mxmlNewCDATA(mxml_node_t *parent, /* I - Parent node or MXML_NO_PARENT */
*/ */
if ((node = mxml_new(parent, MXML_ELEMENT)) != NULL) if ((node = mxml_new(parent, MXML_ELEMENT)) != NULL)
node->value.element.name = mxml_strdupf("![CDATA[%s]]", data); node->value.element.name = _mxml_strdupf("![CDATA[%s]]", data);
return (node); return (node);
} }
@ -319,6 +323,8 @@ mxmlNewCDATA(mxml_node_t *parent, /* I - Parent node or MXML_NO_PARENT */
* list. The constant MXML_NO_PARENT can be used to specify that the new * 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 * element node has no parent. NULL can be passed when the data in the
* node is not dynamically allocated or is separately managed. * node is not dynamically allocated or is separately managed.
*
* @since Mini-XML 2.1@
*/ */
mxml_node_t * /* O - New node */ mxml_node_t * /* O - New node */
@ -571,7 +577,7 @@ mxmlNewTextf(mxml_node_t *parent, /* I - Parent node or MXML_NO_PARENT */
va_start(ap, format); va_start(ap, format);
node->value.text.whitespace = whitespace; node->value.text.whitespace = whitespace;
node->value.text.string = mxml_vstrdupf(format, ap); node->value.text.string = _mxml_vstrdupf(format, ap);
va_end(ap); va_end(ap);
} }

@ -39,6 +39,8 @@
* 'mxmlSetCustom()' - Set the data and destructor of a custom data node. * 'mxmlSetCustom()' - Set the data and destructor of a custom data node.
* *
* The node is not changed if it is not a custom node. * The node is not changed if it is not a custom node.
*
* @since Mini-XML 2.1@
*/ */
int /* O - 0 on success, -1 on failure */ int /* O - 0 on success, -1 on failure */
@ -72,6 +74,8 @@ mxmlSetCustom(mxml_node_t *node, /* I - Node to set */
* 'mxmlSetCDATA()' - Set the element name of a CDATA node. * 'mxmlSetCDATA()' - Set the element name of a CDATA node.
* *
* The node is not changed if it is not a CDATA element node. * The node is not changed if it is not a CDATA element node.
*
* @since Mini-XML 2.3@
*/ */
int /* O - 0 on success, -1 on failure */ int /* O - 0 on success, -1 on failure */
@ -93,7 +97,7 @@ mxmlSetCDATA(mxml_node_t *node, /* I - Node to set */
if (node->value.element.name) if (node->value.element.name)
free(node->value.element.name); free(node->value.element.name);
node->value.element.name = mxml_strdupf("![CDATA[%s]]", data); node->value.element.name = _mxml_strdupf("![CDATA[%s]]", data);
return (0); return (0);
} }
@ -277,7 +281,7 @@ mxmlSetTextf(mxml_node_t *node, /* I - Node to set */
va_start(ap, format); va_start(ap, format);
node->value.text.whitespace = whitespace; node->value.text.whitespace = whitespace;
node->value.text.string = mxml_strdupf(format, ap); node->value.text.string = _mxml_strdupf(format, ap);
va_end(ap); va_end(ap);

@ -17,10 +17,10 @@
* *
* Contents: * Contents:
* *
* mxml_strdup() - Duplicate a string. * _mxml_strdup() - Duplicate a string.
* mxml_strdupf() - Format and duplicate a string. * _mxml_strdupf() - Format and duplicate a string.
* mxml_vstrdupf() - Format and duplicate a string. * _mxml_vstrdupf() - Format and duplicate a string.
* mxml_vsnprintf() - Format a string into a fixed size buffer. * _mxml_vsnprintf() - Format a string into a fixed size buffer.
*/ */
/* /*
@ -31,12 +31,12 @@
/* /*
* 'mxml_strdup()' - Duplicate a string. * '_mxml_strdup()' - Duplicate a string.
*/ */
#ifndef HAVE_STRDUP #ifndef HAVE_STRDUP
char * /* O - New string pointer */ char * /* O - New string pointer */
mxml_strdup(const char *s) /* I - String to duplicate */ _mxml_strdup(const char *s) /* I - String to duplicate */
{ {
char *t; /* New string pointer */ char *t; /* New string pointer */
@ -53,11 +53,11 @@ mxml_strdup(const char *s) /* I - String to duplicate */
/* /*
* 'mxml_strdupf()' - Format and duplicate a string. * '_mxml_strdupf()' - Format and duplicate a string.
*/ */
char * /* O - New string pointer */ char * /* O - New string pointer */
mxml_strdupf(const char *format, /* I - Printf-style format string */ _mxml_strdupf(const char *format, /* I - Printf-style format string */
...) /* I - Additional arguments as needed */ ...) /* I - Additional arguments as needed */
{ {
va_list ap; /* Pointer to additional arguments */ va_list ap; /* Pointer to additional arguments */
@ -70,7 +70,7 @@ mxml_strdupf(const char *format, /* I - Printf-style format string */
*/ */
va_start(ap, format); va_start(ap, format);
s = mxml_vstrdupf(format, ap); s = _mxml_vstrdupf(format, ap);
va_end(ap); va_end(ap);
return (s); return (s);
@ -78,11 +78,11 @@ mxml_strdupf(const char *format, /* I - Printf-style format string */
/* /*
* 'mxml_vstrdupf()' - Format and duplicate a string. * '_mxml_vstrdupf()' - Format and duplicate a string.
*/ */
char * /* O - New string pointer */ char * /* O - New string pointer */
mxml_vstrdupf(const char *format, /* I - Printf-style format string */ _mxml_vstrdupf(const char *format, /* I - Printf-style format string */
va_list ap) /* I - Pointer to additional arguments */ va_list ap) /* I - Pointer to additional arguments */
{ {
int bytes; /* Number of bytes required */ int bytes; /* Number of bytes required */
@ -124,11 +124,11 @@ mxml_vstrdupf(const char *format, /* I - Printf-style format string */
#ifndef HAVE_VSNPRINTF #ifndef HAVE_VSNPRINTF
/* /*
* 'mxml_vsnprintf()' - Format a string into a fixed size buffer. * '_mxml_vsnprintf()' - Format a string into a fixed size buffer.
*/ */
int /* O - Number of bytes formatted */ int /* O - Number of bytes formatted */
mxml_vsnprintf(char *buffer, /* O - Output buffer */ _mxml_vsnprintf(char *buffer, /* O - Output buffer */
size_t bufsize, /* O - Size of output buffer */ size_t bufsize, /* O - Size of output buffer */
const char *format, /* I - Printf-style format string */ const char *format, /* I - Printf-style format string */
va_list ap) /* I - Pointer to additional arguments */ va_list ap) /* I - Pointer to additional arguments */
@ -180,7 +180,10 @@ mxml_vsnprintf(char *buffer, /* O - Output buffer */
if (*format == '*') if (*format == '*')
{ {
// Get width from argument... /*
* Get width from argument...
*/
format ++; format ++;
width = va_arg(ap, int); width = va_arg(ap, int);
@ -209,7 +212,10 @@ mxml_vsnprintf(char *buffer, /* O - Output buffer */
if (*format == '*') if (*format == '*')
{ {
// Get precision from argument... /*
* Get precision from argument...
*/
format ++; format ++;
prec = va_arg(ap, int); prec = va_arg(ap, int);

@ -74,13 +74,13 @@
typedef enum mxml_type_e /**** The XML node type. ****/ typedef enum mxml_type_e /**** The XML node type. ****/
{ {
MXML_IGNORE = -1, /* Ignore/throw away node */ MXML_IGNORE = -1, /* Ignore/throw away node @since Mini-XML 2.3@ */
MXML_ELEMENT, /* XML element with attributes */ MXML_ELEMENT, /* XML element with attributes */
MXML_INTEGER, /* Integer value */ MXML_INTEGER, /* Integer value */
MXML_OPAQUE, /* Opaque string */ MXML_OPAQUE, /* Opaque string */
MXML_REAL, /* Real value */ MXML_REAL, /* Real value */
MXML_TEXT, /* Text fragment */ MXML_TEXT, /* Text fragment */
MXML_CUSTOM /* Custom data */ MXML_CUSTOM /* Custom data @since Mini-XML 2.1@ */
} mxml_type_t; } mxml_type_t;
typedef struct mxml_attr_s /**** An XML element attribute value. ****/ typedef struct mxml_attr_s /**** An XML element attribute value. ****/
@ -89,7 +89,7 @@ typedef struct mxml_attr_s /**** An XML element attribute value. ****/
char *value; /* Attribute value */ char *value; /* Attribute value */
} mxml_attr_t; } mxml_attr_t;
typedef struct mxml_value_s /**** An XML element value. ****/ typedef struct mxml_element_s /**** An XML element value. ****/
{ {
char *name; /* Name of element */ char *name; /* Name of element */
int num_attrs; /* Number of attributes */ int num_attrs; /* Number of attributes */
@ -102,7 +102,7 @@ typedef struct mxml_text_s /**** An XML text value. ****/
char *string; /* Fragment string */ char *string; /* Fragment string */
} mxml_text_t; } mxml_text_t;
typedef struct mxml_custom_s /**** An XML custom value. ****/ typedef struct mxml_custom_s /**** An XML custom value. @since Mini-XML 2.1@ ****/
{ {
void *data; /* Pointer to (allocated) custom data */ void *data; /* Pointer to (allocated) custom data */
void (*destroy)(void *); void (*destroy)(void *);
@ -116,7 +116,7 @@ typedef union mxml_value_u /**** An XML node value. ****/
char *opaque; /* Opaque string */ char *opaque; /* Opaque string */
double real; /* Real number */ double real; /* Real number */
mxml_text_t text; /* Text fragment */ mxml_text_t text; /* Text fragment */
mxml_custom_t custom; /* Custom data */ mxml_custom_t custom; /* Custom data @since Mini-XML 2.1@ */
} mxml_value_t; } mxml_value_t;
typedef struct mxml_node_s /**** An XML node. ****/ typedef struct mxml_node_s /**** An XML node. ****/
@ -235,7 +235,7 @@ extern mxml_node_t *mxmlWalkPrev(mxml_node_t *node, mxml_node_t *top,
/* /*
* Private functions... * Semi-private functions...
*/ */
extern void mxml_error(const char *format, ...); extern void mxml_error(const char *format, ...);

@ -325,7 +325,9 @@ child nodes of the specified type.</description>
The new CDATA node is added to the end of the specified parent's child 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 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 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.</description> is copied into the new node. CDATA nodes use the MXML_ELEMENT type.
@since Mini-XML 2.3@</description>
<argument name="parent" direction="I"> <argument name="parent" direction="I">
<type>mxml_node_t *</type> <type>mxml_node_t *</type>
<description>Parent node or MXML_NO_PARENT</description> <description>Parent node or MXML_NO_PARENT</description>
@ -345,7 +347,9 @@ is copied into the new node. CDATA nodes use the MXML_ELEMENT type.</description
The new custom node is added to the end of the specified parent's child 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 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 element node has no parent. NULL can be passed when the data in the
node is not dynamically allocated or is separately managed.</description> node is not dynamically allocated or is separately managed.
@since Mini-XML 2.1@</description>
<argument name="parent" direction="I"> <argument name="parent" direction="I">
<type>mxml_node_t *</type> <type>mxml_node_t *</type>
<description>Parent node or MXML_NO_PARENT</description> <description>Parent node or MXML_NO_PARENT</description>
@ -596,7 +600,9 @@ element tags.</description>
</returnvalue> </returnvalue>
<description>Set the element name of a CDATA node. <description>Set the element name of a CDATA node.
The node is not changed if it is not a CDATA element node.</description> The node is not changed if it is not a CDATA element node.
@since Mini-XML 2.3@</description>
<argument name="node" direction="I"> <argument name="node" direction="I">
<type>mxml_node_t *</type> <type>mxml_node_t *</type>
<description>Node to set</description> <description>Node to set</description>
@ -613,7 +619,9 @@ The node is not changed if it is not a CDATA element node.</description>
</returnvalue> </returnvalue>
<description>Set the data and destructor of a custom data node. <description>Set the data and destructor of a custom data node.
The node is not changed if it is not a custom node.</description> The node is not changed if it is not a custom node.
@since Mini-XML 2.1@</description>
<argument name="node" direction="I"> <argument name="node" direction="I">
<type>mxml_node_t *</type> <type>mxml_node_t *</type>
<description>Node to set</description> <description>Node to set</description>
@ -822,7 +830,7 @@ the walk to the node's children.</description>
<description>Custom data load callback function</description> <description>Custom data load callback function</description>
</typedef> </typedef>
<struct name="mxml_custom_s"> <struct name="mxml_custom_s">
<description>An XML custom value.</description> <description>An XML custom value. @since Mini-XML 2.1@</description>
<variable name="data"> <variable name="data">
<type>void *</type> <type>void *</type>
<description>Pointer to (allocated) custom data</description> <description>Pointer to (allocated) custom data</description>
@ -836,10 +844,25 @@ the walk to the node's children.</description>
</typedef> </typedef>
<typedef name="mxml_custom_t"> <typedef name="mxml_custom_t">
<type>struct mxml_custom_s</type> <type>struct mxml_custom_s</type>
<description>An XML custom value.</description> <description>An XML custom value. @since Mini-XML 2.1@</description>
</typedef> </typedef>
<struct name="mxml_element_s">
<description>An XML element value.</description>
<variable name="attrs">
<type>mxml_attr_t *</type>
<description>Attributes</description>
</variable>
<variable name="name">
<type>char *</type>
<description>Name of element</description>
</variable>
<variable name="num_attrs">
<type>int</type>
<description>Number of attributes</description>
</variable>
</struct>
<typedef name="mxml_element_t"> <typedef name="mxml_element_t">
<type>struct mxml_value_s</type> <type>struct mxml_element_s</type>
<description>An XML element value.</description> <description>An XML element value.</description>
</typedef> </typedef>
<struct name="mxml_index_s"> <struct name="mxml_index_s">
@ -922,13 +945,13 @@ the walk to the node's children.</description>
<enumeration name="mxml_type_e"> <enumeration name="mxml_type_e">
<description>The XML node type.</description> <description>The XML node type.</description>
<constant name="MXML_CUSTOM"> <constant name="MXML_CUSTOM">
<description>Custom data</description> <description>Custom data @since Mini-XML 2.1@</description>
</constant> </constant>
<constant name="MXML_ELEMENT"> <constant name="MXML_ELEMENT">
<description>XML element with attributes</description> <description>XML element with attributes</description>
</constant> </constant>
<constant name="MXML_IGNORE"> <constant name="MXML_IGNORE">
<description>Ignore/throw away node</description> <description>Ignore/throw away node @since Mini-XML 2.3@</description>
</constant> </constant>
<constant name="MXML_INTEGER"> <constant name="MXML_INTEGER">
<description>Integer value</description> <description>Integer value</description>
@ -943,21 +966,6 @@ the walk to the node's children.</description>
<description>Text fragment</description> <description>Text fragment</description>
</constant> </constant>
</enumeration> </enumeration>
<struct name="mxml_value_s">
<description>An XML element value.</description>
<variable name="attrs">
<type>mxml_attr_t *</type>
<description>Attributes</description>
</variable>
<variable name="name">
<type>char *</type>
<description>Name of element</description>
</variable>
<variable name="num_attrs">
<type>int</type>
<description>Number of attributes</description>
</variable>
</struct>
<typedef name="mxml_value_t"> <typedef name="mxml_value_t">
<type>union mxml_value_u</type> <type>union mxml_value_u</type>
<description>An XML node value.</description> <description>An XML node value.</description>
@ -966,7 +974,7 @@ the walk to the node's children.</description>
<description>An XML node value.</description> <description>An XML node value.</description>
<variable name="custom"> <variable name="custom">
<type>mxml_custom_t</type> <type>mxml_custom_t</type>
<description>Custom data</description> <description>Custom data @since Mini-XML 2.1@</description>
</variable> </variable>
<variable name="element"> <variable name="element">
<type>mxml_element_t</type> <type>mxml_element_t</type>

@ -494,7 +494,7 @@ get_comment_info(
for (ptr = strchr(text, '@'); ptr; ptr = strchr(ptr, '@')) for (ptr = strchr(text, '@'); ptr; ptr = strchr(ptr, '@'))
{ {
if (!strncmp(ptr, "@deprecated@", 12)) if (!strncmp(ptr, "@deprecated@", 12))
return ("<span class='info'>DEPRECATED</span>"); return ("<span class='info'>&nbsp;DEPRECATED&nbsp;</span>");
else if (!strncmp(ptr, "@since ", 7)) else if (!strncmp(ptr, "@since ", 7))
{ {
strncpy(since, ptr + 7, sizeof(since) - 1); strncpy(since, ptr + 7, sizeof(since) - 1);
@ -503,7 +503,7 @@ get_comment_info(
if ((ptr = strchr(since, '@')) != NULL) if ((ptr = strchr(since, '@')) != NULL)
*ptr = '\0'; *ptr = '\0';
snprintf(info, sizeof(info), "<span class='info'>%s</span>", since); snprintf(info, sizeof(info), "<span class='info'>&nbsp;%s&nbsp;</span>", since);
return (info); return (info);
} }
} }
@ -2059,8 +2059,9 @@ write_description(
for (ptr = text; *ptr; ptr ++) for (ptr = text; *ptr; ptr ++)
{ {
if (*ptr == '@' && !strncmp(ptr + 1, "deprecated@", 11) && if (*ptr == '@' &&
!strncmp(ptr + 1, "since ", 6)) (!strncmp(ptr + 1, "deprecated@", 11) ||
!strncmp(ptr + 1, "since ", 6)))
{ {
ptr ++; ptr ++;
while (*ptr && *ptr != '@') while (*ptr && *ptr != '@')
@ -2162,7 +2163,8 @@ write_documentation(
"\th1, h2, h3, p { font-family: sans-serif; text-align: justify; }\n" "\th1, h2, h3, p { font-family: sans-serif; text-align: justify; }\n"
"\ttt, pre a:link, pre a:visited, tt a:link, tt a:visited { font-weight: bold; color: #7f0000; }\n" "\ttt, pre a:link, pre a:visited, tt a:link, tt a:visited { font-weight: bold; color: #7f0000; }\n"
"\tpre { font-weight: bold; color: #7f0000; margin-left: 2em; }\n" "\tpre { font-weight: bold; color: #7f0000; margin-left: 2em; }\n"
"\tspan.info { font-weight: bold; padding: 2; color: #ffffff; background: #000000; float: right; }\n" "\tspan.info { font-weight: bold; font-style: italic; color: #ffffff; background: #000000; }\n"
"\th3 span.info { float: right; }\n"
"\t--></style>\n" "\t--></style>\n"
"</head>\n" "</head>\n"
"<body>\n", title); "<body>\n", title);
@ -2222,7 +2224,9 @@ write_documentation(
MXML_NO_DESCEND)) MXML_NO_DESCEND))
{ {
name = mxmlElementGetAttr(scut, "name"); name = mxmlElementGetAttr(scut, "name");
printf("\t<li><a href='#%s'><tt>%s</tt></a></li>\n", name, name); printf("\t<li><a href='#%s'><tt>%s</tt></a> %s</li>\n", name, name,
get_comment_info(mxmlFindElement(scut, scut, "description",
NULL, NULL, MXML_DESCEND_FIRST)));
} }
puts("</ul>"); puts("</ul>");
@ -2237,8 +2241,8 @@ write_documentation(
description = mxmlFindElement(scut, scut, "description", NULL, description = mxmlFindElement(scut, scut, "description", NULL,
NULL, MXML_DESCEND_FIRST); NULL, MXML_DESCEND_FIRST);
printf("<!-- NEW PAGE -->\n" printf("<!-- NEW PAGE -->\n"
"<h3>%s<a name='%s'>%s</a></h3>\n" "<h3><a name='%s'>%s</a> %s</h3>\n"
"<hr noshade/>\n", get_comment_info(description), cname, cname); "<hr noshade/>\n", cname, cname, get_comment_info(description));
if (description) if (description)
{ {
@ -2352,8 +2356,8 @@ write_documentation(
description = mxmlFindElement(arg, arg, "description", NULL, description = mxmlFindElement(arg, arg, "description", NULL,
NULL, MXML_DESCEND_FIRST); NULL, MXML_DESCEND_FIRST);
printf("<tr><td>%s<tt>%s</tt></td><td>", get_comment_info(description), printf("<tr><td><tt>%s</tt> %s</td><td>",
mxmlElementGetAttr(arg, "name")); mxmlElementGetAttr(arg, "name"), get_comment_info(description));
write_description(description); write_description(description);
@ -2370,8 +2374,8 @@ write_documentation(
description = mxmlFindElement(function, function, "description", NULL, description = mxmlFindElement(function, function, "description", NULL,
NULL, MXML_DESCEND_FIRST); NULL, MXML_DESCEND_FIRST);
printf("<tr><td>%s<tt><a name='%s.%s'>%s()</a></tt></td><td>", printf("<tr><td><tt><a name='%s.%s'>%s()</a></tt> %s</td><td>",
get_comment_info(description), cname, name, name); cname, name, name, get_comment_info(description));
write_description(description); write_description(description);
@ -2409,7 +2413,9 @@ write_documentation(
MXML_NO_DESCEND)) MXML_NO_DESCEND))
{ {
name = mxmlElementGetAttr(scut, "name"); name = mxmlElementGetAttr(scut, "name");
printf("\t<li><a href='#%s'><tt>%s</tt></a></li>\n", name, name); printf("\t<li><a href='#%s'><tt>%s</tt></a> %s</li>\n", name, name,
get_comment_info(mxmlFindElement(scut, scut, "description",
NULL, NULL, MXML_DESCEND_FIRST)));
} }
puts("</ul>"); puts("</ul>");
@ -2424,8 +2430,8 @@ write_documentation(
description = mxmlFindElement(scut, scut, "description", NULL, description = mxmlFindElement(scut, scut, "description", NULL,
NULL, MXML_DESCEND_FIRST); NULL, MXML_DESCEND_FIRST);
printf("<!-- NEW PAGE -->\n" printf("<!-- NEW PAGE -->\n"
"<h3>%s<a name='%s'>%s</a></h3>\n" "<h3><a name='%s'>%s</a> %s</h3>\n"
"<hr noshade/>\n", get_comment_info(description), name, name); "<hr noshade/>\n", name, name, get_comment_info(description));
if (description) if (description)
{ {
@ -2448,8 +2454,8 @@ write_documentation(
{ {
description = mxmlFindElement(arg, arg, "description", NULL, description = mxmlFindElement(arg, arg, "description", NULL,
NULL, MXML_DESCEND_FIRST); NULL, MXML_DESCEND_FIRST);
printf("<tr><td>%s<tt>%s</tt></td><td>", get_comment_info(description), printf("<tr><td><tt>%s</tt> %s</td><td>",
mxmlElementGetAttr(arg, "name")); mxmlElementGetAttr(arg, "name"), get_comment_info(description));
write_description(description); write_description(description);
@ -2477,7 +2483,9 @@ write_documentation(
MXML_NO_DESCEND)) MXML_NO_DESCEND))
{ {
name = mxmlElementGetAttr(function, "name"); name = mxmlElementGetAttr(function, "name");
printf("\t<li><a href='#%s'><tt>%s()</tt></a></li>\n", name, name); printf("\t<li><a href='#%s'><tt>%s()</tt></a> %s</li>\n", name, name,
get_comment_info(mxmlFindElement(function, function, "description",
NULL, NULL, MXML_DESCEND_FIRST)));
} }
puts("</ul>"); puts("</ul>");
@ -2492,8 +2500,8 @@ write_documentation(
description = mxmlFindElement(function, function, "description", NULL, description = mxmlFindElement(function, function, "description", NULL,
NULL, MXML_DESCEND_FIRST); NULL, MXML_DESCEND_FIRST);
printf("<!-- NEW PAGE -->\n" printf("<!-- NEW PAGE -->\n"
"<h3>%s<a name='%s'>%s()</a></h3>\n" "<h3><a name='%s'>%s()</a> %s</h3>\n"
"<hr noshade/>\n", get_comment_info(description), name, name); "<hr noshade/>\n", name, name, get_comment_info(description));
if (description) if (description)
{ {
@ -2603,7 +2611,9 @@ write_documentation(
MXML_NO_DESCEND)) MXML_NO_DESCEND))
{ {
name = mxmlElementGetAttr(scut, "name"); name = mxmlElementGetAttr(scut, "name");
printf("\t<li><a href='#%s'><tt>%s</tt></a></li>\n", name, name); printf("\t<li><a href='#%s'><tt>%s</tt></a> %s</li>\n", name, name,
get_comment_info(mxmlFindElement(scut, scut, "description",
NULL, NULL, MXML_DESCEND_FIRST)));
} }
puts("</ul>"); puts("</ul>");
@ -2618,8 +2628,8 @@ write_documentation(
description = mxmlFindElement(scut, scut, "description", NULL, description = mxmlFindElement(scut, scut, "description", NULL,
NULL, MXML_DESCEND_FIRST); NULL, MXML_DESCEND_FIRST);
printf("<!-- NEW PAGE -->\n" printf("<!-- NEW PAGE -->\n"
"<h3>%s<a name='%s'>%s</a></h3>\n" "<h3><a name='%s'>%s</a> %s</h3>\n"
"<hr noshade/>\n", get_comment_info(description), cname, cname); "<hr noshade/>\n", cname, cname, get_comment_info(description));
if (description) if (description)
{ {
@ -2711,8 +2721,8 @@ write_documentation(
{ {
description = mxmlFindElement(arg, arg, "description", NULL, description = mxmlFindElement(arg, arg, "description", NULL,
NULL, MXML_DESCEND_FIRST); NULL, MXML_DESCEND_FIRST);
printf("<tr><td>%s<tt>%s</tt></td><td>", get_comment_info(description), printf("<tr><td><tt>%s</tt> %s</td><td>",
mxmlElementGetAttr(arg, "name")); mxmlElementGetAttr(arg, "name"), get_comment_info(description));
write_description(description); write_description(description);
@ -2729,8 +2739,8 @@ write_documentation(
description = mxmlFindElement(function, function, "description", NULL, description = mxmlFindElement(function, function, "description", NULL,
NULL, MXML_DESCEND_FIRST); NULL, MXML_DESCEND_FIRST);
printf("<tr><td>%s<tt><a name='%s.%s'>%s()</a></tt></td><td>", printf("<tr><td><tt><a name='%s.%s'>%s()</a></tt> %s</td><td>",
get_comment_info(description), cname, name, name); cname, name, name, get_comment_info(description));
write_description(description); write_description(description);
@ -2768,7 +2778,9 @@ write_documentation(
MXML_NO_DESCEND)) MXML_NO_DESCEND))
{ {
name = mxmlElementGetAttr(scut, "name"); name = mxmlElementGetAttr(scut, "name");
printf("\t<li><a href='#%s'><tt>%s</tt></a></li>\n", name, name); printf("\t<li><a href='#%s'><tt>%s</tt></a> %s</li>\n", name, name,
get_comment_info(mxmlFindElement(scut, scut, "description",
NULL, NULL, MXML_DESCEND_FIRST)));
} }
puts("</ul>"); puts("</ul>");
@ -2783,8 +2795,8 @@ write_documentation(
description = mxmlFindElement(scut, scut, "description", NULL, description = mxmlFindElement(scut, scut, "description", NULL,
NULL, MXML_DESCEND_FIRST); NULL, MXML_DESCEND_FIRST);
printf("<!-- NEW PAGE -->\n" printf("<!-- NEW PAGE -->\n"
"<h3>%s<a name='%s'>%s</a></h3>\n" "<h3><a name='%s'>%s</a> %s</h3>\n"
"<hr noshade/>\n", get_comment_info(description), name, name); "<hr noshade/>\n", name, name, get_comment_info(description));
if (description) if (description)
{ {
@ -2890,7 +2902,9 @@ write_documentation(
MXML_NO_DESCEND)) MXML_NO_DESCEND))
{ {
name = mxmlElementGetAttr(scut, "name"); name = mxmlElementGetAttr(scut, "name");
printf("\t<li><a href='#%s'><tt>%s</tt></a></li>\n", name, name); printf("\t<li><a href='#%s'><tt>%s</tt></a> %s</li>\n", name, name,
get_comment_info(mxmlFindElement(scut, scut, "description",
NULL, NULL, MXML_DESCEND_FIRST)));
} }
puts("</ul>"); puts("</ul>");
@ -2905,8 +2919,8 @@ write_documentation(
description = mxmlFindElement(scut, scut, "description", NULL, description = mxmlFindElement(scut, scut, "description", NULL,
NULL, MXML_DESCEND_FIRST); NULL, MXML_DESCEND_FIRST);
printf("<!-- NEW PAGE -->\n" printf("<!-- NEW PAGE -->\n"
"<h3>%s<a name='%s'>%s</a></h3>\n" "<h3><a name='%s'>%s</a> %s</h3>\n"
"<hr noshade/>\n", get_comment_info(description), name, name); "<hr noshade/>\n", name, name, get_comment_info(description));
if (description) if (description)
{ {
@ -2945,8 +2959,8 @@ write_documentation(
{ {
description = mxmlFindElement(arg, arg, "description", NULL, description = mxmlFindElement(arg, arg, "description", NULL,
NULL, MXML_DESCEND_FIRST); NULL, MXML_DESCEND_FIRST);
printf("<tr><td>%s<tt>%s</tt></td><td>", get_comment_info(description), printf("<tr><td><tt>%s</tt> %s</td><td>",
mxmlElementGetAttr(arg, "name")); mxmlElementGetAttr(arg, "name"), get_comment_info(description));
write_description(description); write_description(description);
@ -2974,7 +2988,9 @@ write_documentation(
MXML_NO_DESCEND)) MXML_NO_DESCEND))
{ {
name = mxmlElementGetAttr(arg, "name"); name = mxmlElementGetAttr(arg, "name");
printf("\t<li><a href='#%s'><tt>%s</tt></a></li>\n", name, name); printf("\t<li><a href='#%s'><tt>%s</tt></a> %s</li>\n", name, name,
get_comment_info(mxmlFindElement(arg, arg, "description",
NULL, NULL, MXML_DESCEND_FIRST)));
} }
puts("</ul>"); puts("</ul>");
@ -2989,8 +3005,8 @@ write_documentation(
description = mxmlFindElement(arg, arg, "description", NULL, description = mxmlFindElement(arg, arg, "description", NULL,
NULL, MXML_DESCEND_FIRST); NULL, MXML_DESCEND_FIRST);
printf("<!-- NEW PAGE -->\n" printf("<!-- NEW PAGE -->\n"
"<h3>%s<a name='%s'>%s</a></h3>\n" "<h3><a name='%s'>%s</a> %s</h3>\n"
"<hr noshade/>", get_comment_info(description), name, name); "<hr noshade/>", name, name, get_comment_info(description));
if (description) if (description)
{ {

Loading…
Cancel
Save