renamed SCRIPSUPPORT to IXML_HAVE_SCRIPTSUPPORT for consistency. Changed default to scriptsupport being enabled.

This commit is contained in:
Thijs Schreijer 2013-04-27 14:58:32 +02:00
parent 31acda9688
commit 85922c0823
9 changed files with 24 additions and 15 deletions

View File

@ -2,6 +2,14 @@
Version 1.8.0
*******************************************************************************
2013-04-27 Thijs Schreijer <thijs(at)thijsschreijer.nl>
Renamed SCRIPTSUPPORT to IXML_HAVE_SCRIPTSUPPORT for consistency. Also
updated autoconfig and automake files, so it also works on non-windows.
Option is enabled by default, because it adds an element to the node
structure. Not using an available field is better than accidentally
using an unavailable field.
2012-07-11 Thijs Schreijer <thijs(at)thijsschreijer.nl>
Changed param to const UpnpAcceptSubscriptionExt() for consistency

5
README
View File

@ -351,8 +351,9 @@ The treestructure of XML documents created by IXML is hard to maintain when
creating a binding for a scripting language. Even when many elements may
never be used on the script side, it requires copying the entire tree
structure once you start accessing elements several levels deep.
Hence scriptsupport was added. To enable it compile while SCRIPTSUPPORT has
been defined. This allows control using only a list instead of a tree-like
Hence scriptsupport was added. To enable it compile while
IXML_HAVE_SCRIPTSUPPORT has been defined (enabled by default).
This allows control using only a list instead of a tree-like
structure, and only nodes actually accessed need to be created instead of
all the nodes in the tree.

View File

@ -477,9 +477,9 @@ if test "x$enable_blocking_tcp_connections" = xyes ; then
AC_DEFINE(UPNP_ENABLE_BLOCKING_TCP_CONNECTIONS, 1, [see upnpconfig.h])
fi
RT_BOOL_ARG_ENABLE([scriptsupport], [no], [script support for IXML document tree, see ixml.h])
RT_BOOL_ARG_ENABLE([scriptsupport], [yes], [script support for IXML document tree, see ixml.h])
if test "x$enable_scriptsupport" = xyes ; then
AC_DEFINE(SCRIPTSUPPORT, 1, [see upnpconfig.h])
AC_DEFINE(IXML_HAVE_SCRIPTSUPPORT, 1, [see upnpconfig.h])
fi

View File

@ -19,7 +19,7 @@ else
endif
if ENABLE_SCRIPTSUPPORT
AM_CPPFLAGS += -DSCRIPTSUPPORT
AM_CPPFLAGS += -DIXML_HAVE_SCRIPTSUPPORT
endif
lib_LTLIBRARIES = libixml.la

View File

@ -158,7 +158,7 @@ typedef struct _IXML_Document *Docptr;
typedef struct _IXML_Node *Nodeptr;
#ifdef SCRIPTSUPPORT
#ifdef IXML_HAVE_SCRIPTSUPPORT
/*!
* \brief Signature for GC support method, called before a node is freed.
*/
@ -185,7 +185,7 @@ typedef struct _IXML_Node
Nodeptr nextSibling;
Nodeptr firstAttr;
Docptr ownerDocument;
#ifdef SCRIPTSUPPORT
#ifdef IXML_HAVE_SCRIPTSUPPORT
void* ctag; // custom tag
#endif
} IXML_Node;
@ -644,7 +644,7 @@ EXPORT_SPEC void ixmlNode_free(
*/
IXML_Node *nodeptr);
#ifdef SCRIPTSUPPORT
#ifdef IXML_HAVE_SCRIPTSUPPORT
/*!
* \brief Sets the custom tag for the node.
*/
@ -1770,7 +1770,7 @@ EXPORT_SPEC void ixmlRelaxParser(
*/
char errorChar);
#ifdef SCRIPTSUPPORT
#ifdef IXML_HAVE_SCRIPTSUPPORT
/*!
* \brief Sets the handler to call before a node is freed.
*/

View File

@ -120,7 +120,7 @@ void Parser_setErrorChar(
/*! [in] The character to become the error character. */
char c);
#ifdef SCRIPTSUPPORT
#ifdef IXML_HAVE_SCRIPTSUPPORT
/*!
* \brief Sets the handler to call before a node is freed.
*

View File

@ -417,7 +417,7 @@ void ixmlRelaxParser(char errorChar)
Parser_setErrorChar(errorChar);
}
#ifdef SCRIPTSUPPORT
#ifdef IXML_HAVE_SCRIPTSUPPORT
void ixmlSetBeforeFree(IXML_BeforeFreeNode_t hndlr)
{
Parser_setBeforeFree(hndlr);

View File

@ -55,7 +55,7 @@
static char g_error_char = '\0';
#ifdef SCRIPTSUPPORT
#ifdef IXML_HAVE_SCRIPTSUPPORT
static IXML_BeforeFreeNode_t Before_Free_callback;
#endif
@ -2501,7 +2501,7 @@ void Parser_setErrorChar(char c)
g_error_char = c;
}
#ifdef SCRIPTSUPPORT
#ifdef IXML_HAVE_SCRIPTSUPPORT
void Parser_setBeforeFree(IXML_BeforeFreeNode_t hndlr)
{
Before_Free_callback = hndlr;

View File

@ -107,7 +107,7 @@ static void ixmlNode_freeSingleNode(
void ixmlNode_free(IXML_Node *nodeptr)
{
if (nodeptr != NULL) {
#ifdef SCRIPTSUPPORT
#ifdef IXML_HAVE_SCRIPTSUPPORT
IXML_BeforeFreeNode_t hndlr = Parser_getBeforeFree();
if (hndlr != NULL) hndlr(nodeptr);
#endif
@ -1384,7 +1384,7 @@ ErrorHandler:
return IXML_INSUFFICIENT_MEMORY;
}
#ifdef SCRIPTSUPPORT
#ifdef IXML_HAVE_SCRIPTSUPPORT
void ixmlNode_setCTag(IXML_Node *nodeptr, void *ctag)
{
if (nodeptr != NULL) nodeptr->ctag = ctag;