From 85922c082355ce0ca4b161b6c05fdbcd0f974e33 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Sat, 27 Apr 2013 14:58:32 +0200 Subject: [PATCH] renamed SCRIPSUPPORT to IXML_HAVE_SCRIPTSUPPORT for consistency. Changed default to scriptsupport being enabled. --- ChangeLog | 8 ++++++++ README | 5 +++-- configure.ac | 4 ++-- ixml/Makefile.am | 2 +- ixml/inc/ixml.h | 8 ++++---- ixml/src/inc/ixmlparser.h | 2 +- ixml/src/ixml.c | 2 +- ixml/src/ixmlparser.c | 4 ++-- ixml/src/node.c | 4 ++-- 9 files changed, 24 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d08ebb..ae86016 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,14 @@ Version 1.8.0 ******************************************************************************* +2013-04-27 Thijs Schreijer + + 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 Changed param to const UpnpAcceptSubscriptionExt() for consistency diff --git a/README b/README index c7946ad..907385a 100644 --- a/README +++ b/README @@ -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. diff --git a/configure.ac b/configure.ac index bc09997..be81d2b 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/ixml/Makefile.am b/ixml/Makefile.am index ac202ff..7556dde 100644 --- a/ixml/Makefile.am +++ b/ixml/Makefile.am @@ -19,7 +19,7 @@ else endif if ENABLE_SCRIPTSUPPORT - AM_CPPFLAGS += -DSCRIPTSUPPORT + AM_CPPFLAGS += -DIXML_HAVE_SCRIPTSUPPORT endif lib_LTLIBRARIES = libixml.la diff --git a/ixml/inc/ixml.h b/ixml/inc/ixml.h index 447aa20..e2ea081 100644 --- a/ixml/inc/ixml.h +++ b/ixml/inc/ixml.h @@ -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. */ diff --git a/ixml/src/inc/ixmlparser.h b/ixml/src/inc/ixmlparser.h index eb29e6b..3626393 100644 --- a/ixml/src/inc/ixmlparser.h +++ b/ixml/src/inc/ixmlparser.h @@ -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. * diff --git a/ixml/src/ixml.c b/ixml/src/ixml.c index e33b6d6..422b731 100644 --- a/ixml/src/ixml.c +++ b/ixml/src/ixml.c @@ -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); diff --git a/ixml/src/ixmlparser.c b/ixml/src/ixmlparser.c index 2f54daf..3bf06f3 100644 --- a/ixml/src/ixmlparser.c +++ b/ixml/src/ixmlparser.c @@ -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; diff --git a/ixml/src/node.c b/ixml/src/node.c index 467c031..dcc8ccf 100644 --- a/ixml/src/node.c +++ b/ixml/src/node.c @@ -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;