mirror of
https://github.com/michaelrsweet/mxml.git
synced 2024-11-24 11:25:30 +00:00
Compare commits
1 Commits
72638a2887
...
1cf32d3abc
Author | SHA1 | Date | |
---|---|---|---|
|
1cf32d3abc |
@ -5,12 +5,8 @@ Changes in Mini-XML
|
||||
Changes in Mini-XML 4.0.4
|
||||
-------------------------
|
||||
|
||||
- Added Linux-specific build files and dropped unused `long long` config tests
|
||||
(Issue #335)
|
||||
- Fixed an issue when reporting errors with a `NULL` options pointer
|
||||
(Issue #329)
|
||||
- Fixed some compiler warnings (Issue #333)
|
||||
- Fixed some documentation issues (Issue #334)
|
||||
|
||||
|
||||
Changes in Mini-XML 4.0.3
|
||||
|
@ -179,8 +179,8 @@ clean:
|
||||
$(RM) mxml4.lib
|
||||
$(RM) libmxml4.a
|
||||
$(RM) libmxml4.so
|
||||
$(RM) libmxml4.so.2
|
||||
$(RM) libmxml4.2.dylib
|
||||
$(RM) libmxml4.so.1
|
||||
$(RM) libmxml4.1.dylib
|
||||
$(RM) libmxml4.dylib
|
||||
|
||||
|
||||
@ -415,18 +415,13 @@ testmxml-vg: $(LIBOBJS) testmxml.o
|
||||
|
||||
testmxml.o: mxml.h
|
||||
|
||||
|
||||
#
|
||||
# Fuzz-test the library <>
|
||||
#
|
||||
|
||||
.PHONY: afl
|
||||
afl:
|
||||
$(MAKE) -$(MAKEFLAGS) CC="afl-clang-fast" COMMONFLAGS="-g" clean all
|
||||
test afl-output || rm -rf afl-output
|
||||
afl-fuzz -x xml.dict -i afl-input -o afl-output -V 600 -e xml -t 5000 ./testmxml @@ temps.xml
|
||||
|
||||
|
||||
#
|
||||
# Analyze code with the Clang static analyzer <https://clang-analyzer.llvm.org>
|
||||
#
|
||||
|
@ -32,6 +32,13 @@
|
||||
# define inline
|
||||
|
||||
|
||||
//
|
||||
// Long long support
|
||||
//
|
||||
|
||||
# undef HAVE_LONG_LONG_INT
|
||||
|
||||
|
||||
//
|
||||
// Have <pthread.h>?
|
||||
//
|
||||
|
237
configure
vendored
237
configure
vendored
@ -1522,39 +1522,6 @@ fi
|
||||
|
||||
} # ac_fn_c_try_compile
|
||||
|
||||
# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
|
||||
# -------------------------------------------------------
|
||||
# Tests whether HEADER exists and can be compiled using the include files in
|
||||
# INCLUDES, setting the cache variable VAR accordingly.
|
||||
ac_fn_c_check_header_compile ()
|
||||
{
|
||||
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
|
||||
printf %s "checking for $2... " >&6; }
|
||||
if eval test \${$3+y}
|
||||
then :
|
||||
printf %s "(cached) " >&6
|
||||
else $as_nop
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
#include <$2>
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"
|
||||
then :
|
||||
eval "$3=yes"
|
||||
else $as_nop
|
||||
eval "$3=no"
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||
fi
|
||||
eval ac_res=\$$3
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
|
||||
printf "%s\n" "$ac_res" >&6; }
|
||||
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
|
||||
|
||||
} # ac_fn_c_check_header_compile
|
||||
|
||||
# ac_fn_c_try_link LINENO
|
||||
# -----------------------
|
||||
# Try to link conftest.$ac_ext, and return whether this succeeded.
|
||||
@ -1601,6 +1568,82 @@ fi
|
||||
as_fn_set_status $ac_retval
|
||||
|
||||
} # ac_fn_c_try_link
|
||||
|
||||
# ac_fn_c_try_run LINENO
|
||||
# ----------------------
|
||||
# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that
|
||||
# executables *can* be run.
|
||||
ac_fn_c_try_run ()
|
||||
{
|
||||
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
|
||||
if { { ac_try="$ac_link"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
|
||||
printf "%s\n" "$ac_try_echo"; } >&5
|
||||
(eval "$ac_link") 2>&5
|
||||
ac_status=$?
|
||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
|
||||
{ { case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
|
||||
printf "%s\n" "$ac_try_echo"; } >&5
|
||||
(eval "$ac_try") 2>&5
|
||||
ac_status=$?
|
||||
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; }
|
||||
then :
|
||||
ac_retval=0
|
||||
else $as_nop
|
||||
printf "%s\n" "$as_me: program exited with status $ac_status" >&5
|
||||
printf "%s\n" "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
ac_retval=$ac_status
|
||||
fi
|
||||
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
|
||||
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
|
||||
as_fn_set_status $ac_retval
|
||||
|
||||
} # ac_fn_c_try_run
|
||||
|
||||
# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
|
||||
# -------------------------------------------------------
|
||||
# Tests whether HEADER exists and can be compiled using the include files in
|
||||
# INCLUDES, setting the cache variable VAR accordingly.
|
||||
ac_fn_c_check_header_compile ()
|
||||
{
|
||||
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
|
||||
printf %s "checking for $2... " >&6; }
|
||||
if eval test \${$3+y}
|
||||
then :
|
||||
printf %s "(cached) " >&6
|
||||
else $as_nop
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
$4
|
||||
#include <$2>
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"
|
||||
then :
|
||||
eval "$3=yes"
|
||||
else $as_nop
|
||||
eval "$3=no"
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||
fi
|
||||
eval ac_res=\$$3
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
|
||||
printf "%s\n" "$ac_res" >&6; }
|
||||
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
|
||||
|
||||
} # ac_fn_c_check_header_compile
|
||||
ac_configure_args_raw=
|
||||
for ac_arg
|
||||
do
|
||||
@ -4014,6 +4057,134 @@ esac
|
||||
|
||||
|
||||
|
||||
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
|
||||
printf %s "checking for unsigned long long int... " >&6; }
|
||||
if test ${ac_cv_type_unsigned_long_long_int+y}
|
||||
then :
|
||||
printf %s "(cached) " >&6
|
||||
else $as_nop
|
||||
ac_cv_type_unsigned_long_long_int=yes
|
||||
case $ac_prog_cc_stdc in
|
||||
no | c89) ;;
|
||||
*)
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
/* For now, do not test the preprocessor; as of 2007 there are too many
|
||||
implementations with broken preprocessors. Perhaps this can
|
||||
be revisited in 2012. In the meantime, code should not expect
|
||||
#if to work with literals wider than 32 bits. */
|
||||
/* Test literals. */
|
||||
long long int ll = 9223372036854775807ll;
|
||||
long long int nll = -9223372036854775807LL;
|
||||
unsigned long long int ull = 18446744073709551615ULL;
|
||||
/* Test constant expressions. */
|
||||
typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
|
||||
? 1 : -1)];
|
||||
typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
|
||||
? 1 : -1)];
|
||||
int i = 63;
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
/* Test availability of runtime routines for shift and division. */
|
||||
long long int llmax = 9223372036854775807ll;
|
||||
unsigned long long int ullmax = 18446744073709551615ull;
|
||||
return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
|
||||
| (llmax / ll) | (llmax % ll)
|
||||
| (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
|
||||
| (ullmax / ull) | (ullmax % ull));
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"
|
||||
then :
|
||||
|
||||
else $as_nop
|
||||
ac_cv_type_unsigned_long_long_int=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.beam \
|
||||
conftest$ac_exeext conftest.$ac_ext;;
|
||||
esac
|
||||
fi
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
|
||||
printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; }
|
||||
if test $ac_cv_type_unsigned_long_long_int = yes; then
|
||||
|
||||
printf "%s\n" "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
|
||||
printf %s "checking for long long int... " >&6; }
|
||||
if test ${ac_cv_type_long_long_int+y}
|
||||
then :
|
||||
printf %s "(cached) " >&6
|
||||
else $as_nop
|
||||
ac_cv_type_long_long_int=yes
|
||||
case $ac_prog_cc_stdc in
|
||||
no | c89) ;;
|
||||
*)
|
||||
ac_cv_type_long_long_int=$ac_cv_type_unsigned_long_long_int
|
||||
if test $ac_cv_type_long_long_int = yes; then
|
||||
if test "$cross_compiling" = yes
|
||||
then :
|
||||
:
|
||||
else $as_nop
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <limits.h>
|
||||
#ifndef LLONG_MAX
|
||||
# define HALF \
|
||||
(1LL << (sizeof (long long int) * CHAR_BIT - 2))
|
||||
# define LLONG_MAX (HALF - 1 + HALF)
|
||||
#endif
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
long long int n = 1;
|
||||
int i;
|
||||
for (i = 0; ; i++)
|
||||
{
|
||||
long long int m = n << i;
|
||||
if (m >> i != n)
|
||||
return 1;
|
||||
if (LLONG_MAX / 2 < m)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_run "$LINENO"
|
||||
then :
|
||||
|
||||
else $as_nop
|
||||
ac_cv_type_long_long_int=no
|
||||
fi
|
||||
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
|
||||
conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||
fi
|
||||
|
||||
fi;;
|
||||
esac
|
||||
fi
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
|
||||
printf "%s\n" "$ac_cv_type_long_long_int" >&6; }
|
||||
if test $ac_cv_type_long_long_int = yes; then
|
||||
|
||||
printf "%s\n" "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Check whether --enable-threads was given.
|
||||
if test ${enable_threads+y}
|
||||
then :
|
||||
|
@ -104,6 +104,10 @@ dnl Inline functions...
|
||||
AC_C_INLINE
|
||||
|
||||
|
||||
dnl Check for "long long" support...
|
||||
AC_TYPE_LONG_LONG_INT
|
||||
|
||||
|
||||
dnl Threading support
|
||||
AC_ARG_ENABLE([threads], AS_HELP_STRING([--disable-threads], [disable multi-threading support, default=no]))
|
||||
|
||||
|
85
doc/mxml.3
85
doc/mxml.3
@ -1,4 +1,4 @@
|
||||
.TH mxml 3 "Mini-XML API" "2024-11-17" "Mini-XML API"
|
||||
.TH mxml 3 "Mini-XML API" "2024-03-20" "Mini-XML API"
|
||||
.SH NAME
|
||||
mxml \- Mini-XML API
|
||||
.SH INCLUDE FILE
|
||||
@ -852,9 +852,10 @@ mxml_node_t * mxmlNewCDATA (
|
||||
.fi
|
||||
.PP
|
||||
The new CDATA node is added to the end of the specified parent's child
|
||||
list. The constant \fBNULL\fR 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.
|
||||
list. The constant \fBMXML_NO_PARENT\fR can be used to specify that the new
|
||||
CDATA node has no parent. The data string must be nul-terminated and
|
||||
is copied into the new node. CDATA nodes currently use the
|
||||
\fBMXML_TYPE_ELEMENT\fR type.
|
||||
.SS mxmlNewCDATAf
|
||||
Create a new formatted CDATA node.
|
||||
.PP
|
||||
@ -866,10 +867,10 @@ mxml_node_t * mxmlNewCDATAf (
|
||||
);
|
||||
.fi
|
||||
.PP
|
||||
The new CDATA node is added to the end of the specified parent's child list.
|
||||
The constant \fBNULL\fR can be used to specify that the new opaque string node
|
||||
has no parent. The format string must be nul-terminated and is formatted
|
||||
into the new node.
|
||||
The new CDATA node is added to the end of the specified parent's
|
||||
child list. The constant \fBMXML_NO_PARENT\fR can be used to specify that
|
||||
the new opaque string node has no parent. The format string must be
|
||||
nul-terminated and is formatted into the new node.
|
||||
.SS mxmlNewComment
|
||||
Create a new comment node.
|
||||
.PP
|
||||
@ -881,9 +882,9 @@ mxml_node_t * mxmlNewComment (
|
||||
.fi
|
||||
.PP
|
||||
The new comment node is added to the end of the specified parent's child
|
||||
list. The constant \fBNULL\fR can be used to specify that the new comment node
|
||||
has no parent. The comment string must be nul-terminated and is copied into
|
||||
the new node.
|
||||
list. The constant \fBMXML_NO_PARENT\fR can be used to specify that the new
|
||||
comment node has no parent. The comment string must be nul-terminated and
|
||||
is copied into the new node.
|
||||
.SS mxmlNewCommentf
|
||||
Create a new formatted comment string node.
|
||||
.PP
|
||||
@ -896,9 +897,9 @@ mxml_node_t * mxmlNewCommentf (
|
||||
.fi
|
||||
.PP
|
||||
The new comment string node is added to the end of the specified parent's
|
||||
child list. The constant \fBNULL\fR can be used to specify that the new opaque
|
||||
string node has no parent. The format string must be nul-terminated and is
|
||||
formatted into the new node.
|
||||
child list. The constant \fBMXML_NO_PARENT\fR can be used to specify that
|
||||
the new opaque string node has no parent. The format string must be
|
||||
nul-terminated and is formatted into the new node.
|
||||
.SS mxmlNewCustom
|
||||
Create a new custom data node.
|
||||
.PP
|
||||
@ -925,7 +926,7 @@ mxml_node_t * mxmlNewDeclaration (
|
||||
.fi
|
||||
.PP
|
||||
The new declaration node is added to the end of the specified parent's child
|
||||
list. The constant \fBNULL\fR can be used to specify that the new
|
||||
list. The constant \fBMXML_NO_PARENT\fR can be used to specify that the new
|
||||
declaration node has no parent. The declaration string must be nul-
|
||||
terminated and is copied into the new node.
|
||||
.SS mxmlNewDeclarationf
|
||||
@ -940,7 +941,7 @@ mxml_node_t * mxmlNewDeclarationf (
|
||||
.fi
|
||||
.PP
|
||||
The new declaration node is added to the end of the specified parent's
|
||||
child list. The constant \fBNULL\fR can be used to specify that
|
||||
child list. The constant \fBMXML_NO_PARENT\fR can be used to specify that
|
||||
the new opaque string node has no parent. The format string must be
|
||||
nul-terminated and is formatted into the new node.
|
||||
.SS mxmlNewDirective
|
||||
@ -954,9 +955,9 @@ mxml_node_t * mxmlNewDirective (
|
||||
.fi
|
||||
.PP
|
||||
The new processing instruction node is added to the end of the specified
|
||||
parent's child list. The constant \fBNULL\fR can be used to specify that the new
|
||||
processing instruction node has no parent. The data string must be
|
||||
nul-terminated and is copied into the new node.
|
||||
parent's child list. The constant \fBMXML_NO_PARENT\fR can be used to specify
|
||||
that the new processing instruction node has no parent. The data string must
|
||||
be nul-terminated and is copied into the new node.
|
||||
.SS mxmlNewDirectivef
|
||||
Create a new formatted processing instruction node.
|
||||
.PP
|
||||
@ -968,9 +969,9 @@ mxml_node_t * mxmlNewDirectivef (
|
||||
);
|
||||
.fi
|
||||
.PP
|
||||
The new processing instruction node is added to the end of the specified
|
||||
parent's child list. The constant \fBNULL\fR can be used to specify that the new
|
||||
opaque string node has no parent. The format string must be
|
||||
The new processing instruction node is added to the end of the specified parent's
|
||||
child list. The constant \fBMXML_NO_PARENT\fR can be used to specify that
|
||||
the new opaque string node has no parent. The format string must be
|
||||
nul-terminated and is formatted into the new node.
|
||||
.SS mxmlNewElement
|
||||
Create a new element node.
|
||||
@ -983,8 +984,8 @@ mxml_node_t * mxmlNewElement (
|
||||
.fi
|
||||
.PP
|
||||
The new element node is added to the end of the specified parent's child
|
||||
list. The constant \fBNULL\fR can be used to specify that the new element node
|
||||
has no parent.
|
||||
list. The constant \fBMXML_NO_PARENT\fR can be used to specify that the new
|
||||
element node has no parent.
|
||||
.SS mxmlNewInteger
|
||||
Create a new integer node.
|
||||
.PP
|
||||
@ -996,8 +997,8 @@ mxml_node_t * mxmlNewInteger (
|
||||
.fi
|
||||
.PP
|
||||
The new integer node is added to the end of the specified parent's child
|
||||
list. The constant \fBNULL\fR can be used to specify that the new integer node
|
||||
has no parent.
|
||||
list. The constant \fBMXML_NO_PARENT\fR can be used to specify that the new
|
||||
integer node has no parent.
|
||||
.SS mxmlNewOpaque
|
||||
Create a new opaque string.
|
||||
.PP
|
||||
@ -1009,9 +1010,9 @@ mxml_node_t * mxmlNewOpaque (
|
||||
.fi
|
||||
.PP
|
||||
The new opaque string node is added to the end of the specified parent's
|
||||
child list. The constant \fBNULL\fR can be used to specify that the new opaque
|
||||
string node has no parent. The opaque string must be nul-terminated and is
|
||||
copied into the new node.
|
||||
child list. The constant \fBMXML_NO_PARENT\fR can be used to specify that
|
||||
the new opaque string node has no parent. The opaque string must be nul-
|
||||
terminated and is copied into the new node.
|
||||
.SS mxmlNewOpaquef
|
||||
Create a new formatted opaque string node.
|
||||
.PP
|
||||
@ -1024,9 +1025,9 @@ mxml_node_t * mxmlNewOpaquef (
|
||||
.fi
|
||||
.PP
|
||||
The new opaque string node is added to the end of the specified parent's
|
||||
child list. The constant \fBNULL\fR can be used to specify that the new opaque
|
||||
string node has no parent. The format string must be nul-terminated and is
|
||||
formatted into the new node.
|
||||
child list. The constant \fBMXML_NO_PARENT\fR can be used to specify that
|
||||
the new opaque string node has no parent. The format string must be
|
||||
nul-terminated and is formatted into the new node.
|
||||
.SS mxmlNewReal
|
||||
Create a new real number node.
|
||||
.PP
|
||||
@ -1038,8 +1039,8 @@ mxml_node_t * mxmlNewReal (
|
||||
.fi
|
||||
.PP
|
||||
The new real number node is added to the end of the specified parent's
|
||||
child list. The constant \fBNULL\fR can be used to specify that the new real
|
||||
number node has no parent.
|
||||
child list. The constant \fBMXML_NO_PARENT\fR can be used to specify that
|
||||
the new real number node has no parent.
|
||||
.SS mxmlNewText
|
||||
Create a new text fragment node.
|
||||
.PP
|
||||
@ -1052,10 +1053,10 @@ mxml_node_t * mxmlNewText (
|
||||
.fi
|
||||
.PP
|
||||
The new text node is added to the end of the specified parent's child
|
||||
list. The constant \fBNULL\fR 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.
|
||||
list. The constant \fBMXML_NO_PARENT\fR 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.
|
||||
.SS mxmlNewTextf
|
||||
Create a new formatted text fragment node.
|
||||
.PP
|
||||
@ -1069,10 +1070,10 @@ mxml_node_t * mxmlNewTextf (
|
||||
.fi
|
||||
.PP
|
||||
The new text node is added to the end of the specified parent's child
|
||||
list. The constant \fBNULL\fR 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.
|
||||
list. The constant \fBMXML_NO_PARENT\fR 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.
|
||||
.SS mxmlNewXML
|
||||
Create a new XML document tree.
|
||||
.PP
|
||||
|
BIN
doc/mxml.epub
BIN
doc/mxml.epub
Binary file not shown.
307
doc/mxml.html
307
doc/mxml.html
@ -191,13 +191,13 @@ span.comment {
|
||||
color: darkgreen;
|
||||
}
|
||||
span.directive {
|
||||
color: red;
|
||||
color: purple;
|
||||
}
|
||||
span.number {
|
||||
color: brown;
|
||||
}
|
||||
span.reserved {
|
||||
color: blue;
|
||||
color: darkcyan;
|
||||
}
|
||||
span.string {
|
||||
color: magenta;
|
||||
@ -472,19 +472,19 @@ span.string {
|
||||
<h3 class="title" id="api-basics">API Basics</h3>
|
||||
<p>Every piece of information in an XML file is stored in memory in "nodes". Nodes are represented by <code>mxml_node_t</code> pointers. Each node has an associated type, value(s), a parent node, sibling nodes (previous and next), potentially first and last child nodes, and an optional user data pointer.</p>
|
||||
<p>For example, if you have an XML file like the following:</p>
|
||||
<pre><code class="language-xml"><span class="directive"><?xml version=</span><span class="string">"1.0"</span><span class="directive"> encoding=</span><span class="string">"utf-8"</span><span class="directive">?></span>
|
||||
<span class="reserved"><data></span>
|
||||
<span class="reserved"><node></span>val1<span class="reserved"></node></span>
|
||||
<span class="reserved"><node></span>val2<span class="reserved"></node></span>
|
||||
<span class="reserved"><node></span>val3<span class="reserved"></node></span>
|
||||
<span class="reserved"><group></span>
|
||||
<span class="reserved"><node></span>val4<span class="reserved"></node></span>
|
||||
<span class="reserved"><node></span>val5<span class="reserved"></node></span>
|
||||
<span class="reserved"><node></span>val6<span class="reserved"></node></span>
|
||||
<span class="reserved"></group></span>
|
||||
<span class="reserved"><node></span>val7<span class="reserved"></node></span>
|
||||
<span class="reserved"><node></span>val8<span class="reserved"></node></span>
|
||||
<span class="reserved"></data></span>
|
||||
<pre><code class="language-xml"><?xml version="1.0" encoding="utf-8"?>
|
||||
<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>
|
||||
</code></pre>
|
||||
<p>the node tree for the file would look like the following in memory:</p>
|
||||
<pre><code><?xml version="1.0" encoding="utf-8"?>
|
||||
@ -562,7 +562,7 @@ xml = mxmlLoadFilename(<span class="comment">/*top*/</span>NULL, <span class="co
|
||||
<pre><code class="language-c">mxmlOptionsSetTypeValue(options, MXML_TYPE_OPAQUE);
|
||||
</code></pre>
|
||||
<p>For more complex XML documents, you can specify a callback that returns the type of value for a given element node using the <a href="#mxmlOptionsSetTypeCallback">mxmlOptionsSetTypeCallback</a> function. For example, to specify a callback function called <code>my_type_cb</code> that has no callback data:</p>
|
||||
<pre><code class="language-c">mxmlOptionsSetTypeCallback(options, my_type_cb, <span class="comment">/*cbdata*/</span>NULL);
|
||||
<pre><code class="language-c">mxmlOptionsSetTypeValue(options, my_type_cb, <span class="comment">/*cbdata*/</span>NULL);
|
||||
</code></pre>
|
||||
<p>The <code>my_type_cb</code> function accepts the callback data pointer (<code>NULL</code> in this case) and the <code>mxml_node_t</code> pointer for the current element and returns a <code>mxml_type_t</code> enumeration value specifying the value type for child nodes. For example, the following function looks at the "type" attribute and the element name to determine the value types of the node's children:</p>
|
||||
<pre><code class="language-c">mxml_type_t
|
||||
@ -1445,7 +1445,7 @@ free_all_strings(&pool);
|
||||
<h3 class="function"><a id="mxmlAdd">mxmlAdd</a></h3>
|
||||
<p class="description">Add a node to a tree.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">void</span> mxmlAdd(<a href="#mxml_node_t">mxml_node_t</a> *parent, <a href="#mxml_add_t">mxml_add_t</a> add, <a href="#mxml_node_t">mxml_node_t</a> *child, <a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
void mxmlAdd(<a href="#mxml_node_t">mxml_node_t</a> *parent, <a href="#mxml_add_t">mxml_add_t</a> add, <a href="#mxml_node_t">mxml_node_t</a> *child, <a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>parent</th>
|
||||
@ -1466,7 +1466,7 @@ is <code>NULL</code>, the new node is placed at the beginning of the child list
|
||||
<h3 class="function"><a id="mxmlDelete">mxmlDelete</a></h3>
|
||||
<p class="description">Delete a node and all of its children.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">void</span> mxmlDelete(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
void mxmlDelete(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1479,7 +1479,7 @@ parent using the <a href="#mxmlRemove"><code>mxmlRemove</code></a> function.</p>
|
||||
<h3 class="function"><a id="mxmlElementClearAttr">mxmlElementClearAttr</a></h3>
|
||||
<p class="description">Remove an attribute from an element.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">void</span> mxmlElementClearAttr(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">const</span> <span class="reserved">char</span> *name);</p>
|
||||
void mxmlElementClearAttr(<a href="#mxml_node_t">mxml_node_t</a> *node, const char *name);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1492,7 +1492,7 @@ parent using the <a href="#mxmlRemove"><code>mxmlRemove</code></a> function.</p>
|
||||
<h3 class="function"><a id="mxmlElementGetAttr">mxmlElementGetAttr</a></h3>
|
||||
<p class="description">Get the value of an attribute.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">const</span> <span class="reserved">char</span> *mxmlElementGetAttr(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">const</span> <span class="reserved">char</span> *name);</p>
|
||||
const char *mxmlElementGetAttr(<a href="#mxml_node_t">mxml_node_t</a> *node, const char *name);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1509,7 +1509,7 @@ attribute does not exist.</p>
|
||||
<h3 class="function"><a id="mxmlElementGetAttrByIndex">mxmlElementGetAttrByIndex</a></h3>
|
||||
<p class="description">Get an attribute by index.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">const</span> <span class="reserved">char</span> *mxmlElementGetAttrByIndex(<a href="#mxml_node_t">mxml_node_t</a> *node, size_t idx, <span class="reserved">const</span> <span class="reserved">char</span> **name);</p>
|
||||
const char *mxmlElementGetAttrByIndex(<a href="#mxml_node_t">mxml_node_t</a> *node, size_t idx, const char **name);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1543,7 +1543,7 @@ element.</p>
|
||||
<h3 class="function"><a id="mxmlElementSetAttr">mxmlElementSetAttr</a></h3>
|
||||
<p class="description">Set an attribute for an element.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">void</span> mxmlElementSetAttr(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">char</span> *value);</p>
|
||||
void mxmlElementSetAttr(<a href="#mxml_node_t">mxml_node_t</a> *node, const char *name, const char *value);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1560,7 +1560,7 @@ is replaced by the new string value. The string value is copied.</p>
|
||||
<h3 class="function"><a id="mxmlElementSetAttrf">mxmlElementSetAttrf</a></h3>
|
||||
<p class="description">Set an attribute with a formatted value.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">void</span> mxmlElementSetAttrf(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">const</span> <span class="reserved">char</span> *name, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
|
||||
void mxmlElementSetAttrf(<a href="#mxml_node_t">mxml_node_t</a> *node, const char *name, const char *format, ...);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1579,7 +1579,7 @@ attribute is replaced by the new formatted string value.</p>
|
||||
<h3 class="function"><a id="mxmlFindElement">mxmlFindElement</a></h3>
|
||||
<p class="description">Find the named element.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlFindElement(<a href="#mxml_node_t">mxml_node_t</a> *node, <a href="#mxml_node_t">mxml_node_t</a> *top, <span class="reserved">const</span> <span class="reserved">char</span> *element, <span class="reserved">const</span> <span class="reserved">char</span> *attr, <span class="reserved">const</span> <span class="reserved">char</span> *value, <a href="#mxml_descend_t">mxml_descend_t</a> descend);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlFindElement(<a href="#mxml_node_t">mxml_node_t</a> *node, <a href="#mxml_node_t">mxml_node_t</a> *top, const char *element, const char *attr, const char *value, <a href="#mxml_descend_t">mxml_descend_t</a> descend);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1610,7 +1610,7 @@ nodes; normally you will use <code>MXML_DESCEND_FIRST</code> for the initial sea
|
||||
<h3 class="function"><a id="mxmlFindPath">mxmlFindPath</a></h3>
|
||||
<p class="description">Find a node with the given path.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlFindPath(<a href="#mxml_node_t">mxml_node_t</a> *top, <span class="reserved">const</span> <span class="reserved">char</span> *path);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlFindPath(<a href="#mxml_node_t">mxml_node_t</a> *top, const char *path);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>top</th>
|
||||
@ -1631,7 +1631,7 @@ children and the first child is a value node.</p>
|
||||
<h3 class="function"><a id="mxmlGetCDATA">mxmlGetCDATA</a></h3>
|
||||
<p class="description">Get the value for a CDATA node.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">const</span> <span class="reserved">char</span> *mxmlGetCDATA(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
const char *mxmlGetCDATA(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1645,7 +1645,7 @@ the node is not a CDATA element.</p>
|
||||
<h3 class="function"><a id="mxmlGetComment">mxmlGetComment</a></h3>
|
||||
<p class="description">Get the value for a comment node.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">const</span> <span class="reserved">char</span> *mxmlGetComment(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
const char *mxmlGetComment(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1659,7 +1659,7 @@ if the node is not a comment.</p>
|
||||
<h3 class="function"><a id="mxmlGetCustom">mxmlGetCustom</a></h3>
|
||||
<p class="description">Get the value for a custom node.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">const</span> <span class="reserved">void</span> *mxmlGetCustom(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
const void *mxmlGetCustom(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1673,7 +1673,7 @@ the node (or its first child) is not a custom value node.</p>
|
||||
<h3 class="function"><a id="mxmlGetDeclaration">mxmlGetDeclaration</a></h3>
|
||||
<p class="description">Get the value for a declaration node.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">const</span> <span class="reserved">char</span> *mxmlGetDeclaration(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
const char *mxmlGetDeclaration(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1687,7 +1687,7 @@ returned if the node is not a declaration.</p>
|
||||
<h3 class="function"><a id="mxmlGetDirective">mxmlGetDirective</a></h3>
|
||||
<p class="description">Get the value for a processing instruction node.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">const</span> <span class="reserved">char</span> *mxmlGetDirective(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
const char *mxmlGetDirective(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1701,7 +1701,7 @@ returned if the node is not a processing instruction.</p>
|
||||
<h3 class="function"><a id="mxmlGetElement">mxmlGetElement</a></h3>
|
||||
<p class="description">Get the name for an element node.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">const</span> <span class="reserved">char</span> *mxmlGetElement(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
const char *mxmlGetElement(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1730,7 +1730,7 @@ has no children.</p>
|
||||
<p class="description">Get the integer value from the specified node or its
|
||||
first child.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">long</span> mxmlGetInteger(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
long mxmlGetInteger(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1771,7 +1771,7 @@ if this is the last child for the current parent.</p>
|
||||
<h3 class="function"><a id="mxmlGetOpaque">mxmlGetOpaque</a></h3>
|
||||
<p class="description">Get an opaque string value for a node or its first child.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">const</span> <span class="reserved">char</span> *mxmlGetOpaque(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
const char *mxmlGetOpaque(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1812,7 +1812,7 @@ returned if this is the first child for the current parent.</p>
|
||||
<h3 class="function"><a id="mxmlGetReal">mxmlGetReal</a></h3>
|
||||
<p class="description">Get the real value for a node or its first child.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">double</span> mxmlGetReal(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
double mxmlGetReal(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1841,7 +1841,7 @@ reference count.</p>
|
||||
<h3 class="function"><a id="mxmlGetText">mxmlGetText</a></h3>
|
||||
<p class="description">Get the text value for a node or its first child.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">const</span> <span class="reserved">char</span> *mxmlGetText(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">bool</span> *whitespace);</p>
|
||||
const char *mxmlGetText(<a href="#mxml_node_t">mxml_node_t</a> *node, bool *whitespace);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1879,7 +1879,7 @@ using the <a href="#mxmlGetOpaque"><code>mxmlGetOpaque</code></a> function inste
|
||||
<h3 class="function"><a id="mxmlGetUserData">mxmlGetUserData</a></h3>
|
||||
<p class="description">Get the user data pointer for a node.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">void</span> *mxmlGetUserData(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
void *mxmlGetUserData(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1892,7 +1892,7 @@ using the <a href="#mxmlGetOpaque"><code>mxmlGetOpaque</code></a> function inste
|
||||
<h3 class="function"><a id="mxmlIndexDelete">mxmlIndexDelete</a></h3>
|
||||
<p class="description">Delete an index.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">void</span> mxmlIndexDelete(<a href="#mxml_index_t">mxml_index_t</a> *ind);</p>
|
||||
void mxmlIndexDelete(<a href="#mxml_index_t">mxml_index_t</a> *ind);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>ind</th>
|
||||
@ -1918,7 +1918,7 @@ index.</p>
|
||||
<h3 class="function"><a id="mxmlIndexFind">mxmlIndexFind</a></h3>
|
||||
<p class="description">Find the next matching node.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlIndexFind(<a href="#mxml_index_t">mxml_index_t</a> *ind, <span class="reserved">const</span> <span class="reserved">char</span> *element, <span class="reserved">const</span> <span class="reserved">char</span> *value);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlIndexFind(<a href="#mxml_index_t">mxml_index_t</a> *ind, const char *element, const char *value);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>ind</th>
|
||||
@ -1951,7 +1951,7 @@ size_t mxmlIndexGetCount(<a href="#mxml_index_t">mxml_index_t</a> *ind);</p>
|
||||
<h3 class="function"><a id="mxmlIndexNew">mxmlIndexNew</a></h3>
|
||||
<p class="description">Create a new index.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_index_t">mxml_index_t</a> *mxmlIndexNew(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">const</span> <span class="reserved">char</span> *element, <span class="reserved">const</span> <span class="reserved">char</span> *attr);</p>
|
||||
<a href="#mxml_index_t">mxml_index_t</a> *mxmlIndexNew(<a href="#mxml_node_t">mxml_node_t</a> *node, const char *element, const char *attr);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -1990,7 +1990,7 @@ first time.</p>
|
||||
<h3 class="function"><a id="mxmlLoadFd">mxmlLoadFd</a></h3>
|
||||
<p class="description">Load a file descriptor into an XML node tree.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlLoadFd(<a href="#mxml_node_t">mxml_node_t</a> *top, <a href="#mxml_options_t">mxml_options_t</a> *options, <span class="reserved">int</span> fd);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlLoadFd(<a href="#mxml_node_t">mxml_node_t</a> *top, <a href="#mxml_options_t">mxml_options_t</a> *options, int fd);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>top</th>
|
||||
@ -2038,7 +2038,7 @@ function to create options when loading XML data.</p>
|
||||
<h3 class="function"><a id="mxmlLoadFilename">mxmlLoadFilename</a></h3>
|
||||
<p class="description">Load a file into an XML node tree.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlLoadFilename(<a href="#mxml_node_t">mxml_node_t</a> *top, <a href="#mxml_options_t">mxml_options_t</a> *options, <span class="reserved">const</span> <span class="reserved">char</span> *filename);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlLoadFilename(<a href="#mxml_node_t">mxml_node_t</a> *top, <a href="#mxml_options_t">mxml_options_t</a> *options, const char *filename);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>top</th>
|
||||
@ -2062,7 +2062,7 @@ function to create options when loading XML data.</p>
|
||||
<h3 class="function"><a id="mxmlLoadIO">mxmlLoadIO</a></h3>
|
||||
<p class="description">Load an XML node tree using a read callback.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlLoadIO(<a href="#mxml_node_t">mxml_node_t</a> *top, <a href="#mxml_options_t">mxml_options_t</a> *options, <a href="#mxml_io_cb_t">mxml_io_cb_t</a> io_cb, <span class="reserved">void</span> *io_cbdata);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlLoadIO(<a href="#mxml_node_t">mxml_node_t</a> *top, <a href="#mxml_options_t">mxml_options_t</a> *options, <a href="#mxml_io_cb_t">mxml_io_cb_t</a> io_cb, void *io_cbdata);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>top</th>
|
||||
@ -2101,7 +2101,7 @@ size_t my_io_cb(void <em>cbdata, void </em>buffer, size_t bytes)
|
||||
<h3 class="function"><a id="mxmlLoadString">mxmlLoadString</a></h3>
|
||||
<p class="description">Load a string into an XML node tree.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlLoadString(<a href="#mxml_node_t">mxml_node_t</a> *top, <a href="#mxml_options_t">mxml_options_t</a> *options, <span class="reserved">const</span> <span class="reserved">char</span> *s);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlLoadString(<a href="#mxml_node_t">mxml_node_t</a> *top, <a href="#mxml_options_t">mxml_options_t</a> *options, const char *s);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>top</th>
|
||||
@ -2125,11 +2125,11 @@ function to create options when loading XML data.</p>
|
||||
<h3 class="function"><a id="mxmlNewCDATA">mxmlNewCDATA</a></h3>
|
||||
<p class="description">Create a new CDATA node.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewCDATA(<a href="#mxml_node_t">mxml_node_t</a> *parent, <span class="reserved">const</span> <span class="reserved">char</span> *data);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewCDATA(<a href="#mxml_node_t">mxml_node_t</a> *parent, const char *data);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>parent</th>
|
||||
<td class="description">Parent node or <code>NULL</code></td></tr>
|
||||
<td class="description">Parent node or <code>MXML_NO_PARENT</code></td></tr>
|
||||
<tr><th>data</th>
|
||||
<td class="description">Data string</td></tr>
|
||||
</tbody></table>
|
||||
@ -2137,17 +2137,18 @@ function to create options when loading XML data.</p>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new CDATA node is added to the end of the specified parent's child
|
||||
list. The constant <code>NULL</code> 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.</p>
|
||||
list. The constant <code>MXML_NO_PARENT</code> can be used to specify that the new
|
||||
CDATA node has no parent. The data string must be nul-terminated and
|
||||
is copied into the new node. CDATA nodes currently use the
|
||||
<code>MXML_TYPE_ELEMENT</code> type.</p>
|
||||
<h3 class="function"><a id="mxmlNewCDATAf">mxmlNewCDATAf</a></h3>
|
||||
<p class="description">Create a new formatted CDATA node.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewCDATAf(<a href="#mxml_node_t">mxml_node_t</a> *parent, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewCDATAf(<a href="#mxml_node_t">mxml_node_t</a> *parent, const char *format, ...);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>parent</th>
|
||||
<td class="description">Parent node or <code>NULL</code></td></tr>
|
||||
<td class="description">Parent node or <code>MXML_NO_PARENT</code></td></tr>
|
||||
<tr><th>format</th>
|
||||
<td class="description">Printf-style format string</td></tr>
|
||||
<tr><th>...</th>
|
||||
@ -2156,18 +2157,18 @@ new node.</p>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new CDATA node is added to the end of the specified parent's child list.
|
||||
The constant <code>NULL</code> can be used to specify that the new opaque string node
|
||||
has no parent. The format string must be nul-terminated and is formatted
|
||||
into the new node.</p>
|
||||
<p class="discussion">The new CDATA node is added to the end of the specified parent's
|
||||
child list. The constant <code>MXML_NO_PARENT</code> can be used to specify that
|
||||
the new opaque string node has no parent. The format string must be
|
||||
nul-terminated and is formatted into the new node.</p>
|
||||
<h3 class="function"><a id="mxmlNewComment">mxmlNewComment</a></h3>
|
||||
<p class="description">Create a new comment node.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewComment(<a href="#mxml_node_t">mxml_node_t</a> *parent, <span class="reserved">const</span> <span class="reserved">char</span> *comment);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewComment(<a href="#mxml_node_t">mxml_node_t</a> *parent, const char *comment);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>parent</th>
|
||||
<td class="description">Parent node or <code>NULL</code></td></tr>
|
||||
<td class="description">Parent node or <code>MXML_NO_PARENT</code></td></tr>
|
||||
<tr><th>comment</th>
|
||||
<td class="description">Comment string</td></tr>
|
||||
</tbody></table>
|
||||
@ -2175,17 +2176,17 @@ into the new node.</p>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new comment node is added to the end of the specified parent's child
|
||||
list. The constant <code>NULL</code> can be used to specify that the new comment node
|
||||
has no parent. The comment string must be nul-terminated and is copied into
|
||||
the new node.</p>
|
||||
list. The constant <code>MXML_NO_PARENT</code> can be used to specify that the new
|
||||
comment node has no parent. The comment string must be nul-terminated and
|
||||
is copied into the new node.</p>
|
||||
<h3 class="function"><a id="mxmlNewCommentf">mxmlNewCommentf</a></h3>
|
||||
<p class="description">Create a new formatted comment string node.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewCommentf(<a href="#mxml_node_t">mxml_node_t</a> *parent, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewCommentf(<a href="#mxml_node_t">mxml_node_t</a> *parent, const char *format, ...);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>parent</th>
|
||||
<td class="description">Parent node or <code>NULL</code></td></tr>
|
||||
<td class="description">Parent node or <code>MXML_NO_PARENT</code></td></tr>
|
||||
<tr><th>format</th>
|
||||
<td class="description">Printf-style format string</td></tr>
|
||||
<tr><th>...</th>
|
||||
@ -2195,17 +2196,17 @@ the new node.</p>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new comment string node is added to the end of the specified parent's
|
||||
child list. The constant <code>NULL</code> can be used to specify that the new opaque
|
||||
string node has no parent. The format string must be nul-terminated and is
|
||||
formatted into the new node.</p>
|
||||
child list. The constant <code>MXML_NO_PARENT</code> can be used to specify that
|
||||
the new opaque string node has no parent. The format string must be
|
||||
nul-terminated and is formatted into the new node.</p>
|
||||
<h3 class="function"><a id="mxmlNewCustom">mxmlNewCustom</a></h3>
|
||||
<p class="description">Create a new custom data node.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewCustom(<a href="#mxml_node_t">mxml_node_t</a> *parent, <span class="reserved">void</span> *data, <a href="#mxml_custfree_cb_t">mxml_custfree_cb_t</a> free_cb, <span class="reserved">void</span> *free_cbdata);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewCustom(<a href="#mxml_node_t">mxml_node_t</a> *parent, void *data, <a href="#mxml_custfree_cb_t">mxml_custfree_cb_t</a> free_cb, void *free_cbdata);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>parent</th>
|
||||
<td class="description">Parent node or <code>NULL</code></td></tr>
|
||||
<td class="description">Parent node or <code>MXML_NO_PARENT</code></td></tr>
|
||||
<tr><th>data</th>
|
||||
<td class="description">Pointer to data</td></tr>
|
||||
<tr><th>free_cb</th>
|
||||
@ -2222,11 +2223,11 @@ data when the node is deleted.</p>
|
||||
<h3 class="function"><a id="mxmlNewDeclaration">mxmlNewDeclaration</a></h3>
|
||||
<p class="description">Create a new declaraction node.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewDeclaration(<a href="#mxml_node_t">mxml_node_t</a> *parent, <span class="reserved">const</span> <span class="reserved">char</span> *declaration);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewDeclaration(<a href="#mxml_node_t">mxml_node_t</a> *parent, const char *declaration);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>parent</th>
|
||||
<td class="description">Parent node or <code>NULL</code></td></tr>
|
||||
<td class="description">Parent node or <code>MXML_NO_PARENT</code></td></tr>
|
||||
<tr><th>declaration</th>
|
||||
<td class="description">Declaration string</td></tr>
|
||||
</tbody></table>
|
||||
@ -2234,17 +2235,17 @@ data when the node is deleted.</p>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new declaration node is added to the end of the specified parent's child
|
||||
list. The constant <code>NULL</code> can be used to specify that the new
|
||||
list. The constant <code>MXML_NO_PARENT</code> can be used to specify that the new
|
||||
declaration node has no parent. The declaration string must be nul-
|
||||
terminated and is copied into the new node.</p>
|
||||
<h3 class="function"><a id="mxmlNewDeclarationf">mxmlNewDeclarationf</a></h3>
|
||||
<p class="description">Create a new formatted declaration node.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewDeclarationf(<a href="#mxml_node_t">mxml_node_t</a> *parent, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewDeclarationf(<a href="#mxml_node_t">mxml_node_t</a> *parent, const char *format, ...);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>parent</th>
|
||||
<td class="description">Parent node or <code>NULL</code></td></tr>
|
||||
<td class="description">Parent node or <code>MXML_NO_PARENT</code></td></tr>
|
||||
<tr><th>format</th>
|
||||
<td class="description">Printf-style format string</td></tr>
|
||||
<tr><th>...</th>
|
||||
@ -2254,17 +2255,17 @@ terminated and is copied into the new node.</p>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new declaration node is added to the end of the specified parent's
|
||||
child list. The constant <code>NULL</code> can be used to specify that
|
||||
child list. The constant <code>MXML_NO_PARENT</code> can be used to specify that
|
||||
the new opaque string node has no parent. The format string must be
|
||||
nul-terminated and is formatted into the new node.</p>
|
||||
<h3 class="function"><a id="mxmlNewDirective">mxmlNewDirective</a></h3>
|
||||
<p class="description">Create a new processing instruction node.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewDirective(<a href="#mxml_node_t">mxml_node_t</a> *parent, <span class="reserved">const</span> <span class="reserved">char</span> *directive);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewDirective(<a href="#mxml_node_t">mxml_node_t</a> *parent, const char *directive);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>parent</th>
|
||||
<td class="description">Parent node or <code>NULL</code></td></tr>
|
||||
<td class="description">Parent node or <code>MXML_NO_PARENT</code></td></tr>
|
||||
<tr><th>directive</th>
|
||||
<td class="description">Directive string</td></tr>
|
||||
</tbody></table>
|
||||
@ -2272,17 +2273,17 @@ nul-terminated and is formatted into the new node.</p>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new processing instruction node is added to the end of the specified
|
||||
parent's child list. The constant <code>NULL</code> can be used to specify that the new
|
||||
processing instruction node has no parent. The data string must be
|
||||
nul-terminated and is copied into the new node.</p>
|
||||
parent's child list. The constant <code>MXML_NO_PARENT</code> can be used to specify
|
||||
that the new processing instruction node has no parent. The data string must
|
||||
be nul-terminated and is copied into the new node.</p>
|
||||
<h3 class="function"><a id="mxmlNewDirectivef">mxmlNewDirectivef</a></h3>
|
||||
<p class="description">Create a new formatted processing instruction node.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewDirectivef(<a href="#mxml_node_t">mxml_node_t</a> *parent, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewDirectivef(<a href="#mxml_node_t">mxml_node_t</a> *parent, const char *format, ...);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>parent</th>
|
||||
<td class="description">Parent node or <code>NULL</code></td></tr>
|
||||
<td class="description">Parent node or <code>MXML_NO_PARENT</code></td></tr>
|
||||
<tr><th>format</th>
|
||||
<td class="description">Printf-style format string</td></tr>
|
||||
<tr><th>...</th>
|
||||
@ -2291,18 +2292,18 @@ nul-terminated and is copied into the new node.</p>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new processing instruction node is added to the end of the specified
|
||||
parent's child list. The constant <code>NULL</code> can be used to specify that the new
|
||||
opaque string node has no parent. The format string must be
|
||||
<p class="discussion">The new processing instruction node is added to the end of the specified parent's
|
||||
child list. The constant <code>MXML_NO_PARENT</code> can be used to specify that
|
||||
the new opaque string node has no parent. The format string must be
|
||||
nul-terminated and is formatted into the new node.</p>
|
||||
<h3 class="function"><a id="mxmlNewElement">mxmlNewElement</a></h3>
|
||||
<p class="description">Create a new element node.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewElement(<a href="#mxml_node_t">mxml_node_t</a> *parent, <span class="reserved">const</span> <span class="reserved">char</span> *name);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewElement(<a href="#mxml_node_t">mxml_node_t</a> *parent, const char *name);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>parent</th>
|
||||
<td class="description">Parent node or <code>NULL</code></td></tr>
|
||||
<td class="description">Parent node or <code>MXML_NO_PARENT</code></td></tr>
|
||||
<tr><th>name</th>
|
||||
<td class="description">Name of element</td></tr>
|
||||
</tbody></table>
|
||||
@ -2310,16 +2311,16 @@ nul-terminated and is formatted into the new node.</p>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new element node is added to the end of the specified parent's child
|
||||
list. The constant <code>NULL</code> can be used to specify that the new element node
|
||||
has no parent.</p>
|
||||
list. The constant <code>MXML_NO_PARENT</code> can be used to specify that the new
|
||||
element node has no parent.</p>
|
||||
<h3 class="function"><a id="mxmlNewInteger">mxmlNewInteger</a></h3>
|
||||
<p class="description">Create a new integer node.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewInteger(<a href="#mxml_node_t">mxml_node_t</a> *parent, <span class="reserved">long</span> integer);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewInteger(<a href="#mxml_node_t">mxml_node_t</a> *parent, long integer);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>parent</th>
|
||||
<td class="description">Parent node or <code>NULL</code></td></tr>
|
||||
<td class="description">Parent node or <code>MXML_NO_PARENT</code></td></tr>
|
||||
<tr><th>integer</th>
|
||||
<td class="description">Integer value</td></tr>
|
||||
</tbody></table>
|
||||
@ -2327,16 +2328,16 @@ has no parent.</p>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new integer node is added to the end of the specified parent's child
|
||||
list. The constant <code>NULL</code> can be used to specify that the new integer node
|
||||
has no parent.</p>
|
||||
list. The constant <code>MXML_NO_PARENT</code> can be used to specify that the new
|
||||
integer node has no parent.</p>
|
||||
<h3 class="function"><a id="mxmlNewOpaque">mxmlNewOpaque</a></h3>
|
||||
<p class="description">Create a new opaque string.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewOpaque(<a href="#mxml_node_t">mxml_node_t</a> *parent, <span class="reserved">const</span> <span class="reserved">char</span> *opaque);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewOpaque(<a href="#mxml_node_t">mxml_node_t</a> *parent, const char *opaque);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>parent</th>
|
||||
<td class="description">Parent node or <code>NULL</code></td></tr>
|
||||
<td class="description">Parent node or <code>MXML_NO_PARENT</code></td></tr>
|
||||
<tr><th>opaque</th>
|
||||
<td class="description">Opaque string</td></tr>
|
||||
</tbody></table>
|
||||
@ -2344,17 +2345,17 @@ has no parent.</p>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new opaque string node is added to the end of the specified parent's
|
||||
child list. The constant <code>NULL</code> can be used to specify that the new opaque
|
||||
string node has no parent. The opaque string must be nul-terminated and is
|
||||
copied into the new node.</p>
|
||||
child list. The constant <code>MXML_NO_PARENT</code> can be used to specify that
|
||||
the new opaque string node has no parent. The opaque string must be nul-
|
||||
terminated and is copied into the new node.</p>
|
||||
<h3 class="function"><a id="mxmlNewOpaquef">mxmlNewOpaquef</a></h3>
|
||||
<p class="description">Create a new formatted opaque string node.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewOpaquef(<a href="#mxml_node_t">mxml_node_t</a> *parent, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewOpaquef(<a href="#mxml_node_t">mxml_node_t</a> *parent, const char *format, ...);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>parent</th>
|
||||
<td class="description">Parent node or <code>NULL</code></td></tr>
|
||||
<td class="description">Parent node or <code>MXML_NO_PARENT</code></td></tr>
|
||||
<tr><th>format</th>
|
||||
<td class="description">Printf-style format string</td></tr>
|
||||
<tr><th>...</th>
|
||||
@ -2364,17 +2365,17 @@ copied into the new node.</p>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new opaque string node is added to the end of the specified parent's
|
||||
child list. The constant <code>NULL</code> can be used to specify that the new opaque
|
||||
string node has no parent. The format string must be nul-terminated and is
|
||||
formatted into the new node.</p>
|
||||
child list. The constant <code>MXML_NO_PARENT</code> can be used to specify that
|
||||
the new opaque string node has no parent. The format string must be
|
||||
nul-terminated and is formatted into the new node.</p>
|
||||
<h3 class="function"><a id="mxmlNewReal">mxmlNewReal</a></h3>
|
||||
<p class="description">Create a new real number node.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewReal(<a href="#mxml_node_t">mxml_node_t</a> *parent, <span class="reserved">double</span> real);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewReal(<a href="#mxml_node_t">mxml_node_t</a> *parent, double real);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>parent</th>
|
||||
<td class="description">Parent node or <code>NULL</code></td></tr>
|
||||
<td class="description">Parent node or <code>MXML_NO_PARENT</code></td></tr>
|
||||
<tr><th>real</th>
|
||||
<td class="description">Real number value</td></tr>
|
||||
</tbody></table>
|
||||
@ -2382,16 +2383,16 @@ formatted into the new node.</p>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new real number node is added to the end of the specified parent's
|
||||
child list. The constant <code>NULL</code> can be used to specify that the new real
|
||||
number node has no parent.</p>
|
||||
child list. The constant <code>MXML_NO_PARENT</code> can be used to specify that
|
||||
the new real number node has no parent.</p>
|
||||
<h3 class="function"><a id="mxmlNewText">mxmlNewText</a></h3>
|
||||
<p class="description">Create a new text fragment node.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewText(<a href="#mxml_node_t">mxml_node_t</a> *parent, <span class="reserved">bool</span> whitespace, <span class="reserved">const</span> <span class="reserved">char</span> *string);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewText(<a href="#mxml_node_t">mxml_node_t</a> *parent, bool whitespace, const char *string);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>parent</th>
|
||||
<td class="description">Parent node or <code>NULL</code></td></tr>
|
||||
<td class="description">Parent node or <code>MXML_NO_PARENT</code></td></tr>
|
||||
<tr><th>whitespace</th>
|
||||
<td class="description"><code>true</code> = leading whitespace, <code>false</code> = no whitespace</td></tr>
|
||||
<tr><th>string</th>
|
||||
@ -2401,18 +2402,18 @@ number node has no parent.</p>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new text node is added to the end of the specified parent's child
|
||||
list. The constant <code>NULL</code> 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.</p>
|
||||
list. The constant <code>MXML_NO_PARENT</code> 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.</p>
|
||||
<h3 class="function"><a id="mxmlNewTextf">mxmlNewTextf</a></h3>
|
||||
<p class="description">Create a new formatted text fragment node.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewTextf(<a href="#mxml_node_t">mxml_node_t</a> *parent, <span class="reserved">bool</span> whitespace, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewTextf(<a href="#mxml_node_t">mxml_node_t</a> *parent, bool whitespace, const char *format, ...);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>parent</th>
|
||||
<td class="description">Parent node or <code>NULL</code></td></tr>
|
||||
<td class="description">Parent node or <code>MXML_NO_PARENT</code></td></tr>
|
||||
<tr><th>whitespace</th>
|
||||
<td class="description"><code>true</code> = leading whitespace, <code>false</code> = no whitespace</td></tr>
|
||||
<tr><th>format</th>
|
||||
@ -2424,14 +2425,14 @@ nul-terminated and is copied into the new node.</p>
|
||||
<p class="description">New node</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
<p class="discussion">The new text node is added to the end of the specified parent's child
|
||||
list. The constant <code>NULL</code> 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.</p>
|
||||
list. The constant <code>MXML_NO_PARENT</code> 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.</p>
|
||||
<h3 class="function"><a id="mxmlNewXML">mxmlNewXML</a></h3>
|
||||
<p class="description">Create a new XML document tree.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewXML(<span class="reserved">const</span> <span class="reserved">char</span> *version);</p>
|
||||
<a href="#mxml_node_t">mxml_node_t</a> *mxmlNewXML(const char *version);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>version</th>
|
||||
@ -2445,7 +2446,7 @@ nul-terminated and is formatted into the new node.</p>
|
||||
<h3 class="function"><a id="mxmlOptionsDelete">mxmlOptionsDelete</a></h3>
|
||||
<p class="description">Free load/save options.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">void</span> mxmlOptionsDelete(<a href="#mxml_options_t">mxml_options_t</a> *options);</p>
|
||||
void mxmlOptionsDelete(<a href="#mxml_options_t">mxml_options_t</a> *options);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>options</th>
|
||||
@ -2454,7 +2455,7 @@ nul-terminated and is formatted into the new node.</p>
|
||||
<h3 class="function"><a id="mxmlOptionsNew">mxmlOptionsNew</a></h3>
|
||||
<p class="description">Allocate load/save options.</p>
|
||||
<p class="code">
|
||||
<a href="#mxml_options_t">mxml_options_t</a> *mxmlOptionsNew(<span class="reserved">void</span>);</p>
|
||||
<a href="#mxml_options_t">mxml_options_t</a> *mxmlOptionsNew(void);</p>
|
||||
<h4 class="returnvalue">Return Value</h4>
|
||||
<p class="description">Options</p>
|
||||
<h4 class="discussion">Discussion</h4>
|
||||
@ -2487,7 +2488,7 @@ inline text as a series of whitespace-delimited words, instead of using the
|
||||
<h3 class="function"><a id="mxmlOptionsSetCustomCallbacks">mxmlOptionsSetCustomCallbacks</a></h3>
|
||||
<p class="description">Set the custom data callbacks.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">void</span> mxmlOptionsSetCustomCallbacks(<a href="#mxml_options_t">mxml_options_t</a> *options, <a href="#mxml_custload_cb_t">mxml_custload_cb_t</a> load_cb, <a href="#mxml_custsave_cb_t">mxml_custsave_cb_t</a> save_cb, <span class="reserved">void</span> *cbdata);</p>
|
||||
void mxmlOptionsSetCustomCallbacks(<a href="#mxml_options_t">mxml_options_t</a> *options, <a href="#mxml_custload_cb_t">mxml_custload_cb_t</a> load_cb, <a href="#mxml_custsave_cb_t">mxml_custsave_cb_t</a> save_cb, void *cbdata);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>options</th>
|
||||
@ -2595,7 +2596,7 @@ my_custom_save_cb(void *cbdata, mxml_node_t *node)
|
||||
<h3 class="function"><a id="mxmlOptionsSetEntityCallback">mxmlOptionsSetEntityCallback</a></h3>
|
||||
<p class="description">Set the entity lookup callback to use when loading XML data.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">void</span> mxmlOptionsSetEntityCallback(<a href="#mxml_options_t">mxml_options_t</a> *options, <a href="#mxml_entity_cb_t">mxml_entity_cb_t</a> cb, <span class="reserved">void</span> *cbdata);</p>
|
||||
void mxmlOptionsSetEntityCallback(<a href="#mxml_options_t">mxml_options_t</a> *options, <a href="#mxml_entity_cb_t">mxml_entity_cb_t</a> cb, void *cbdata);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>options</th>
|
||||
@ -2630,7 +2631,7 @@ entities which are required by the base XML specification.</pre>
|
||||
<h3 class="function"><a id="mxmlOptionsSetErrorCallback">mxmlOptionsSetErrorCallback</a></h3>
|
||||
<p class="description">Set the error message callback.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">void</span> mxmlOptionsSetErrorCallback(<a href="#mxml_options_t">mxml_options_t</a> *options, <a href="#mxml_error_cb_t">mxml_error_cb_t</a> cb, <span class="reserved">void</span> *cbdata);</p>
|
||||
void mxmlOptionsSetErrorCallback(<a href="#mxml_options_t">mxml_options_t</a> *options, <a href="#mxml_error_cb_t">mxml_error_cb_t</a> cb, void *cbdata);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>options</th>
|
||||
@ -2659,7 +2660,7 @@ ack supports the "euro" entity:<br>
|
||||
<h3 class="function"><a id="mxmlOptionsSetSAXCallback">mxmlOptionsSetSAXCallback</a></h3>
|
||||
<p class="description">Set the SAX callback to use when reading XML data.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">void</span> mxmlOptionsSetSAXCallback(<a href="#mxml_options_t">mxml_options_t</a> *options, <a href="#mxml_sax_cb_t">mxml_sax_cb_t</a> cb, <span class="reserved">void</span> *cbdata);</p>
|
||||
void mxmlOptionsSetSAXCallback(<a href="#mxml_options_t">mxml_options_t</a> *options, <a href="#mxml_sax_cb_t">mxml_sax_cb_t</a> cb, void *cbdata);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>options</th>
|
||||
@ -2706,7 +2707,7 @@ using the [mxmlRetain](@@) function.</pre>
|
||||
<h3 class="function"><a id="mxmlOptionsSetTypeCallback">mxmlOptionsSetTypeCallback</a></h3>
|
||||
<p class="description">Set the type callback for child/value nodes.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">void</span> mxmlOptionsSetTypeCallback(<a href="#mxml_options_t">mxml_options_t</a> *options, <a href="#mxml_type_cb_t">mxml_type_cb_t</a> cb, <span class="reserved">void</span> *cbdata);</p>
|
||||
void mxmlOptionsSetTypeCallback(<a href="#mxml_options_t">mxml_options_t</a> *options, <a href="#mxml_type_cb_t">mxml_type_cb_t</a> cb, void *cbdata);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>options</th>
|
||||
@ -2751,7 +2752,7 @@ my_type_cb(void <em>cbdata, mxml_node_t </em>node)
|
||||
<h3 class="function"><a id="mxmlOptionsSetTypeValue">mxmlOptionsSetTypeValue</a></h3>
|
||||
<p class="description">Set the type to use for all child/value nodes.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">void</span> mxmlOptionsSetTypeValue(<a href="#mxml_options_t">mxml_options_t</a> *options, <a href="#mxml_type_t">mxml_type_t</a> type);</p>
|
||||
void mxmlOptionsSetTypeValue(<a href="#mxml_options_t">mxml_options_t</a> *options, <a href="#mxml_type_t">mxml_type_t</a> type);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>options</th>
|
||||
@ -2764,7 +2765,7 @@ my_type_cb(void <em>cbdata, mxml_node_t </em>node)
|
||||
<h3 class="function"><a id="mxmlOptionsSetWhitespaceCallback">mxmlOptionsSetWhitespaceCallback</a></h3>
|
||||
<p class="description">Set the whitespace callback.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">void</span> mxmlOptionsSetWhitespaceCallback(<a href="#mxml_options_t">mxml_options_t</a> *options, <a href="#mxml_ws_cb_t">mxml_ws_cb_t</a> cb, <span class="reserved">void</span> *cbdata);</p>
|
||||
void mxmlOptionsSetWhitespaceCallback(<a href="#mxml_options_t">mxml_options_t</a> *options, <a href="#mxml_ws_cb_t">mxml_ws_cb_t</a> cb, void *cbdata);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>options</th>
|
||||
@ -2793,7 +2794,7 @@ const char <em>my_whitespace_cb(void </em>cbdata, mxml_node_t *node, mxml_ws_t w
|
||||
<h3 class="function"><a id="mxmlOptionsSetWrapMargin">mxmlOptionsSetWrapMargin</a></h3>
|
||||
<p class="description">Set the wrap margin when saving XML data.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">void</span> mxmlOptionsSetWrapMargin(<a href="#mxml_options_t">mxml_options_t</a> *options, <span class="reserved">int</span> column);</p>
|
||||
void mxmlOptionsSetWrapMargin(<a href="#mxml_options_t">mxml_options_t</a> *options, int column);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>options</th>
|
||||
@ -2807,7 +2808,7 @@ disabled when <code>column</code> is <code>0</code>.</p>
|
||||
<h3 class="function"><a id="mxmlRelease">mxmlRelease</a></h3>
|
||||
<p class="description">Release a node.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">int</span> mxmlRelease(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
int mxmlRelease(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -2821,7 +2822,7 @@ is deleted via <a href="#mxmlDelete"><code>mxmlDelete</code></a>.</p>
|
||||
<h3 class="function"><a id="mxmlRemove">mxmlRemove</a></h3>
|
||||
<p class="description">Remove a node from its parent.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">void</span> mxmlRemove(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
void mxmlRemove(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -2833,7 +2834,7 @@ for that. This function does nothing if the node has no parent.</p>
|
||||
<h3 class="function"><a id="mxmlRetain">mxmlRetain</a></h3>
|
||||
<p class="description">Retain a node.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">int</span> mxmlRetain(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
int mxmlRetain(<a href="#mxml_node_t">mxml_node_t</a> *node);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -2844,7 +2845,7 @@ for that. This function does nothing if the node has no parent.</p>
|
||||
<h3 class="function"><a id="mxmlSaveAllocString">mxmlSaveAllocString</a></h3>
|
||||
<p class="description">Save an XML tree to an allocated string.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">char</span> *mxmlSaveAllocString(<a href="#mxml_node_t">mxml_node_t</a> *node, <a href="#mxml_options_t">mxml_options_t</a> *options);</p>
|
||||
char *mxmlSaveAllocString(<a href="#mxml_node_t">mxml_node_t</a> *node, <a href="#mxml_options_t">mxml_options_t</a> *options);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -2868,7 +2869,7 @@ output will be wrapped at column 72 with no additional whitespace. Use the
|
||||
<h3 class="function"><a id="mxmlSaveFd">mxmlSaveFd</a></h3>
|
||||
<p class="description">Save an XML tree to a file descriptor.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSaveFd(<a href="#mxml_node_t">mxml_node_t</a> *node, <a href="#mxml_options_t">mxml_options_t</a> *options, <span class="reserved">int</span> fd);</p>
|
||||
bool mxmlSaveFd(<a href="#mxml_node_t">mxml_node_t</a> *node, <a href="#mxml_options_t">mxml_options_t</a> *options, int fd);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -2889,7 +2890,7 @@ output will be wrapped at column 72 with no additional whitespace. Use the
|
||||
<h3 class="function"><a id="mxmlSaveFile">mxmlSaveFile</a></h3>
|
||||
<p class="description">Save an XML tree to a file.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSaveFile(<a href="#mxml_node_t">mxml_node_t</a> *node, <a href="#mxml_options_t">mxml_options_t</a> *options, FILE *fp);</p>
|
||||
bool mxmlSaveFile(<a href="#mxml_node_t">mxml_node_t</a> *node, <a href="#mxml_options_t">mxml_options_t</a> *options, FILE *fp);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -2910,7 +2911,7 @@ output will be wrapped at column 72 with no additional whitespace. Use the
|
||||
<h3 class="function"><a id="mxmlSaveFilename">mxmlSaveFilename</a></h3>
|
||||
<p class="description">Save an XML tree to a file.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSaveFilename(<a href="#mxml_node_t">mxml_node_t</a> *node, <a href="#mxml_options_t">mxml_options_t</a> *options, <span class="reserved">const</span> <span class="reserved">char</span> *filename);</p>
|
||||
bool mxmlSaveFilename(<a href="#mxml_node_t">mxml_node_t</a> *node, <a href="#mxml_options_t">mxml_options_t</a> *options, const char *filename);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -2931,7 +2932,7 @@ output will be wrapped at column 72 with no additional whitespace. Use the
|
||||
<h3 class="function"><a id="mxmlSaveIO">mxmlSaveIO</a></h3>
|
||||
<p class="description">Save an XML tree using a callback.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSaveIO(<a href="#mxml_node_t">mxml_node_t</a> *node, <a href="#mxml_options_t">mxml_options_t</a> *options, <a href="#mxml_io_cb_t">mxml_io_cb_t</a> io_cb, <span class="reserved">void</span> *io_cbdata);</p>
|
||||
bool mxmlSaveIO(<a href="#mxml_node_t">mxml_node_t</a> *node, <a href="#mxml_options_t">mxml_options_t</a> *options, <a href="#mxml_io_cb_t">mxml_io_cb_t</a> io_cb, void *io_cbdata);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -2971,7 +2972,7 @@ output will be wrapped at column 72 with no additional whitespace. Use the
|
||||
<h3 class="function"><a id="mxmlSaveString">mxmlSaveString</a></h3>
|
||||
<p class="description">Save an XML node tree to a string.</p>
|
||||
<p class="code">
|
||||
size_t mxmlSaveString(<a href="#mxml_node_t">mxml_node_t</a> *node, <a href="#mxml_options_t">mxml_options_t</a> *options, <span class="reserved">char</span> *buffer, size_t bufsize);</p>
|
||||
size_t mxmlSaveString(<a href="#mxml_node_t">mxml_node_t</a> *node, <a href="#mxml_options_t">mxml_options_t</a> *options, char *buffer, size_t bufsize);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -2994,7 +2995,7 @@ output will be wrapped at column 72 with no additional whitespace. Use the
|
||||
<h3 class="function"><a id="mxmlSetCDATA">mxmlSetCDATA</a></h3>
|
||||
<p class="description">Set the data for a CDATA node.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSetCDATA(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">const</span> <span class="reserved">char</span> *data);</p>
|
||||
bool mxmlSetCDATA(<a href="#mxml_node_t">mxml_node_t</a> *node, const char *data);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -3010,7 +3011,7 @@ changed if it (or its first child) is not a CDATA node.</p>
|
||||
<h3 class="function"><a id="mxmlSetCDATAf">mxmlSetCDATAf</a></h3>
|
||||
<p class="description">Set the data for a CDATA to a formatted string.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSetCDATAf(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
|
||||
bool mxmlSetCDATAf(<a href="#mxml_node_t">mxml_node_t</a> *node, const char *format, ...);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -3028,7 +3029,7 @@ not changed if it (or its first child) is not a CDATA node.</p>
|
||||
<h3 class="function"><a id="mxmlSetComment">mxmlSetComment</a></h3>
|
||||
<p class="description">Set a comment to a literal string.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSetComment(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">const</span> <span class="reserved">char</span> *comment);</p>
|
||||
bool mxmlSetComment(<a href="#mxml_node_t">mxml_node_t</a> *node, const char *comment);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -3043,7 +3044,7 @@ not changed if it (or its first child) is not a CDATA node.</p>
|
||||
<h3 class="function"><a id="mxmlSetCommentf">mxmlSetCommentf</a></h3>
|
||||
<p class="description">Set a comment to a formatted string.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSetCommentf(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
|
||||
bool mxmlSetCommentf(<a href="#mxml_node_t">mxml_node_t</a> *node, const char *format, ...);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -3060,7 +3061,7 @@ not changed if it (or its first child) is not a CDATA node.</p>
|
||||
<h3 class="function"><a id="mxmlSetCustom">mxmlSetCustom</a></h3>
|
||||
<p class="description">Set the data and destructor of a custom data node.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSetCustom(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">void</span> *data, <a href="#mxml_custfree_cb_t">mxml_custfree_cb_t</a> free_cb, <span class="reserved">void</span> *free_cbdata);</p>
|
||||
bool mxmlSetCustom(<a href="#mxml_node_t">mxml_node_t</a> *node, void *data, <a href="#mxml_custfree_cb_t">mxml_custfree_cb_t</a> free_cb, void *free_cbdata);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -3081,7 +3082,7 @@ first child) is not a custom node.</p>
|
||||
<h3 class="function"><a id="mxmlSetDeclaration">mxmlSetDeclaration</a></h3>
|
||||
<p class="description">Set a declaration to a literal string.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSetDeclaration(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">const</span> <span class="reserved">char</span> *declaration);</p>
|
||||
bool mxmlSetDeclaration(<a href="#mxml_node_t">mxml_node_t</a> *node, const char *declaration);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -3096,7 +3097,7 @@ first child) is not a custom node.</p>
|
||||
<h3 class="function"><a id="mxmlSetDeclarationf">mxmlSetDeclarationf</a></h3>
|
||||
<p class="description">Set a declaration to a formatted string.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSetDeclarationf(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
|
||||
bool mxmlSetDeclarationf(<a href="#mxml_node_t">mxml_node_t</a> *node, const char *format, ...);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -3113,7 +3114,7 @@ first child) is not a custom node.</p>
|
||||
<h3 class="function"><a id="mxmlSetDirective">mxmlSetDirective</a></h3>
|
||||
<p class="description">Set a processing instruction to a literal string.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSetDirective(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">const</span> <span class="reserved">char</span> *directive);</p>
|
||||
bool mxmlSetDirective(<a href="#mxml_node_t">mxml_node_t</a> *node, const char *directive);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -3128,7 +3129,7 @@ first child) is not a custom node.</p>
|
||||
<h3 class="function"><a id="mxmlSetDirectivef">mxmlSetDirectivef</a></h3>
|
||||
<p class="description">Set a processing instruction to a formatted string.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSetDirectivef(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
|
||||
bool mxmlSetDirectivef(<a href="#mxml_node_t">mxml_node_t</a> *node, const char *format, ...);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -3146,7 +3147,7 @@ node.</p>
|
||||
<h3 class="function"><a id="mxmlSetElement">mxmlSetElement</a></h3>
|
||||
<p class="description">Set the name of an element node.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSetElement(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">const</span> <span class="reserved">char</span> *name);</p>
|
||||
bool mxmlSetElement(<a href="#mxml_node_t">mxml_node_t</a> *node, const char *name);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -3162,7 +3163,7 @@ it is not an element node.</p>
|
||||
<h3 class="function"><a id="mxmlSetInteger">mxmlSetInteger</a></h3>
|
||||
<p class="description">Set the value of an integer node.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSetInteger(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">long</span> integer);</p>
|
||||
bool mxmlSetInteger(<a href="#mxml_node_t">mxml_node_t</a> *node, long integer);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -3178,7 +3179,7 @@ it (or its first child) is not an integer node.</p>
|
||||
<h3 class="function"><a id="mxmlSetOpaque">mxmlSetOpaque</a></h3>
|
||||
<p class="description">Set the value of an opaque node.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSetOpaque(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">const</span> <span class="reserved">char</span> *opaque);</p>
|
||||
bool mxmlSetOpaque(<a href="#mxml_node_t">mxml_node_t</a> *node, const char *opaque);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -3194,7 +3195,7 @@ changed if it (or its first child) is not an opaque node.</p>
|
||||
<h3 class="function"><a id="mxmlSetOpaquef">mxmlSetOpaquef</a></h3>
|
||||
<p class="description">Set the value of an opaque string node to a formatted string.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSetOpaquef(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
|
||||
bool mxmlSetOpaquef(<a href="#mxml_node_t">mxml_node_t</a> *node, const char *format, ...);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -3212,7 +3213,7 @@ not changed if it (or its first child) is not an opaque node.</p>
|
||||
<h3 class="function"><a id="mxmlSetReal">mxmlSetReal</a></h3>
|
||||
<p class="description">Set the value of a real value node.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSetReal(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">double</span> real);</p>
|
||||
bool mxmlSetReal(<a href="#mxml_node_t">mxml_node_t</a> *node, double real);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -3228,7 +3229,7 @@ if it (or its first child) is not a real value node.</p>
|
||||
<h3 class="function"><a id="mxmlSetText">mxmlSetText</a></h3>
|
||||
<p class="description">Set the value of a text node.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSetText(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">bool</span> whitespace, <span class="reserved">const</span> <span class="reserved">char</span> *string);</p>
|
||||
bool mxmlSetText(<a href="#mxml_node_t">mxml_node_t</a> *node, bool whitespace, const char *string);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -3246,7 +3247,7 @@ is not changed if it (or its first child) is not a text node.</p>
|
||||
<h3 class="function"><a id="mxmlSetTextf">mxmlSetTextf</a></h3>
|
||||
<p class="description">Set the value of a text node to a formatted string.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSetTextf(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">bool</span> whitespace, <span class="reserved">const</span> <span class="reserved">char</span> *format, ...);</p>
|
||||
bool mxmlSetTextf(<a href="#mxml_node_t">mxml_node_t</a> *node, bool whitespace, const char *format, ...);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
@ -3266,7 +3267,7 @@ The node is not changed if it (or its first child) is not a text node.</p>
|
||||
<h3 class="function"><a id="mxmlSetUserData">mxmlSetUserData</a></h3>
|
||||
<p class="description">Set the user data pointer for a node.</p>
|
||||
<p class="code">
|
||||
<span class="reserved">bool</span> mxmlSetUserData(<a href="#mxml_node_t">mxml_node_t</a> *node, <span class="reserved">void</span> *data);</p>
|
||||
bool mxmlSetUserData(<a href="#mxml_node_t">mxml_node_t</a> *node, void *data);</p>
|
||||
<h4 class="parameters">Parameters</h4>
|
||||
<table class="list"><tbody>
|
||||
<tr><th>node</th>
|
||||
|
394
linux/Makefile
394
linux/Makefile
@ -1,394 +0,0 @@
|
||||
#
|
||||
# Linux makefile for Mini-XML, a small XML-like file parsing library.
|
||||
#
|
||||
# https://www.msweet.org/mxml
|
||||
#
|
||||
# Copyright © 2003-2024 by Michael R Sweet.
|
||||
#
|
||||
# Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
# information.
|
||||
#
|
||||
|
||||
#
|
||||
# This is a POSIX makefile
|
||||
#
|
||||
|
||||
.POSIX:
|
||||
|
||||
|
||||
#
|
||||
# Mini-XML version...
|
||||
#
|
||||
|
||||
MXML_VERSION = 4.0.4
|
||||
|
||||
|
||||
#
|
||||
# Programs...
|
||||
#
|
||||
|
||||
AR = /usr/bin/ar
|
||||
CC = gcc
|
||||
DSO = $(CC)
|
||||
INSTALL = /home/mike/c/mxml/install-sh
|
||||
LN = /usr/bin/ln -sf
|
||||
MKDIR = /usr/bin/mkdir -p
|
||||
RANLIB = ranlib
|
||||
RM = /usr/bin/rm -f
|
||||
RMDIR = /usr/bin/rmdir
|
||||
SHELL = /bin/sh
|
||||
|
||||
|
||||
#
|
||||
# Installation programs...
|
||||
#
|
||||
|
||||
INSTALL_BIN = $(INSTALL) -c -m 755
|
||||
INSTALL_DATA = $(INSTALL) -c -m 444
|
||||
INSTALL_DIR = $(INSTALL) -d -m 755
|
||||
INSTALL_LIB = $(INSTALL) -c -m 755
|
||||
INSTALL_MAN = $(INSTALL) -c -m 444
|
||||
|
||||
|
||||
#
|
||||
# Libraries...
|
||||
#
|
||||
|
||||
LIBMXML = libmxml4.so.2
|
||||
LIBMXML_BASE = libmxml4
|
||||
LIBMXML_STATIC = libmxml4.a
|
||||
MXML_MAN = mxml4.3
|
||||
MXML_PC = mxml4.pc
|
||||
|
||||
|
||||
#
|
||||
# Install static libraries?
|
||||
#
|
||||
|
||||
INSTALL_STATIC = install-libmxml4.a
|
||||
|
||||
|
||||
#
|
||||
# Code signing...
|
||||
#
|
||||
|
||||
CODE_SIGN = /usr/bin/true
|
||||
CODESIGN_IDENTITY = -
|
||||
CSFLAGS = -s "$(CODESIGN_IDENTITY)" -o runtime --timestamp
|
||||
|
||||
|
||||
#
|
||||
# Library archiver...
|
||||
#
|
||||
|
||||
ARFLAGS = cr
|
||||
|
||||
|
||||
#
|
||||
# C compiler and preprocessor...
|
||||
#
|
||||
|
||||
CFLAGS = -fPIC $(CPPFLAGS) $(OPTIM) $(WARNINGS)
|
||||
CPPFLAGS = -D_THREAD_SAFE -D_REENTRANT -D_FORTIFY_SOURCE=3 -D__USE_MISC -D_GNU_SOURCE
|
||||
WARNINGS = -Wall -Wunused -Wno-char-subscripts -Wno-deprecated-declarations -Wno-format-truncation -Wno-format-y2k -Wno-switch -Wno-unused-result
|
||||
|
||||
|
||||
#
|
||||
# Linker options...
|
||||
#
|
||||
|
||||
DSOFLAGS = -Wl,-soname,`basename $@` -shared $(OPTIM)
|
||||
LDFLAGS = -fPIE -pie -Wl,-z,relro,-z,now $(OPTIM)
|
||||
LIBS = -lpthread -lm
|
||||
|
||||
|
||||
#
|
||||
# Optimization and architecture options for both the compiler and linker.
|
||||
#
|
||||
|
||||
OPTIM = -g -Os
|
||||
|
||||
|
||||
#
|
||||
# Directories...
|
||||
#
|
||||
|
||||
bindir = ${exec_prefix}/bin
|
||||
datadir = ${datarootdir}
|
||||
datarootdir = ${prefix}/share
|
||||
docdir = ${prefix}/share/doc/mxml4
|
||||
exec_prefix = ${prefix}
|
||||
includedir = ${prefix}/include/libmxml4
|
||||
infodir = ${datarootdir}/info
|
||||
libdir = ${exec_prefix}/lib
|
||||
libexecdir = ${exec_prefix}/libexec
|
||||
localstatedir = ${prefix}/var
|
||||
mandir = ${datarootdir}/man
|
||||
oldincludedir = /usr/include
|
||||
prefix = /usr/local
|
||||
sbindir = ${exec_prefix}/sbin
|
||||
sharedstatedir = ${prefix}/com
|
||||
srcdir = .
|
||||
sysconfdir = ${prefix}/etc
|
||||
top_srcdir = .
|
||||
|
||||
BUILDROOT = $(DSTROOT)$(DESTDIR)
|
||||
|
||||
|
||||
#
|
||||
# Silent build...
|
||||
#
|
||||
|
||||
.SILENT:
|
||||
|
||||
|
||||
#
|
||||
# Targets...
|
||||
#
|
||||
|
||||
DOCFILES = doc/mxml.epub doc/mxml.html doc/mxml-cover.png \
|
||||
CHANGES.md LICENSE NOTICE README.md
|
||||
PUBLIBOBJS = mxml-attr.o mxml-file.o mxml-get.o mxml-index.o \
|
||||
mxml-node.o mxml-options.o mxml-search.o mxml-set.o
|
||||
LIBOBJS = $(PUBLIBOBJS) mxml-private.o
|
||||
OBJS = testmxml.o $(LIBOBJS)
|
||||
ALLTARGETS = $(LIBMXML) testmxml
|
||||
CROSSTARGETS = $(LIBMXML)
|
||||
TARGETS = $(ALLTARGETS)
|
||||
|
||||
|
||||
#
|
||||
# Make everything...
|
||||
#
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
|
||||
#
|
||||
# Clean everything...
|
||||
#
|
||||
|
||||
clean:
|
||||
echo Cleaning build files...
|
||||
$(RM) $(OBJS) $(ALLTARGETS)
|
||||
$(RM) libmxml4.a
|
||||
$(RM) libmxml4.so
|
||||
$(RM) libmxml4.so.2
|
||||
|
||||
|
||||
#
|
||||
# Really clean everything...
|
||||
#
|
||||
|
||||
distclean: clean
|
||||
echo Cleaning distribution files...
|
||||
$(RM) test.xmlfd
|
||||
$(RM) temp1.xml temp1.xmlfd temp1s.xml
|
||||
$(RM) temp2.xml temp2s.xml
|
||||
$(RM) -r clang
|
||||
|
||||
|
||||
#
|
||||
# Install everything...
|
||||
#
|
||||
|
||||
.NOTPARALLEL: install install-$(LIBMXML) $(INSTALL_STATIC)
|
||||
|
||||
install: $(TARGETS) install-$(LIBMXML) $(INSTALL_STATIC)
|
||||
echo Installing documentation in $(BUILDROOT)$(docdir)...
|
||||
$(INSTALL_DIR) $(BUILDROOT)$(docdir)
|
||||
for file in $(DOCFILES); do \
|
||||
$(INSTALL_MAN) ../$$file $(BUILDROOT)$(docdir)/`basename $$file .md`; \
|
||||
done
|
||||
echo Installing header files in $(BUILDROOT)$(includedir)...
|
||||
$(INSTALL_DIR) $(BUILDROOT)$(includedir)
|
||||
$(INSTALL_DATA) ../mxml.h $(BUILDROOT)$(includedir)
|
||||
echo Installing pkgconfig files in $(BUILDROOT)$(libdir)/pkgconfig...
|
||||
$(INSTALL_DIR) $(BUILDROOT)$(libdir)/pkgconfig
|
||||
$(INSTALL_DATA) mxml4.pc $(BUILDROOT)$(libdir)/pkgconfig/$(MXML_PC)
|
||||
echo Installing man pages in $(BUILDROOT)$(mandir)...
|
||||
$(INSTALL_DIR) $(BUILDROOT)$(mandir)/man3
|
||||
$(INSTALL_MAN) ../doc/mxml.3 $(BUILDROOT)$(mandir)/man3/$(MXML_MAN)
|
||||
|
||||
install-libmxml.a: libmxml.a
|
||||
echo Installing libmxml.a to $(BUILDROOT)$(libdir)...
|
||||
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
|
||||
$(INSTALL_LIB) libmxml.a $(BUILDROOT)$(libdir)
|
||||
$(RANLIB) $(BUILDROOT)$(libdir)/libmxml.a
|
||||
|
||||
install-libmxml.so.2: libmxml.so.2
|
||||
echo Installing libmxml.so to $(BUILDROOT)$(libdir)...
|
||||
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
|
||||
$(INSTALL_LIB) libmxml.so.2 $(BUILDROOT)$(libdir)
|
||||
$(RM) $(BUILDROOT)$(libdir)/libmxml.so
|
||||
$(LN) libmxml.so.2 $(BUILDROOT)$(libdir)/libmxml.so
|
||||
$(LDCONFIG)
|
||||
|
||||
install-libmxml4.a: libmxml4.a
|
||||
echo Installing libmxml4.a to $(BUILDROOT)$(libdir)...
|
||||
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
|
||||
$(INSTALL_LIB) libmxml4.a $(BUILDROOT)$(libdir)
|
||||
$(RANLIB) $(BUILDROOT)$(libdir)/libmxml4.a
|
||||
|
||||
install-libmxml4.so.2: libmxml4.so.2
|
||||
echo Installing libmxml4.so to $(BUILDROOT)$(libdir)...
|
||||
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
|
||||
$(INSTALL_LIB) libmxml4.so.2 $(BUILDROOT)$(libdir)
|
||||
$(RM) $(BUILDROOT)$(libdir)/libmxml4.so
|
||||
$(LN) libmxml4.so.2 $(BUILDROOT)$(libdir)/libmxml4.so
|
||||
$(LDCONFIG)
|
||||
|
||||
|
||||
#
|
||||
# Uninstall everything...
|
||||
#
|
||||
|
||||
uninstall: uninstall-$(LIBMXML) uninstall-libmxml4.a
|
||||
echo Uninstalling documentation from $(BUILDROOT)$(docdir)...
|
||||
$(RM) -r $(BUILDROOT)$(docdir)
|
||||
echo Uninstalling headers from $(BUILDROOT)$(includedir)...
|
||||
$(RM) $(BUILDROOT)$(includedir)/mxml.h
|
||||
echo Uninstalling pkgconfig files from $(BUILDROOT)$(libdir)/pkgconfig...
|
||||
$(RM) $(BUILDROOT)$(libdir)/pkgconfig/$(MXML_PC)
|
||||
echo Uninstalling man pages from $(BUILDROOT)$(mandir)...
|
||||
$(RM) $(BUILDROOT)$(mandir)/man3/$(MXML_MAN)
|
||||
|
||||
uninstall-libmxml.a:
|
||||
echo Uninstalling libmxml.a from $(BUILDROOT)$(libdir)...
|
||||
$(RM) $(BUILDROOT)$(libdir)/libmxml.a
|
||||
|
||||
uninstall-libmxml.so.2:
|
||||
echo Uninstalling libmxml.so from $(BUILDROOT)$(libdir)...
|
||||
$(RM) $(BUILDROOT)$(libdir)/libmxml.so
|
||||
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.2
|
||||
$(LDCONFIG)
|
||||
|
||||
uninstall-libmxml4.a:
|
||||
echo Uninstalling libmxml4.a from $(BUILDROOT)$(libdir)...
|
||||
$(RM) $(BUILDROOT)$(libdir)/libmxml4.a
|
||||
|
||||
uninstall-libmxml4.so.2:
|
||||
echo Uninstalling libmxml4.so from $(BUILDROOT)$(libdir)...
|
||||
$(RM) $(BUILDROOT)$(libdir)/libmxml4.so
|
||||
$(RM) $(BUILDROOT)$(libdir)/libmxml4.so.2
|
||||
$(LDCONFIG)
|
||||
|
||||
|
||||
#
|
||||
# Test everything...
|
||||
#
|
||||
|
||||
test: testmxml
|
||||
@echo Testing library...
|
||||
./testmxml ../test.xml temp1s.xml >temp1.xml
|
||||
./testmxml temp1.xml temp2s.xml >temp2.xml
|
||||
@if cmp temp1.xml temp2.xml; then \
|
||||
echo Stdio file test passed!; \
|
||||
$(RM) temp2.xml temp2s.xml; \
|
||||
else \
|
||||
echo Stdio file test failed!; \
|
||||
exit 1; \
|
||||
fi
|
||||
@if cmp temp1.xml temp1s.xml; then \
|
||||
echo String test passed!; \
|
||||
$(RM) temp1.xml temp1s.xml; \
|
||||
else \
|
||||
echo String test failed!; \
|
||||
exit 1; \
|
||||
fi
|
||||
@if cmp ../test.xml ../test.xmlfd; then \
|
||||
echo File descriptor test passed!; \
|
||||
$(RM) test.xmlfd temp1.xmlfd; \
|
||||
else \
|
||||
echo File descriptor test failed!; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# libmxml.a
|
||||
#
|
||||
|
||||
libmxml.a libmxml4.a: $(LIBOBJS)
|
||||
echo Creating $@...
|
||||
$(RM) $@
|
||||
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
|
||||
#
|
||||
# libmxml.so.2
|
||||
#
|
||||
|
||||
libmxml.so.2 libmxml4.so.2: $(LIBOBJS)
|
||||
echo Creating $@...
|
||||
$(DSO) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
|
||||
$(RM) `basename $@ .2`
|
||||
$(LN) $@ `basename $@ .2`
|
||||
|
||||
|
||||
#
|
||||
# testmxml
|
||||
#
|
||||
|
||||
testmxml: $(LIBMXML_STATIC) testmxml.o
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testmxml.o $(LIBMXML_STATIC) $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
# Documentation (depends on separate codedoc utility)
|
||||
#
|
||||
|
||||
.PHONY: doc
|
||||
doc: ../mxml.h $(PUBLIBOBJS:.o=.c) \
|
||||
../doc/body.md ../doc/body.man ../doc/footer.man \
|
||||
../doc/mxml-cover.png
|
||||
echo Generating API documentation...
|
||||
$(RM) mxml.xml
|
||||
codedoc --body ../doc/body.md \
|
||||
--coverimage ../doc/mxml-cover.png \
|
||||
mxml.xml mxml.h $(PUBLIBOBJS:.o=.c) >../doc/mxml.html
|
||||
codedoc --body ../doc/body.md \
|
||||
--coverimage ../doc/mxml-cover.png \
|
||||
--epub ../doc/mxml.epub mxml.xml
|
||||
codedoc --man mxml --title "Mini-XML API" \
|
||||
--body ../doc/body.man --footer ../doc/footer.man \
|
||||
mxml.xml >../doc/mxml.3
|
||||
$(RM) mxml.xml
|
||||
|
||||
|
||||
#
|
||||
# All object files depend on the makefile and config header...
|
||||
#
|
||||
|
||||
mxml-attr.o: ../mxml-attr.c ../mxml.h ../mxml-private.h Makefile config.h
|
||||
echo Compiling $<
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
mxml-file.o: ../mxml-file.c ../mxml.h ../mxml-private.h Makefile config.h
|
||||
echo Compiling $<
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
mxml-get.o: ../mxml-get.c ../mxml.h ../mxml-private.h Makefile config.h
|
||||
echo Compiling $<
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
mxml-index.o: ../mxml-index.c ../mxml.h ../mxml-private.h Makefile config.h
|
||||
echo Compiling $<
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
mxml-node.o: ../mxml-node.c ../mxml.h ../mxml-private.h Makefile config.h
|
||||
echo Compiling $<
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
mxml-options.o: ../mxml-options.c ../mxml.h ../mxml-private.h Makefile config.h
|
||||
echo Compiling $<
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
mxml-private.o: ../mxml-private.c ../mxml.h ../mxml-private.h Makefile config.h
|
||||
echo Compiling $<
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
mxml-search.o: ../mxml-search.c ../mxml.h ../mxml-private.h Makefile config.h
|
||||
echo Compiling $<
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
mxml-set.o: ../mxml-set.c ../mxml.h ../mxml-private.h Makefile config.h
|
||||
echo Compiling $<
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
testmxml.o: ../testmxml.c ../mxml.h ../mxml-private.h Makefile config.h
|
||||
echo Compiling $<
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
@ -1,42 +0,0 @@
|
||||
//
|
||||
// Linux configuration file for Mini-XML, a small XML file parsing library.
|
||||
//
|
||||
// https://www.msweet.org/mxml
|
||||
//
|
||||
// Copyright © 2003-2024 by Michael R Sweet.
|
||||
//
|
||||
// Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||
// information.
|
||||
//
|
||||
|
||||
#ifndef MXML_CONFIG_H
|
||||
# define MXML_CONFIG_H
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <stdarg.h>
|
||||
# include <ctype.h>
|
||||
|
||||
|
||||
//
|
||||
// Version number
|
||||
//
|
||||
|
||||
# define MXML_VERSION "Mini-XML v4.0.4"
|
||||
|
||||
|
||||
//
|
||||
// Inline function support
|
||||
//
|
||||
|
||||
# define inline
|
||||
|
||||
|
||||
//
|
||||
// Have <pthread.h>?
|
||||
//
|
||||
|
||||
# define HAVE_PTHREAD_H 1
|
||||
|
||||
|
||||
#endif // !MXML_CONFIG_H
|
@ -1,10 +0,0 @@
|
||||
prefix=/usr/local
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/lib
|
||||
includedir=${prefix}/include/libmxml4
|
||||
|
||||
Name: Mini-XML
|
||||
Description: Lightweight XML support library
|
||||
Version: 4.0.4
|
||||
Libs: -lmxml4
|
||||
Cflags: -I${includedir}
|
15
makesrcdist
15
makesrcdist
@ -49,16 +49,6 @@ if ! grep -q "Version: $version" mxml.spec; then
|
||||
status=1
|
||||
fi
|
||||
|
||||
if test "$(grep MXML_VERSION linux/config.h | awk '${print $5}')" != "v$version\""; then
|
||||
echo "Update MXML_VERSION in linux/config.h."
|
||||
status=1
|
||||
fi
|
||||
|
||||
if test "$(grep MXML_VERSION vcnet/config.h | awk '${print $5}')" != "v$version\""; then
|
||||
echo "Update MXML_VERSION in vcnet/config.h."
|
||||
status=1
|
||||
fi
|
||||
|
||||
if ! grep -q "<version>$version</version>" vcnet/libmxml4_native.nuspec; then
|
||||
echo "Update vcnet/libmxml4_native.nuspec."
|
||||
status=1
|
||||
@ -73,11 +63,6 @@ if ! grep -q "<version>$version</version>" vcnet/libmxml4_native.redist.nuspec;
|
||||
status=1
|
||||
fi
|
||||
|
||||
if test "$(grep MXML_VERSION xcode/config.h | awk '${print $5}')" != "v$version\""; then
|
||||
echo "Update MXML_VERSION in xcode/config.h."
|
||||
status=1
|
||||
fi
|
||||
|
||||
if test $status = 1; then
|
||||
exit 1
|
||||
fi
|
||||
|
@ -232,7 +232,7 @@ mxml_set_attr(mxml_node_t *node, // I - Element node
|
||||
const char *name, // I - Attribute name
|
||||
char *value) // I - Attribute value
|
||||
{
|
||||
size_t i; // Looping var
|
||||
int i; // Looping var
|
||||
_mxml_attr_t *attr; // New attribute
|
||||
|
||||
|
||||
|
12
mxml-index.c
12
mxml-index.c
@ -18,7 +18,7 @@
|
||||
|
||||
static int index_compare(mxml_index_t *ind, mxml_node_t *first, mxml_node_t *second);
|
||||
static int index_find(mxml_index_t *ind, const char *element, const char *value, mxml_node_t *node);
|
||||
static void index_sort(mxml_index_t *ind, size_t left, size_t right);
|
||||
static void index_sort(mxml_index_t *ind, int left, int right);
|
||||
|
||||
|
||||
//
|
||||
@ -80,8 +80,8 @@ mxmlIndexFind(mxml_index_t *ind, // I - Index to search
|
||||
const char *element, // I - Element name to find, if any
|
||||
const char *value) // I - Attribute value, if any
|
||||
{
|
||||
int diff; // Difference between names
|
||||
size_t current, // Current entity in search
|
||||
int diff, // Difference between names
|
||||
current, // Current entity in search
|
||||
first, // First entity in search
|
||||
last; // Last entity in search
|
||||
|
||||
@ -369,12 +369,12 @@ index_find(mxml_index_t *ind, // I - Index
|
||||
|
||||
static void
|
||||
index_sort(mxml_index_t *ind, // I - Index to sort
|
||||
size_t left, // I - Left node in partition
|
||||
size_t right) // I - Right node in partition
|
||||
int left, // I - Left node in partition
|
||||
int right) // I - Right node in partition
|
||||
{
|
||||
mxml_node_t *pivot, // Pivot node
|
||||
*temp; // Swap node
|
||||
size_t templ, // Temporary left node
|
||||
int templ, // Temporary left node
|
||||
tempr; // Temporary right node
|
||||
|
||||
|
||||
|
132
mxml-node.c
132
mxml-node.c
@ -186,13 +186,14 @@ mxmlGetRefCount(mxml_node_t *node) // I - Node
|
||||
// 'mxmlNewCDATA()' - Create a new CDATA node.
|
||||
//
|
||||
// The new CDATA node is added to the end of the specified parent's child
|
||||
// list. The constant `NULL` 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.
|
||||
// list. The constant `MXML_NO_PARENT` can be used to specify that the new
|
||||
// CDATA node has no parent. The data string must be nul-terminated and
|
||||
// is copied into the new node. CDATA nodes currently use the
|
||||
// `MXML_TYPE_ELEMENT` type.
|
||||
//
|
||||
|
||||
mxml_node_t * // O - New node
|
||||
mxmlNewCDATA(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
mxmlNewCDATA(mxml_node_t *parent, // I - Parent node or `MXML_NO_PARENT`
|
||||
const char *data) // I - Data string
|
||||
{
|
||||
mxml_node_t *node; // New node
|
||||
@ -221,14 +222,14 @@ mxmlNewCDATA(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
//
|
||||
// 'mxmlNewCDATAf()' - Create a new formatted CDATA node.
|
||||
//
|
||||
// The new CDATA node is added to the end of the specified parent's child list.
|
||||
// The constant `NULL` can be used to specify that the new opaque string node
|
||||
// has no parent. The format string must be nul-terminated and is formatted
|
||||
// into the new node.
|
||||
// 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 opaque string node has no parent. The format string must be
|
||||
// nul-terminated and is formatted into the new node.
|
||||
//
|
||||
|
||||
mxml_node_t * // O - New node
|
||||
mxmlNewCDATAf(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
mxmlNewCDATAf(mxml_node_t *parent, // I - Parent node or `MXML_NO_PARENT`
|
||||
const char *format, // I - Printf-style format string
|
||||
...) // I - Additional args as needed
|
||||
{
|
||||
@ -261,13 +262,13 @@ mxmlNewCDATAf(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
// 'mxmlNewComment()' - Create a new comment node.
|
||||
//
|
||||
// The new comment node is added to the end of the specified parent's child
|
||||
// list. The constant `NULL` can be used to specify that the new comment node
|
||||
// has no parent. The comment string must be nul-terminated and is copied into
|
||||
// the new node.
|
||||
// list. The constant `MXML_NO_PARENT` can be used to specify that the new
|
||||
// comment node has no parent. The comment string must be nul-terminated and
|
||||
// is copied into the new node.
|
||||
//
|
||||
|
||||
mxml_node_t * // O - New node
|
||||
mxmlNewComment(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
mxmlNewComment(mxml_node_t *parent, // I - Parent node or `MXML_NO_PARENT`
|
||||
const char *comment) // I - Comment string
|
||||
{
|
||||
mxml_node_t *node; // New node
|
||||
@ -297,13 +298,13 @@ mxmlNewComment(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
// 'mxmlNewCommentf()' - Create a new formatted comment string node.
|
||||
//
|
||||
// The new comment string node is added to the end of the specified parent's
|
||||
// child list. The constant `NULL` can be used to specify that the new opaque
|
||||
// string node has no parent. The format string must be nul-terminated and is
|
||||
// formatted into the new node.
|
||||
// child list. The constant `MXML_NO_PARENT` can be used to specify that
|
||||
// the new opaque string node has no parent. The format string must be
|
||||
// nul-terminated and is formatted into the new node.
|
||||
//
|
||||
|
||||
mxml_node_t * // O - New node
|
||||
mxmlNewCommentf(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
mxmlNewCommentf(mxml_node_t *parent, // I - Parent node or `MXML_NO_PARENT`
|
||||
const char *format, // I - Printf-style format string
|
||||
...) // I - Additional args as needed
|
||||
{
|
||||
@ -342,7 +343,7 @@ mxmlNewCommentf(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
|
||||
mxml_node_t * // O - New node
|
||||
mxmlNewCustom(
|
||||
mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
mxml_node_t *parent, // I - Parent node or `MXML_NO_PARENT`
|
||||
void *data, // I - Pointer to data
|
||||
mxml_custfree_cb_t free_cb, // I - Free callback function or `NULL` if none needed
|
||||
void *free_cbdata) // I - Free callback data
|
||||
@ -368,14 +369,14 @@ mxmlNewCustom(
|
||||
// 'mxmlNewDeclaration()' - Create a new declaraction node.
|
||||
//
|
||||
// The new declaration node is added to the end of the specified parent's child
|
||||
// list. The constant `NULL` can be used to specify that the new
|
||||
// list. The constant `MXML_NO_PARENT` can be used to specify that the new
|
||||
// declaration node has no parent. The declaration string must be nul-
|
||||
// terminated and is copied into the new node.
|
||||
//
|
||||
|
||||
mxml_node_t * // O - New node
|
||||
mxmlNewDeclaration(
|
||||
mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
mxml_node_t *parent, // I - Parent node or `MXML_NO_PARENT`
|
||||
const char *declaration) // I - Declaration string
|
||||
{
|
||||
mxml_node_t *node; // New node
|
||||
@ -405,14 +406,14 @@ mxmlNewDeclaration(
|
||||
// 'mxmlNewDeclarationf()' - Create a new formatted declaration node.
|
||||
//
|
||||
// The new declaration node is added to the end of the specified parent's
|
||||
// child list. The constant `NULL` can be used to specify that
|
||||
// child list. The constant `MXML_NO_PARENT` can be used to specify that
|
||||
// the new opaque string node has no parent. The format string must be
|
||||
// nul-terminated and is formatted into the new node.
|
||||
//
|
||||
|
||||
mxml_node_t * // O - New node
|
||||
mxmlNewDeclarationf(
|
||||
mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
mxml_node_t *parent, // I - Parent node or `MXML_NO_PARENT`
|
||||
const char *format, // I - Printf-style format string
|
||||
...) // I - Additional args as needed
|
||||
{
|
||||
@ -445,13 +446,13 @@ mxmlNewDeclarationf(
|
||||
// 'mxmlNewDirective()' - Create a new processing instruction node.
|
||||
//
|
||||
// The new processing instruction node is added to the end of the specified
|
||||
// parent's child list. The constant `NULL` can be used to specify that the new
|
||||
// processing instruction node has no parent. The data string must be
|
||||
// nul-terminated and is copied into the new node.
|
||||
// parent's child list. The constant `MXML_NO_PARENT` can be used to specify
|
||||
// that the new processing instruction node has no parent. The data string must
|
||||
// be nul-terminated and is copied into the new node.
|
||||
//
|
||||
|
||||
mxml_node_t * // O - New node
|
||||
mxmlNewDirective(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
mxmlNewDirective(mxml_node_t *parent, // I - Parent node or `MXML_NO_PARENT`
|
||||
const char *directive)// I - Directive string
|
||||
{
|
||||
mxml_node_t *node; // New node
|
||||
@ -480,14 +481,14 @@ mxmlNewDirective(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
//
|
||||
// 'mxmlNewDirectivef()' - Create a new formatted processing instruction node.
|
||||
//
|
||||
// The new processing instruction node is added to the end of the specified
|
||||
// parent's child list. The constant `NULL` can be used to specify that the new
|
||||
// opaque string node has no parent. The format string must be
|
||||
// The new processing instruction node is added to the end of the specified parent's
|
||||
// child list. The constant `MXML_NO_PARENT` can be used to specify that
|
||||
// the new opaque string node has no parent. The format string must be
|
||||
// nul-terminated and is formatted into the new node.
|
||||
//
|
||||
|
||||
mxml_node_t * // O - New node
|
||||
mxmlNewDirectivef(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
mxmlNewDirectivef(mxml_node_t *parent, // I - Parent node or `MXML_NO_PARENT`
|
||||
const char *format, // I - Printf-style format string
|
||||
...) // I - Additional args as needed
|
||||
{
|
||||
@ -520,12 +521,12 @@ mxmlNewDirectivef(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
// 'mxmlNewElement()' - Create a new element node.
|
||||
//
|
||||
// The new element node is added to the end of the specified parent's child
|
||||
// list. The constant `NULL` can be used to specify that the new element node
|
||||
// has no parent.
|
||||
// list. The constant `MXML_NO_PARENT` can be used to specify that the new
|
||||
// element node has no parent.
|
||||
//
|
||||
|
||||
mxml_node_t * // O - New node
|
||||
mxmlNewElement(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
mxmlNewElement(mxml_node_t *parent, // I - Parent node or `MXML_NO_PARENT`
|
||||
const char *name) // I - Name of element
|
||||
{
|
||||
mxml_node_t *node; // New node
|
||||
@ -549,12 +550,12 @@ mxmlNewElement(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
// 'mxmlNewInteger()' - Create a new integer node.
|
||||
//
|
||||
// The new integer node is added to the end of the specified parent's child
|
||||
// list. The constant `NULL` can be used to specify that the new integer node
|
||||
// has no parent.
|
||||
// list. The constant `MXML_NO_PARENT` can be used to specify that the new
|
||||
// integer node has no parent.
|
||||
//
|
||||
|
||||
mxml_node_t * // O - New node
|
||||
mxmlNewInteger(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
mxmlNewInteger(mxml_node_t *parent, // I - Parent node or `MXML_NO_PARENT`
|
||||
long integer) // I - Integer value
|
||||
{
|
||||
mxml_node_t *node; // New node
|
||||
@ -574,13 +575,13 @@ mxmlNewInteger(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
// 'mxmlNewOpaque()' - Create a new opaque string.
|
||||
//
|
||||
// The new opaque string node is added to the end of the specified parent's
|
||||
// child list. The constant `NULL` can be used to specify that the new opaque
|
||||
// string node has no parent. The opaque string must be nul-terminated and is
|
||||
// copied into the new node.
|
||||
// child list. The constant `MXML_NO_PARENT` can be used to specify that
|
||||
// the new opaque string node has no parent. The opaque string must be nul-
|
||||
// terminated and is copied into the new node.
|
||||
//
|
||||
|
||||
mxml_node_t * // O - New node
|
||||
mxmlNewOpaque(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
mxmlNewOpaque(mxml_node_t *parent, // I - Parent node or `MXML_NO_PARENT`
|
||||
const char *opaque) // I - Opaque string
|
||||
{
|
||||
mxml_node_t *node; // New node
|
||||
@ -604,13 +605,13 @@ mxmlNewOpaque(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
// 'mxmlNewOpaquef()' - Create a new formatted opaque string node.
|
||||
//
|
||||
// The new opaque string node is added to the end of the specified parent's
|
||||
// child list. The constant `NULL` can be used to specify that the new opaque
|
||||
// string node has no parent. The format string must be nul-terminated and is
|
||||
// formatted into the new node.
|
||||
// child list. The constant `MXML_NO_PARENT` can be used to specify that
|
||||
// the new opaque string node has no parent. The format string must be
|
||||
// nul-terminated and is formatted into the new node.
|
||||
//
|
||||
|
||||
mxml_node_t * // O - New node
|
||||
mxmlNewOpaquef(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
mxmlNewOpaquef(mxml_node_t *parent, // I - Parent node or `MXML_NO_PARENT`
|
||||
const char *format, // I - Printf-style format string
|
||||
...) // I - Additional args as needed
|
||||
{
|
||||
@ -643,12 +644,12 @@ mxmlNewOpaquef(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
// 'mxmlNewReal()' - 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 `NULL` can be used to specify that the new real
|
||||
// number node has no parent.
|
||||
// child list. The constant `MXML_NO_PARENT` can be used to specify that
|
||||
// the new real number node has no parent.
|
||||
//
|
||||
|
||||
mxml_node_t * // O - New node
|
||||
mxmlNewReal(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
mxmlNewReal(mxml_node_t *parent, // I - Parent node or `MXML_NO_PARENT`
|
||||
double real) // I - Real number value
|
||||
{
|
||||
mxml_node_t *node; // New node
|
||||
@ -668,14 +669,14 @@ mxmlNewReal(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
// 'mxmlNewText()' - Create a new text fragment node.
|
||||
//
|
||||
// The new text node is added to the end of the specified parent's child
|
||||
// list. The constant `NULL` 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.
|
||||
// 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.
|
||||
//
|
||||
|
||||
mxml_node_t * // O - New node
|
||||
mxmlNewText(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
mxmlNewText(mxml_node_t *parent, // I - Parent node or `MXML_NO_PARENT`
|
||||
bool whitespace, // I - `true` = leading whitespace, `false` = no whitespace
|
||||
const char *string) // I - String
|
||||
{
|
||||
@ -703,14 +704,14 @@ mxmlNewText(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
// 'mxmlNewTextf()' - 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 `NULL` 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.
|
||||
// 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.
|
||||
//
|
||||
|
||||
mxml_node_t * // O - New node
|
||||
mxmlNewTextf(mxml_node_t *parent, // I - Parent node or `NULL`
|
||||
mxmlNewTextf(mxml_node_t *parent, // I - Parent node or `MXML_NO_PARENT`
|
||||
bool whitespace, // I - `true` = leading whitespace, `false` = no whitespace
|
||||
const char *format, // I - Printf-style format string
|
||||
...) // I - Additional args as needed
|
||||
@ -810,13 +811,9 @@ mxmlRelease(mxml_node_t *node) // I - Node
|
||||
mxmlDelete(node);
|
||||
return (0);
|
||||
}
|
||||
else if (node->ref_count < INT_MAX)
|
||||
{
|
||||
return ((int)node->ref_count);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (INT_MAX);
|
||||
return (node->ref_count);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -834,18 +831,9 @@ int // O - New reference count
|
||||
mxmlRetain(mxml_node_t *node) // I - Node
|
||||
{
|
||||
if (node)
|
||||
{
|
||||
node->ref_count ++;
|
||||
|
||||
if (node->ref_count < INT_MAX)
|
||||
return ((int)node->ref_count);
|
||||
else
|
||||
return (INT_MAX);
|
||||
}
|
||||
return (++ node->ref_count);
|
||||
else
|
||||
{
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -67,6 +67,13 @@
|
||||
# define inline _inline
|
||||
|
||||
|
||||
//
|
||||
// Long long support
|
||||
//
|
||||
|
||||
# define HAVE_LONG_LONG_INT 1
|
||||
|
||||
|
||||
//
|
||||
// Have <pthread.h>?
|
||||
//
|
||||
|
@ -1,9 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>libmxml4_native</id>
|
||||
<id>libmxml2_native</id>
|
||||
<title>Small XML File Parsing Library for VS2019+</title>
|
||||
<version>4.0.4</version>
|
||||
<version>4.0.3</version>
|
||||
<authors>Michael R Sweet</authors>
|
||||
<owners>michaelrsweet</owners>
|
||||
<projectUrl>https://github.com/michaelrsweet/mxml</projectUrl>
|
||||
@ -16,15 +16,15 @@
|
||||
<copyright>Copyright © 2003-2024 by Michael R Sweet</copyright>
|
||||
<tags>xml</tags>
|
||||
<dependencies>
|
||||
<dependency id="libmxml4_native.redist" version="4.0.4" />
|
||||
<dependency id="libmxml2_native.redist" version="4.0.3" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="..\doc\mxml-128.png" target="build\native" />
|
||||
<file src="..\README.md" target="build\native" />
|
||||
<file src="libmxml4_native.props" target="build\native" />
|
||||
<file src="libmxml2_native.props" target="build\native" />
|
||||
<file src="..\mxml.h" target="build\native\include" />
|
||||
<!--<file src="Win32\**\mxml4.lib" target="build\native\lib\Win32" />-->
|
||||
<file src="x64\**\mxml4.lib" target="build\native\lib\x64" />
|
||||
<!--<file src="Win32\**\libmxml2.lib" target="build\native\lib\Win32" />-->
|
||||
<file src="x64\**\libmxml2.lib" target="build\native\lib\x64" />
|
||||
</files>
|
||||
</package>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)\include</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>$(MSBuildThisFileDirectory)\lib\$(Platform)\$(Configuration)\mxml4.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>$(MSBuildThisFileDirectory)\lib\$(Platform)\$(Configuration)\libmxml2.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
</Project>
|
||||
|
@ -1,9 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>libmxml4_native.redist</id>
|
||||
<id>libmxml2_native.redist</id>
|
||||
<title>Small XML File Parsing Library for VS2019+ Redist</title>
|
||||
<version>4.0.4</version>
|
||||
<version>4.0.3</version>
|
||||
<authors>Michael R Sweet</authors>
|
||||
<owners>michaelrsweet</owners>
|
||||
<projectUrl>https://github.com/michaelrsweet/mxml</projectUrl>
|
||||
@ -19,7 +19,7 @@
|
||||
<files>
|
||||
<file src="..\doc\mxml-128.png" target="build\native" />
|
||||
<file src="..\README.md" target="build\native" />
|
||||
<!--<file src="Win32\**\mxml4.dll" target="build\native\bin\Win32" />-->
|
||||
<file src="x64\**\mxml4.dll" target="build\native\bin\x64" />
|
||||
<!--<file src="Win32\**\libmxml2.dll" target="build\native\bin\Win32" />-->
|
||||
<file src="x64\**\libmxml2.dll" target="build\native\bin\x64" />
|
||||
</files>
|
||||
</package>
|
||||
|
@ -32,6 +32,13 @@
|
||||
# define inline
|
||||
|
||||
|
||||
//
|
||||
// Long long support
|
||||
//
|
||||
|
||||
# define HAVE_LONG_LONG_INT 1
|
||||
|
||||
|
||||
//
|
||||
// Have <pthread.h>?
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user