Index: acinclude.m4 =================================================================== --- acinclude.m4 (revision 58183) +++ acinclude.m4 (working copy) @@ -2,8 +2,8 @@ dnl _any_ output. Some compilers might issue warnings which we want dnl to catch. AC_DEFUN([AC_TRY_EVAL2], -[{ (eval echo configure:__oline__: \"[$]$1\") 1>&AC_FD_CC; dnl -(eval [$]$1) 2>&AC_FD_CC; _out=`eval [$]$1 2>&1` && test "x$_out" = x; }]) +[{ (eval echo configure:__oline__: \"[$]$1\") 1>&AS_MESSAGE_LOG_FD; dnl +(eval [$]$1) 2>&AS_MESSAGE_LOG_FD; _out=`eval [$]$1 2>&1` && test "x$_out" = x; }]) dnl Like AC_TRY_COMPILE but calls AC_TRY_EVAL2 instead of AC_TRY_EVAL AC_DEFUN([AC_TRY_COMPILE2], @@ -19,8 +19,8 @@ ifelse([$3], , :, [rm -rf conftest* $3]) else - echo "configure: failed program was:" >&AC_FD_CC - cat conftest.$ac_ext >&AC_FD_CC + echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD ifelse([$4], , , [ rm -rf conftest* $4 ])dnl Index: aclocal.m4 =================================================================== --- aclocal.m4 (revision 58183) +++ aclocal.m4 (working copy) @@ -406,18 +406,6 @@ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 8 - -# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. -AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) - # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -753,32 +741,6 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2006 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 5 - -AC_DEFUN([AM_C_PROTOTYPES], -[AC_REQUIRE([AC_C_PROTOTYPES]) -if test "$ac_cv_prog_cc_stdc" != no; then - U= ANSI2KNR= -else - U=_ ANSI2KNR=./ansi2knr -fi -# Ensure some checks needed by ansi2knr itself. -AC_REQUIRE([AC_HEADER_STDC]) -AC_CHECK_HEADERS([string.h]) -AC_SUBST([U])dnl -AC_SUBST([ANSI2KNR])dnl -_AM_SUBST_NOTMAKE([ANSI2KNR])dnl -]) - -AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) - # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 @@ -844,6 +806,33 @@ fi AC_MSG_RESULT(yes)]) +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# (`yes' being less verbose, `no' or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], +[ --enable-silent-rules less verbose build output (undo: `make V=1') + --disable-silent-rules verbose build output (undo: `make V=0')]) +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation Index: c14n.c =================================================================== --- c14n.c (revision 58183) +++ c14n.c (working copy) @@ -1,12 +1,12 @@ /* - * "Canonical XML" implementation + * "Canonical XML" implementation * http://www.w3.org/TR/xml-c14n - * + * * "Exclusive XML Canonicalization" implementation * http://www.w3.org/TR/xml-exc-c14n * * See Copyright for the status of this software. - * + * * Author: Aleksey Sanin */ #define IN_LIBXML @@ -27,6 +27,8 @@ #include #include +#include "buf.h" + /************************************************************************ * * * Some declaration better left private ATM * @@ -44,7 +46,7 @@ int nsPrevStart; /* the begginning of the stack for previous visible node */ int nsPrevEnd; /* the end of the stack for previous visible node */ int nsMax; /* size of the array as allocated */ - xmlNsPtr *nsTab; /* array of ns in no particular order */ + xmlNsPtr *nsTab; /* array of ns in no particular order */ xmlNodePtr *nodeTab; /* array of nodes in no particular order */ } xmlC14NVisibleNsStack, *xmlC14NVisibleNsStackPtr; @@ -52,7 +54,7 @@ /* input parameters */ xmlDocPtr doc; xmlC14NIsVisibleCallback is_visible_callback; - void* user_data; + void* user_data; int with_comments; xmlOutputBufferPtr buf; @@ -60,7 +62,7 @@ xmlC14NPosition pos; int parent_is_doc; xmlC14NVisibleNsStackPtr ns_rendered; - + /* C14N mode */ xmlC14NMode mode; @@ -73,17 +75,17 @@ static xmlC14NVisibleNsStackPtr xmlC14NVisibleNsStackCreate (void); static void xmlC14NVisibleNsStackDestroy (xmlC14NVisibleNsStackPtr cur); -static void xmlC14NVisibleNsStackAdd (xmlC14NVisibleNsStackPtr cur, +static void xmlC14NVisibleNsStackAdd (xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlNodePtr node); -static void xmlC14NVisibleNsStackSave (xmlC14NVisibleNsStackPtr cur, +static void xmlC14NVisibleNsStackSave (xmlC14NVisibleNsStackPtr cur, xmlC14NVisibleNsStackPtr state); -static void xmlC14NVisibleNsStackRestore (xmlC14NVisibleNsStackPtr cur, +static void xmlC14NVisibleNsStackRestore (xmlC14NVisibleNsStackPtr cur, xmlC14NVisibleNsStackPtr state); -static void xmlC14NVisibleNsStackShift (xmlC14NVisibleNsStackPtr cur); -static int xmlC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur, +static void xmlC14NVisibleNsStackShift (xmlC14NVisibleNsStackPtr cur); +static int xmlC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns); -static int xmlExcC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur, +static int xmlExcC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlC14NCtxPtr ctx); @@ -105,26 +107,26 @@ static xmlChar *xmlC11NNormalizeString(const xmlChar * input, xmlC14NNormalizationMode mode); -#define xmlC11NNormalizeAttr( a ) \ +#define xmlC11NNormalizeAttr( a ) \ xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_ATTR) -#define xmlC11NNormalizeComment( a ) \ +#define xmlC11NNormalizeComment( a ) \ xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_COMMENT) -#define xmlC11NNormalizePI( a ) \ +#define xmlC11NNormalizePI( a ) \ xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_PI) -#define xmlC11NNormalizeText( a ) \ +#define xmlC11NNormalizeText( a ) \ xmlC11NNormalizeString((a), XMLC14N_NORMALIZE_TEXT) -#define xmlC14NIsVisible( ctx, node, parent ) \ +#define xmlC14NIsVisible( ctx, node, parent ) \ (((ctx)->is_visible_callback != NULL) ? \ (ctx)->is_visible_callback((ctx)->user_data, \ (xmlNodePtr)(node), (xmlNodePtr)(parent)) : 1) -#define xmlC14NIsExclusive( ctx ) \ +#define xmlC14NIsExclusive( ctx ) \ ( (ctx)->mode == XML_C14N_EXCLUSIVE_1_0 ) /************************************************************************ * * - * Some factorized error routines * + * Some factorized error routines * * * ************************************************************************/ @@ -249,25 +251,25 @@ ************************************************************************/ #define XML_NAMESPACES_DEFAULT 16 -static int +static int xmlC14NIsNodeInNodeset(xmlNodeSetPtr nodes, xmlNodePtr node, xmlNodePtr parent) { if((nodes != NULL) && (node != NULL)) { if(node->type != XML_NAMESPACE_DECL) { return(xmlXPathNodeSetContains(nodes, node)); } else { xmlNs ns; - - memcpy(&ns, node, sizeof(ns)); - + + memcpy(&ns, node, sizeof(ns)); + /* this is a libxml hack! check xpath.c for details */ if((parent != NULL) && (parent->type == XML_ATTRIBUTE_NODE)) { ns.next = (xmlNsPtr)parent->parent; } else { - ns.next = (xmlNsPtr)parent; + ns.next = (xmlNsPtr)parent; } - /* - * If the input is an XPath node-set, then the node-set must explicitly + /* + * If the input is an XPath node-set, then the node-set must explicitly * contain every node to be rendered to the canonical form. */ return(xmlXPathNodeSetContains(nodes, (xmlNodePtr)&ns)); @@ -305,12 +307,12 @@ } memset(cur, 0, sizeof(xmlC14NVisibleNsStack)); xmlFree(cur); - + } -static void +static void xmlC14NVisibleNsStackAdd(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlNodePtr node) { - if((cur == NULL) || + if((cur == NULL) || ((cur->nsTab == NULL) && (cur->nodeTab != NULL)) || ((cur->nsTab != NULL) && (cur->nodeTab == NULL))) { xmlC14NErrParam("adding namespace to stack"); @@ -328,9 +330,9 @@ memset(cur->nodeTab, 0 , XML_NAMESPACES_DEFAULT * sizeof(xmlNodePtr)); cur->nsMax = XML_NAMESPACES_DEFAULT; } else if(cur->nsMax == cur->nsCurEnd) { - void *tmp; + void *tmp; int tmpSize; - + tmpSize = 2 * cur->nsMax; tmp = xmlRealloc(cur->nsTab, tmpSize * sizeof(xmlNsPtr)); if (tmp == NULL) { @@ -360,7 +362,7 @@ xmlC14NErrParam("saving namespaces stack"); return; } - + state->nsCurEnd = cur->nsCurEnd; state->nsPrevStart = cur->nsPrevStart; state->nsPrevEnd = cur->nsPrevEnd; @@ -377,7 +379,7 @@ cur->nsPrevEnd = state->nsPrevEnd; } -static void +static void xmlC14NVisibleNsStackShift(xmlC14NVisibleNsStackPtr cur) { if(cur == NULL) { xmlC14NErrParam("shifting namespaces stack"); @@ -400,7 +402,7 @@ /** * xmlC14NVisibleNsStackFind: - * @ctx: the C14N context + * @ctx: the C14N context * @ns: the namespace to check * * Checks whether the given namespace was already rendered or not @@ -414,14 +416,14 @@ const xmlChar *prefix; const xmlChar *href; int has_empty_ns; - + if(cur == NULL) { xmlC14NErrParam("searching namespaces stack (c14n)"); return (0); } /* - * if the default namespace xmlns="" is not defined yet then + * if the default namespace xmlns="" is not defined yet then * we do not want to print it out */ prefix = ((ns == NULL) || (ns->prefix == NULL)) ? BAD_CAST "" : ns->prefix; @@ -432,7 +434,7 @@ int start = (has_empty_ns) ? 0 : cur->nsPrevStart; for (i = cur->nsCurEnd - 1; i >= start; --i) { xmlNsPtr ns1 = cur->nsTab[i]; - + if(xmlC14NStrEqual(prefix, (ns1 != NULL) ? ns1->prefix : NULL)) { return(xmlC14NStrEqual(href, (ns1 != NULL) ? ns1->href : NULL)); } @@ -441,20 +443,20 @@ return(has_empty_ns); } -static int +static int xmlExcC14NVisibleNsStackFind(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlC14NCtxPtr ctx) { int i; const xmlChar *prefix; const xmlChar *href; int has_empty_ns; - + if(cur == NULL) { xmlC14NErrParam("searching namespaces stack (exc c14n)"); return (0); } /* - * if the default namespace xmlns="" is not defined yet then + * if the default namespace xmlns="" is not defined yet then * we do not want to print it out */ prefix = ((ns == NULL) || (ns->prefix == NULL)) ? BAD_CAST "" : ns->prefix; @@ -465,10 +467,10 @@ int start = 0; for (i = cur->nsCurEnd - 1; i >= start; --i) { xmlNsPtr ns1 = cur->nsTab[i]; - + if(xmlC14NStrEqual(prefix, (ns1 != NULL) ? ns1->prefix : NULL)) { if(xmlC14NStrEqual(href, (ns1 != NULL) ? ns1->href : NULL)) { - return(xmlC14NIsVisible(ctx, ns1, cur->nodeTab[i])); + return(xmlC14NIsVisible(ctx, ns1, cur->nodeTab[i])); } else { return(0); } @@ -483,8 +485,8 @@ /** * xmlC14NIsXmlNs: - * @ns: the namespace to check - * + * @ns: the namespace to check + * * Checks whether the given namespace is a default "xml:" namespace * with href="http://www.w3.org/XML/1998/namespace" * @@ -504,7 +506,7 @@ /** * xmlC14NNsCompare: * @ns1: the pointer to first namespace - * @ns2: the pointer to second namespace + * @ns2: the pointer to second namespace * * Compares the namespaces by names (prefixes). * @@ -527,7 +529,7 @@ /** * xmlC14NPrintNamespaces: * @ns: the pointer to namespace - * @ctx: the C14N context + * @ctx: the C14N context * * Prints the given namespace to the output buffer from C14N context. * @@ -558,39 +560,39 @@ /** * xmlC14NProcessNamespacesAxis: - * @ctx: the C14N context + * @ctx: the C14N context * @node: the current node * * Prints out canonical namespace axis of the current node to the - * buffer from C14N context as follows + * buffer from C14N context as follows * * Canonical XML v 1.0 (http://www.w3.org/TR/xml-c14n) * * Namespace Axis - * Consider a list L containing only namespace nodes in the - * axis and in the node-set in lexicographic order (ascending). To begin - * processing L, if the first node is not the default namespace node (a node - * with no namespace URI and no local name), then generate a space followed + * Consider a list L containing only namespace nodes in the + * axis and in the node-set in lexicographic order (ascending). To begin + * processing L, if the first node is not the default namespace node (a node + * with no namespace URI and no local name), then generate a space followed * by xmlns="" if and only if the following conditions are met: * - the element E that owns the axis is in the node-set - * - The nearest ancestor element of E in the node-set has a default - * namespace node in the node-set (default namespace nodes always + * - The nearest ancestor element of E in the node-set has a default + * namespace node in the node-set (default namespace nodes always * have non-empty values in XPath) - * The latter condition eliminates unnecessary occurrences of xmlns="" in - * the canonical form since an element only receives an xmlns="" if its - * default namespace is empty and if it has an immediate parent in the - * canonical form that has a non-empty default namespace. To finish - * processing L, simply process every namespace node in L, except omit - * namespace node with local name xml, which defines the xml prefix, + * The latter condition eliminates unnecessary occurrences of xmlns="" in + * the canonical form since an element only receives an xmlns="" if its + * default namespace is empty and if it has an immediate parent in the + * canonical form that has a non-empty default namespace. To finish + * processing L, simply process every namespace node in L, except omit + * namespace node with local name xml, which defines the xml prefix, * if its string value is http://www.w3.org/XML/1998/namespace. * * Exclusive XML Canonicalization v 1.0 (http://www.w3.org/TR/xml-exc-c14n) - * Canonical XML applied to a document subset requires the search of the - * ancestor nodes of each orphan element node for attributes in the xml - * namespace, such as xml:lang and xml:space. These are copied into the - * element node except if a declaration of the same attribute is already - * in the attribute axis of the element (whether or not it is included in - * the document subset). This search and copying are omitted from the + * Canonical XML applied to a document subset requires the search of the + * ancestor nodes of each orphan element node for attributes in the xml + * namespace, such as xml:lang and xml:space. These are copied into the + * element node except if a declaration of the same attribute is already + * in the attribute axis of the element (whether or not it is included in + * the document subset). This search and copying are omitted from the * Exclusive XML Canonicalization method. * * Returns 0 on success or -1 on fail. @@ -603,7 +605,7 @@ xmlListPtr list; int already_rendered; int has_empty_ns = 0; - + if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) { xmlC14NErrParam("processing namespaces axis (c14n)"); return (-1); @@ -622,29 +624,29 @@ for(n = cur; n != NULL; n = n->parent) { for(ns = n->nsDef; ns != NULL; ns = ns->next) { tmp = xmlSearchNs(cur->doc, cur, ns->prefix); - + if((tmp == ns) && !xmlC14NIsXmlNs(ns) && xmlC14NIsVisible(ctx, ns, cur)) { already_rendered = xmlC14NVisibleNsStackFind(ctx->ns_rendered, ns); if(visible) { - xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); + xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); } if(!already_rendered) { - xmlListInsert(list, ns); + xmlListInsert(list, ns); } - if(xmlStrlen(ns->prefix) == 0) { + if(xmlStrlen(ns->prefix) == 0) { has_empty_ns = 1; } } } } - + /** - * if the first node is not the default namespace node (a node with no - * namespace URI and no local name), then generate a space followed by + * if the first node is not the default namespace node (a node with no + * namespace URI and no local name), then generate a space followed by * xmlns="" if and only if the following conditions are met: * - the element E that owns the axis is in the node-set - * - the nearest ancestor element of E in the node-set has a default - * namespace node in the node-set (default namespace nodes always + * - the nearest ancestor element of E in the node-set has a default + * namespace node in the node-set (default namespace nodes always * have non-empty values in XPath) */ if(visible && !has_empty_ns) { @@ -652,17 +654,17 @@ memset(&ns_default, 0, sizeof(ns_default)); if(!xmlC14NVisibleNsStackFind(ctx->ns_rendered, &ns_default)) { - xmlC14NPrintNamespaces(&ns_default, ctx); + xmlC14NPrintNamespaces(&ns_default, ctx); } } - - - /* - * print out all elements from list + + + /* + * print out all elements from list */ xmlListWalk(list, (xmlListWalker) xmlC14NPrintNamespaces, (const void *) ctx); - /* + /* * Cleanup */ xmlListDelete(list); @@ -672,28 +674,28 @@ /** * xmlExcC14NProcessNamespacesAxis: - * @ctx: the C14N context + * @ctx: the C14N context * @node: the current node * * Prints out exclusive canonical namespace axis of the current node to the - * buffer from C14N context as follows + * buffer from C14N context as follows * * Exclusive XML Canonicalization * http://www.w3.org/TR/xml-exc-c14n * - * If the element node is in the XPath subset then output the node in - * accordance with Canonical XML except for namespace nodes which are + * If the element node is in the XPath subset then output the node in + * accordance with Canonical XML except for namespace nodes which are * rendered as follows: * * 1. Render each namespace node iff: - * * it is visibly utilized by the immediate parent element or one of + * * it is visibly utilized by the immediate parent element or one of * its attributes, or is present in InclusiveNamespaces PrefixList, and - * * its prefix and value do not appear in ns_rendered. ns_rendered is - * obtained by popping the state stack in order to obtain a list of - * prefixes and their values which have already been rendered by + * * its prefix and value do not appear in ns_rendered. ns_rendered is + * obtained by popping the state stack in order to obtain a list of + * prefixes and their values which have already been rendered by * an output ancestor of the namespace node's parent element. - * 2. Append the rendered namespace node to the list ns_rendered of namespace - * nodes rendered by output ancestors. Push ns_rendered on state stack and + * 2. Append the rendered namespace node to the list ns_rendered of namespace + * nodes rendered by output ancestors. Push ns_rendered on state stack and * recurse. * 3. After the recursion returns, pop thestate stack. * @@ -710,7 +712,7 @@ int has_empty_ns = 0; int has_visibly_utilized_empty_ns = 0; int has_empty_ns_in_inclusive_list = 0; - + if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) { xmlC14NErrParam("processing namespaces axis (exc c14n)"); return (-1); @@ -731,15 +733,15 @@ return (-1); } - /* + /* * process inclusive namespaces: - * All namespace nodes appearing on inclusive ns list are + * All namespace nodes appearing on inclusive ns list are * handled as provided in Canonical XML */ if(ctx->inclusive_ns_prefixes != NULL) { - xmlChar *prefix; + xmlChar *prefix; int i; - + for (i = 0; ctx->inclusive_ns_prefixes[i] != NULL; ++i) { prefix = ctx->inclusive_ns_prefixes[i]; /* @@ -750,23 +752,23 @@ prefix = NULL; has_empty_ns_in_inclusive_list = 1; } - - ns = xmlSearchNs(cur->doc, cur, prefix); + + ns = xmlSearchNs(cur->doc, cur, prefix); if((ns != NULL) && !xmlC14NIsXmlNs(ns) && xmlC14NIsVisible(ctx, ns, cur)) { already_rendered = xmlC14NVisibleNsStackFind(ctx->ns_rendered, ns); if(visible) { - xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); + xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); } if(!already_rendered) { - xmlListInsert(list, ns); + xmlListInsert(list, ns); } - if(xmlStrlen(ns->prefix) == 0) { + if(xmlStrlen(ns->prefix) == 0) { has_empty_ns = 1; } } } } - + /* add node namespace */ if(cur->ns != NULL) { ns = cur->ns; @@ -775,32 +777,32 @@ has_visibly_utilized_empty_ns = 1; } if((ns != NULL) && !xmlC14NIsXmlNs(ns)) { - if(visible && xmlC14NIsVisible(ctx, ns, cur)) { + if(visible && xmlC14NIsVisible(ctx, ns, cur)) { if(!xmlExcC14NVisibleNsStackFind(ctx->ns_rendered, ns, ctx)) { xmlListInsert(list, ns); } } if(visible) { - xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); + xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); } if(xmlStrlen(ns->prefix) == 0) { has_empty_ns = 1; } } - - + + /* add attributes */ for(attr = cur->properties; attr != NULL; attr = attr->next) { - /* + /* * we need to check that attribute is visible and has non - * default namespace (XML Namespaces: "default namespaces - * do not apply directly to attributes") + * default namespace (XML Namespaces: "default namespaces + * do not apply directly to attributes") */ if((attr->ns != NULL) && !xmlC14NIsXmlNs(attr->ns) && xmlC14NIsVisible(ctx, attr, cur)) { already_rendered = xmlExcC14NVisibleNsStackFind(ctx->ns_rendered, attr->ns, ctx); - xmlC14NVisibleNsStackAdd(ctx->ns_rendered, attr->ns, cur); + xmlC14NVisibleNsStackAdd(ctx->ns_rendered, attr->ns, cur); if(!already_rendered && visible) { - xmlListInsert(list, attr->ns); + xmlListInsert(list, attr->ns); } if(xmlStrlen(attr->ns->prefix) == 0) { has_empty_ns = 1; @@ -813,33 +815,33 @@ /* * Process xmlns="" */ - if(visible && has_visibly_utilized_empty_ns && + if(visible && has_visibly_utilized_empty_ns && !has_empty_ns && !has_empty_ns_in_inclusive_list) { static xmlNs ns_default; memset(&ns_default, 0, sizeof(ns_default)); - + already_rendered = xmlExcC14NVisibleNsStackFind(ctx->ns_rendered, &ns_default, ctx); if(!already_rendered) { - xmlC14NPrintNamespaces(&ns_default, ctx); + xmlC14NPrintNamespaces(&ns_default, ctx); } } else if(visible && !has_empty_ns && has_empty_ns_in_inclusive_list) { static xmlNs ns_default; memset(&ns_default, 0, sizeof(ns_default)); if(!xmlC14NVisibleNsStackFind(ctx->ns_rendered, &ns_default)) { - xmlC14NPrintNamespaces(&ns_default, ctx); + xmlC14NPrintNamespaces(&ns_default, ctx); } } - - /* - * print out all elements from list + + /* + * print out all elements from list */ xmlListWalk(list, (xmlListWalker) xmlC14NPrintNamespaces, (const void *) ctx); - /* + /* * Cleanup */ xmlListDelete(list); @@ -849,8 +851,8 @@ /** * xmlC14NIsXmlAttr: - * @attr: the attr to check - * + * @attr: the attr to check + * * Checks whether the given attribute is a default "xml:" namespace * with href="http://www.w3.org/XML/1998/namespace" * @@ -861,7 +863,7 @@ static int xmlC14NIsXmlAttr(xmlAttrPtr attr) { - return ((attr->ns != NULL) && + return ((attr->ns != NULL) && (xmlC14NIsXmlNs(attr->ns) != 0)); } @@ -869,7 +871,7 @@ /** * xmlC14NAttrsCompare: * @attr1: the pointer tls o first attr - * @attr2: the pointer to second attr + * @attr2: the pointer to second attr * * Prints the given attribute to the output buffer from C14N context. * @@ -893,7 +895,7 @@ return (xmlStrcmp(attr1->name, attr2->name)); } - /* + /* * Attributes in the default namespace are first * because the default namespace is not applied to * unqualified attributes @@ -918,10 +920,10 @@ /** * xmlC14NPrintAttrs: * @attr: the pointer to attr - * @ctx: the C14N context + * @ctx: the C14N context * * Prints out canonical attribute urrent node to the - * buffer from C14N context as follows + * buffer from C14N context as follows * * Canonical XML v 1.0 (http://www.w3.org/TR/xml-c14n) * @@ -968,7 +970,7 @@ * xmlC14NFindHiddenParentAttr: * * Finds an attribute in a hidden parent node. - * + * * Returns a pointer to the attribute node (if found) or NULL otherwise. */ static xmlAttrPtr @@ -996,7 +998,7 @@ */ static xmlAttrPtr xmlC14NFixupBaseAttr(xmlC14NCtxPtr ctx, xmlAttrPtr xml_base_attr) -{ +{ xmlChar * res = NULL; xmlNodePtr cur; xmlAttrPtr attr; @@ -1028,9 +1030,9 @@ xmlC14NErrInternal("processing xml:base attribute - can't get attr value"); return (NULL); - } + } - /* we need to add '/' if our current base uri ends with '..' or '.' + /* we need to add '/' if our current base uri ends with '..' or '.' to ensure that we are forced to go "up" all the time */ tmp_str_len = xmlStrlen(tmp_str); if(tmp_str_len > 1 && tmp_str[tmp_str_len - 2] == '.') { @@ -1047,7 +1049,7 @@ } /* build uri */ - tmp_str2 = xmlBuildURI(res, tmp_str); + tmp_str2 = xmlBuildURI(res, tmp_str); if(tmp_str2 == NULL) { xmlFree(tmp_str); xmlFree(res); @@ -1080,7 +1082,7 @@ xmlC14NErrInternal("processing xml:base attribute - can't construct attribute"); return (NULL); } - + /* done */ xmlFree(res); return (attr); @@ -1088,33 +1090,33 @@ /** * xmlC14NProcessAttrsAxis: - * @ctx: the C14N context + * @ctx: the C14N context * @cur: the current node * @parent_visible: the visibility of parent node * @all_parents_visible: the visibility of all parent nodes * * Prints out canonical attribute axis of the current node to the - * buffer from C14N context as follows + * buffer from C14N context as follows * * Canonical XML v 1.0 (http://www.w3.org/TR/xml-c14n) * - * Attribute Axis - * In lexicographic order (ascending), process each node that + * Attribute Axis + * In lexicographic order (ascending), process each node that * is in the element's attribute axis and in the node-set. - * - * The processing of an element node E MUST be modified slightly - * when an XPath node-set is given as input and the element's + * + * The processing of an element node E MUST be modified slightly + * when an XPath node-set is given as input and the element's * parent is omitted from the node-set. * * * Exclusive XML Canonicalization v 1.0 (http://www.w3.org/TR/xml-exc-c14n) * - * Canonical XML applied to a document subset requires the search of the - * ancestor nodes of each orphan element node for attributes in the xml - * namespace, such as xml:lang and xml:space. These are copied into the - * element node except if a declaration of the same attribute is already - * in the attribute axis of the element (whether or not it is included in - * the document subset). This search and copying are omitted from the + * Canonical XML applied to a document subset requires the search of the + * ancestor nodes of each orphan element node for attributes in the xml + * namespace, such as xml:lang and xml:space. These are copied into the + * element node except if a declaration of the same attribute is already + * in the attribute axis of the element (whether or not it is included in + * the document subset). This search and copying are omitted from the * Exclusive XML Canonicalization method. * * Returns 0 on success or -1 on fail. @@ -1123,9 +1125,9 @@ xmlC14NProcessAttrsAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int parent_visible) { xmlAttrPtr attr; - xmlListPtr list; + xmlListPtr list; xmlAttrPtr attrs_to_delete = NULL; - + /* special processing for 1.1 spec */ xmlAttrPtr xml_base_attr = NULL; xmlAttrPtr xml_lang_attr = NULL; @@ -1147,19 +1149,19 @@ switch(ctx->mode) { case XML_C14N_1_0: - /* The processing of an element node E MUST be modified slightly when an XPath node-set is - * given as input and the element's parent is omitted from the node-set. The method for processing - * the attribute axis of an element E in the node-set is enhanced. All element nodes along E's - * ancestor axis are examined for nearest occurrences of attributes in the xml namespace, such - * as xml:lang and xml:space (whether or not they are in the node-set). From this list of attributes, - * remove any that are in E's attribute axis (whether or not they are in the node-set). Then, - * lexicographically merge this attribute list with the nodes of E's attribute axis that are in - * the node-set. The result of visiting the attribute axis is computed by processing the attribute - * nodes in this merged attribute list. + /* The processing of an element node E MUST be modified slightly when an XPath node-set is + * given as input and the element's parent is omitted from the node-set. The method for processing + * the attribute axis of an element E in the node-set is enhanced. All element nodes along E's + * ancestor axis are examined for nearest occurrences of attributes in the xml namespace, such + * as xml:lang and xml:space (whether or not they are in the node-set). From this list of attributes, + * remove any that are in E's attribute axis (whether or not they are in the node-set). Then, + * lexicographically merge this attribute list with the nodes of E's attribute axis that are in + * the node-set. The result of visiting the attribute axis is computed by processing the attribute + * nodes in this merged attribute list. */ - - /* - * Add all visible attributes from current node. + + /* + * Add all visible attributes from current node. */ attr = cur->properties; while (attr != NULL) { @@ -1170,16 +1172,16 @@ attr = attr->next; } - /* + /* * Handle xml attributes */ - if (parent_visible && (cur->parent != NULL) && - (!xmlC14NIsVisible(ctx, cur->parent, cur->parent->parent))) + if (parent_visible && (cur->parent != NULL) && + (!xmlC14NIsVisible(ctx, cur->parent, cur->parent->parent))) { xmlNodePtr tmp; /* - * If XPath node-set is not specified then the parent is always + * If XPath node-set is not specified then the parent is always * visible! */ tmp = cur->parent; @@ -1200,12 +1202,12 @@ /* done */ break; case XML_C14N_EXCLUSIVE_1_0: - /* attributes in the XML namespace, such as xml:lang and xml:space - * are not imported into orphan nodes of the document subset + /* attributes in the XML namespace, such as xml:lang and xml:space + * are not imported into orphan nodes of the document subset */ - /* - * Add all visible attributes from current node. + /* + * Add all visible attributes from current node. */ attr = cur->properties; while (attr != NULL) { @@ -1219,36 +1221,36 @@ /* do nothing special for xml attributes */ break; case XML_C14N_1_1: - /* The processing of an element node E MUST be modified slightly when an XPath node-set is - * given as input and some of the element's ancestors are omitted from the node-set. + /* The processing of an element node E MUST be modified slightly when an XPath node-set is + * given as input and some of the element's ancestors are omitted from the node-set. * - * Simple inheritable attributes are attributes that have a value that requires at most a simple - * redeclaration. This redeclaration is done by supplying a new value in the child axis. The - * redeclaration of a simple inheritable attribute A contained in one of E's ancestors is done - * by supplying a value to an attribute Ae inside E with the same name. Simple inheritable attributes + * Simple inheritable attributes are attributes that have a value that requires at most a simple + * redeclaration. This redeclaration is done by supplying a new value in the child axis. The + * redeclaration of a simple inheritable attribute A contained in one of E's ancestors is done + * by supplying a value to an attribute Ae inside E with the same name. Simple inheritable attributes * are xml:lang and xml:space. - * - * The method for processing the attribute axis of an element E in the node-set is hence enhanced. - * All element nodes along E's ancestor axis are examined for the nearest occurrences of simple - * inheritable attributes in the xml namespace, such as xml:lang and xml:space (whether or not they - * are in the node-set). From this list of attributes, any simple inheritable attributes that are - * already in E's attribute axis (whether or not they are in the node-set) are removed. Then, - * lexicographically merge this attribute list with the nodes of E's attribute axis that are in - * the node-set. The result of visiting the attribute axis is computed by processing the attribute + * + * The method for processing the attribute axis of an element E in the node-set is hence enhanced. + * All element nodes along E's ancestor axis are examined for the nearest occurrences of simple + * inheritable attributes in the xml namespace, such as xml:lang and xml:space (whether or not they + * are in the node-set). From this list of attributes, any simple inheritable attributes that are + * already in E's attribute axis (whether or not they are in the node-set) are removed. Then, + * lexicographically merge this attribute list with the nodes of E's attribute axis that are in + * the node-set. The result of visiting the attribute axis is computed by processing the attribute * nodes in this merged attribute list. - * - * The xml:id attribute is not a simple inheritable attribute and no processing of these attributes is + * + * The xml:id attribute is not a simple inheritable attribute and no processing of these attributes is * performed. - * - * The xml:base attribute is not a simple inheritable attribute and requires special processing beyond + * + * The xml:base attribute is not a simple inheritable attribute and requires special processing beyond * a simple redeclaration. - * - * Attributes in the XML namespace other than xml:base, xml:id, xml:lang, and xml:space MUST be processed + * + * Attributes in the XML namespace other than xml:base, xml:id, xml:lang, and xml:space MUST be processed * as ordinary attributes. */ - /* - * Add all visible attributes from current node. + /* + * Add all visible attributes from current node. */ attr = cur->properties; while (attr != NULL) { @@ -1265,7 +1267,7 @@ if((!matched) && (xml_lang_attr == NULL) && xmlStrEqual(attr->name, BAD_CAST "lang")) { xml_lang_attr = attr; matched = 1; - } + } if((!matched) && (xml_space_attr == NULL) && xmlStrEqual(attr->name, BAD_CAST "space")) { xml_space_attr = attr; matched = 1; @@ -1282,11 +1284,11 @@ xmlListInsert(list, attr); } } - + /* move to the next one */ attr = attr->next; } - + /* special processing for XML attribute kiks in only when we have invisible parents */ if ((parent_visible)) { @@ -1311,7 +1313,7 @@ } if(xml_base_attr != NULL) { xml_base_attr = xmlC14NFixupBaseAttr(ctx, xml_base_attr); - if(xml_base_attr != NULL) { + if(xml_base_attr != NULL) { xmlListInsert(list, xml_base_attr); /* note that we MUST delete returned attr node ourselves! */ @@ -1325,12 +1327,12 @@ break; } - /* - * print out all elements from list + /* + * print out all elements from list */ xmlListWalk(list, (xmlListWalker) xmlC14NPrintAttrs, (const void *) ctx); - /* + /* * Cleanup */ xmlFreePropList(attrs_to_delete); @@ -1338,7 +1340,7 @@ return (0); } -/** +/** * xmlC14NCheckForRelativeNamespaces: * @ctx: the C14N context * @cur: the current element node @@ -1388,23 +1390,23 @@ /** * xmlC14NProcessElementNode: - * @ctx: the pointer to C14N context object + * @ctx: the pointer to C14N context object * @cur: the node to process * @visible: this node is visible * @all_parents_visible: whether all the parents of this node are visible - * + * * Canonical XML v 1.0 (http://www.w3.org/TR/xml-c14n) * * Element Nodes - * If the element is not in the node-set, then the result is obtained - * by processing the namespace axis, then the attribute axis, then - * processing the child nodes of the element that are in the node-set - * (in document order). If the element is in the node-set, then the result - * is an open angle bracket (<), the element QName, the result of - * processing the namespace axis, the result of processing the attribute - * axis, a close angle bracket (>), the result of processing the child - * nodes of the element that are in the node-set (in document order), an - * open angle bracket, a forward slash (/), the element QName, and a close + * If the element is not in the node-set, then the result is obtained + * by processing the namespace axis, then the attribute axis, then + * processing the child nodes of the element that are in the node-set + * (in document order). If the element is in the node-set, then the result + * is an open angle bracket (<), the element QName, the result of + * processing the namespace axis, the result of processing the attribute + * axis, a close angle bracket (>), the result of processing the child + * nodes of the element that are in the node-set (in document order), an + * open angle bracket, a forward slash (/), the element QName, and a close * angle bracket. * * Returns non-negative value on success or negative value on fail @@ -1421,7 +1423,7 @@ return (-1); } - /* + /* * Check relative relative namespaces: * implementations of XML canonicalization MUST report an operation * failure on documents containing relative namespace URIs. @@ -1432,13 +1434,13 @@ } - /* + /* * Save ns_rendered stack position */ memset(&state, 0, sizeof(state)); xmlC14NVisibleNsStackSave(ctx->ns_rendered, &state); - if (visible) { + if (visible) { if (ctx->parent_is_doc) { /* save this flag into the stack */ parent_is_doc = ctx->parent_is_doc; @@ -1468,14 +1470,14 @@ if(visible) { xmlC14NVisibleNsStackShift(ctx->ns_rendered); } - + ret = xmlC14NProcessAttrsAxis(ctx, cur, visible); if (ret < 0) { xmlC14NErrInternal("processing attributes axis"); - return (-1); + return (-1); } - if (visible) { + if (visible) { xmlOutputBufferWriteString(ctx->buf, ">"); } if (cur->children != NULL) { @@ -1501,7 +1503,7 @@ } } - /* + /* * Restore ns_rendered stack position */ xmlC14NVisibleNsStackRestore(ctx->ns_rendered, &state); @@ -1510,9 +1512,9 @@ /** * xmlC14NProcessNode: - * @ctx: the pointer to C14N context object + * @ctx: the pointer to C14N context object * @cur: the node to process - * + * * Processes the given node * * Returns non-negative value on success or negative value on fail @@ -1537,9 +1539,9 @@ case XML_TEXT_NODE: /* * Text Nodes - * the string value, except all ampersands are replaced - * by &, all open angle brackets (<) are replaced by <, all closing - * angle brackets (>) are replaced by >, and all #xD characters are + * the string value, except all ampersands are replaced + * by &, all open angle brackets (<) are replaced by <, all closing + * angle brackets (>) are replaced by >, and all #xD characters are * replaced by . */ /* cdata sections are processed as text nodes */ @@ -1559,16 +1561,16 @@ } break; case XML_PI_NODE: - /* - * Processing Instruction (PI) Nodes- - * The opening PI symbol (). If the string value is empty, - * then the leading space is not added. Also, a trailing #xA is - * rendered after the closing PI symbol for PI children of the - * root node with a lesser document order than the document - * element, and a leading #xA is rendered before the opening PI - * symbol of PI children of the root node with a greater document + /* + * Processing Instruction (PI) Nodes- + * The opening PI symbol (). If the string value is empty, + * then the leading space is not added. Also, a trailing #xA is + * rendered after the closing PI symbol for PI children of the + * root node with a lesser document order than the document + * element, and a leading #xA is rendered before the opening PI + * symbol of PI children of the root node with a greater document * order than the document element. */ if (visible) { @@ -1607,17 +1609,17 @@ case XML_COMMENT_NODE: /* * Comment Nodes - * Nothing if generating canonical XML without comments. For - * canonical XML with comments, generate the opening comment - * symbol (). Also, a trailing #xA is rendered - * after the closing comment symbol for comment children of the - * root node with a lesser document order than the document - * element, and a leading #xA is rendered before the opening - * comment symbol of comment children of the root node with a - * greater document order than the document element. (Comment - * children of the root node represent comments outside of the - * top-level document element and outside of the document type + * Nothing if generating canonical XML without comments. For + * canonical XML with comments, generate the opening comment + * symbol (). Also, a trailing #xA is rendered + * after the closing comment symbol for comment children of the + * root node with a lesser document order than the document + * element, and a leading #xA is rendered before the opening + * comment symbol of comment children of the root node with a + * greater document order than the document element. (Comment + * children of the root node represent comments outside of the + * top-level document element and outside of the document type * declaration). */ if (visible && ctx->with_comments) { @@ -1687,8 +1689,8 @@ case XML_XINCLUDE_START: case XML_XINCLUDE_END: #endif - /* - * should be ignored according to "W3C Canonical XML" + /* + * should be ignored according to "W3C Canonical XML" */ break; default: @@ -1701,9 +1703,9 @@ /** * xmlC14NProcessNodeList: - * @ctx: the pointer to C14N context object + * @ctx: the pointer to C14N context object * @cur: the node to start from - * + * * Processes all nodes in the row starting from cur. * * Returns non-negative value on success or negative value on fail @@ -1728,7 +1730,7 @@ /** * xmlC14NFreeCtx: * @ctx: the pointer to C14N context object - * + * * Cleanups the C14N context object. */ @@ -1748,27 +1750,27 @@ /** * xmlC14NNewCtx: - * @doc: the XML document for canonization - * @is_visible_callback:the function to use to determine is node visible + * @doc: the XML document for canonization + * @is_visible_callback:the function to use to determine is node visible * or not - * @user_data: the first parameter for @is_visible_callback function + * @user_data: the first parameter for @is_visible_callback function * (in most cases, it is nodes set) * @mode: the c14n mode (see @xmlC14NMode) - * @inclusive_ns_prefixe the list of inclusive namespace prefixes + * @inclusive_ns_prefixe the list of inclusive namespace prefixes * ended with a NULL or NULL if there is no - * inclusive namespaces (only for ` + * inclusive namespaces (only for ` * canonicalization) - * @with_comments: include comments in the result (!=0) or not (==0) - * @buf: the output buffer to store canonical XML; this + * @with_comments: include comments in the result (!=0) or not (==0) + * @buf: the output buffer to store canonical XML; this * buffer MUST have encoder==NULL because C14N requires * UTF-8 output - * + * * Creates new C14N context object to store C14N parameters. * * Returns pointer to newly created object (success) or NULL (fail) */ static xmlC14NCtxPtr -xmlC14NNewCtx(xmlDocPtr doc, +xmlC14NNewCtx(xmlDocPtr doc, xmlC14NIsVisibleCallback is_visible_callback, void* user_data, xmlC14NMode mode, xmlChar ** inclusive_ns_prefixes, int with_comments, xmlOutputBufferPtr buf) @@ -1840,28 +1842,28 @@ /** * xmlC14NExecute: - * @doc: the XML document for canonization - * @is_visible_callback:the function to use to determine is node visible + * @doc: the XML document for canonization + * @is_visible_callback:the function to use to determine is node visible * or not - * @user_data: the first parameter for @is_visible_callback function + * @user_data: the first parameter for @is_visible_callback function * (in most cases, it is nodes set) * @mode: the c14n mode (see @xmlC14NMode) - * @inclusive_ns_prefixes: the list of inclusive namespace prefixes + * @inclusive_ns_prefixes: the list of inclusive namespace prefixes * ended with a NULL or NULL if there is no - * inclusive namespaces (only for exclusive + * inclusive namespaces (only for exclusive * canonicalization, ignored otherwise) - * @with_comments: include comments in the result (!=0) or not (==0) - * @buf: the output buffer to store canonical XML; this + * @with_comments: include comments in the result (!=0) or not (==0) + * @buf: the output buffer to store canonical XML; this * buffer MUST have encoder==NULL because C14N requires * UTF-8 output - * + * * Dumps the canonized image of given XML document into the provided buffer. * For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or * "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n) * - * Returns non-negative value on success or a negative value on fail + * Returns non-negative value on success or a negative value on fail */ -int +int xmlC14NExecute(xmlDocPtr doc, xmlC14NIsVisibleCallback is_visible_callback, void* user_data, int mode, xmlChar **inclusive_ns_prefixes, int with_comments, xmlOutputBufferPtr buf) { @@ -1875,15 +1877,15 @@ return (-1); } - /* for backward compatibility, we have to have "mode" as "int" + /* for backward compatibility, we have to have "mode" as "int" and here we check that user gives valid value */ switch(mode) { case XML_C14N_1_0: case XML_C14N_EXCLUSIVE_1_0: - case XML_C14N_1_1: + case XML_C14N_1_1: c14n_mode = (xmlC14NMode)mode; break; - default: + default: xmlC14NErrParam("invalid mode for executing c14n"); return (-1); } @@ -1897,7 +1899,7 @@ return (-1); } - ctx = xmlC14NNewCtx(doc, is_visible_callback, user_data, + ctx = xmlC14NNewCtx(doc, is_visible_callback, user_data, c14n_mode, inclusive_ns_prefixes, with_comments, buf); if (ctx == NULL) { @@ -1908,12 +1910,12 @@ - /* + /* * Root Node - * The root node is the parent of the top-level document element. The - * result of processing each of its child nodes that is in the node-set - * in document order. The root node does not generate a byte order mark, - * XML declaration, nor anything from within the document type + * The root node is the parent of the top-level document element. The + * result of processing each of its child nodes that is in the node-set + * in document order. The root node does not generate a byte order mark, + * XML declaration, nor anything from within the document type * declaration. */ if (doc->children != NULL) { @@ -1935,7 +1937,7 @@ return (-1); } - /* + /* * Cleanup */ xmlC14NFreeCtx(ctx); @@ -1944,30 +1946,30 @@ /** * xmlC14NDocSaveTo: - * @doc: the XML document for canonization - * @nodes: the nodes set to be included in the canonized image - * or NULL if all document nodes should be included + * @doc: the XML document for canonization + * @nodes: the nodes set to be included in the canonized image + * or NULL if all document nodes should be included * @mode: the c14n mode (see @xmlC14NMode) - * @inclusive_ns_prefixes: the list of inclusive namespace prefixes + * @inclusive_ns_prefixes: the list of inclusive namespace prefixes * ended with a NULL or NULL if there is no - * inclusive namespaces (only for exclusive + * inclusive namespaces (only for exclusive * canonicalization, ignored otherwise) - * @with_comments: include comments in the result (!=0) or not (==0) - * @buf: the output buffer to store canonical XML; this + * @with_comments: include comments in the result (!=0) or not (==0) + * @buf: the output buffer to store canonical XML; this * buffer MUST have encoder==NULL because C14N requires * UTF-8 output - * + * * Dumps the canonized image of given XML document into the provided buffer. * For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or * "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n) * - * Returns non-negative value on success or a negative value on fail + * Returns non-negative value on success or a negative value on fail */ int xmlC14NDocSaveTo(xmlDocPtr doc, xmlNodeSetPtr nodes, int mode, xmlChar ** inclusive_ns_prefixes, int with_comments, xmlOutputBufferPtr buf) { - return(xmlC14NExecute(doc, + return(xmlC14NExecute(doc, (xmlC14NIsVisibleCallback)xmlC14NIsNodeInNodeset, nodes, mode, @@ -1979,24 +1981,24 @@ /** * xmlC14NDocDumpMemory: - * @doc: the XML document for canonization - * @nodes: the nodes set to be included in the canonized image - * or NULL if all document nodes should be included + * @doc: the XML document for canonization + * @nodes: the nodes set to be included in the canonized image + * or NULL if all document nodes should be included * @mode: the c14n mode (see @xmlC14NMode) - * @inclusive_ns_prefixes: the list of inclusive namespace prefixes + * @inclusive_ns_prefixes: the list of inclusive namespace prefixes * ended with a NULL or NULL if there is no - * inclusive namespaces (only for exclusive + * inclusive namespaces (only for exclusive * canonicalization, ignored otherwise) - * @with_comments: include comments in the result (!=0) or not (==0) - * @doc_txt_ptr: the memory pointer for allocated canonical XML text; + * @with_comments: include comments in the result (!=0) or not (==0) + * @doc_txt_ptr: the memory pointer for allocated canonical XML text; * the caller of this functions is responsible for calling - * xmlFree() to free allocated memory - * + * xmlFree() to free allocated memory + * * Dumps the canonized image of given XML document into memory. * For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or * "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n) * - * Returns the number of bytes written on success or a negative value on fail + * Returns the number of bytes written on success or a negative value on fail */ int xmlC14NDocDumpMemory(xmlDocPtr doc, xmlNodeSetPtr nodes, @@ -2014,7 +2016,7 @@ *doc_txt_ptr = NULL; /* - * create memory buffer with UTF8 (default) encoding + * create memory buffer with UTF8 (default) encoding */ buf = xmlAllocOutputBuffer(NULL); if (buf == NULL) { @@ -2033,9 +2035,9 @@ return (-1); } - ret = buf->buffer->use; + ret = xmlBufUse(buf->buffer); if (ret > 0) { - *doc_txt_ptr = xmlStrndup(buf->buffer->content, ret); + *doc_txt_ptr = xmlStrndup(xmlBufContent(buf->buffer), ret); } (void) xmlOutputBufferClose(buf); @@ -2048,26 +2050,26 @@ /** * xmlC14NDocSave: - * @doc: the XML document for canonization - * @nodes: the nodes set to be included in the canonized image - * or NULL if all document nodes should be included + * @doc: the XML document for canonization + * @nodes: the nodes set to be included in the canonized image + * or NULL if all document nodes should be included * @mode: the c14n mode (see @xmlC14NMode) - * @inclusive_ns_prefixes: the list of inclusive namespace prefixes + * @inclusive_ns_prefixes: the list of inclusive namespace prefixes * ended with a NULL or NULL if there is no - * inclusive namespaces (only for exclusive + * inclusive namespaces (only for exclusive * canonicalization, ignored otherwise) - * @with_comments: include comments in the result (!=0) or not (==0) - * @filename: the filename to store canonical XML image - * @compression: the compression level (zlib requred): + * @with_comments: include comments in the result (!=0) or not (==0) + * @filename: the filename to store canonical XML image + * @compression: the compression level (zlib requred): * -1 - libxml default, - * 0 - uncompressed, + * 0 - uncompressed, * >0 - compression level - * + * * Dumps the canonized image of given XML document into the file. * For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or * "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n) * - * Returns the number of bytes written success or a negative value on fail + * Returns the number of bytes written success or a negative value on fail */ int xmlC14NDocSave(xmlDocPtr doc, xmlNodeSetPtr nodes, @@ -2086,7 +2088,7 @@ compression = xmlGetCompressMode(); #endif - /* + /* * save the content to a temp buffer, use default UTF8 encoding. */ buf = xmlOutputBufferCreateFilename(filename, NULL, compression); @@ -2106,8 +2108,8 @@ return (-1); } - /* - * get the numbers of bytes written + /* + * get the numbers of bytes written */ ret = xmlOutputBufferClose(buf); return (ret); @@ -2121,14 +2123,14 @@ #define growBufferReentrant() { \ buffer_size *= 2; \ buffer = (xmlChar *) \ - xmlRealloc(buffer, buffer_size * sizeof(xmlChar)); \ + xmlRealloc(buffer, buffer_size * sizeof(xmlChar)); \ if (buffer == NULL) { \ xmlC14NErrMemory("growing buffer"); \ return(NULL); \ } \ } -/** +/** * xmlC11NNormalizeString: * @input: the input string * @mode: the normalization mode (attribute, comment, PI or text) Index: catalog.c =================================================================== --- catalog.c (revision 58183) +++ catalog.c (working copy) @@ -1,5 +1,5 @@ /** - * catalog.c: set of generic Catalog related routines + * catalog.c: set of generic Catalog related routines * * Reference: SGML Open Technical Resolution TR9401:1997. * http://www.jclark.com/sp/catalog.htm @@ -41,6 +41,8 @@ #include #include +#include "buf.h" + #define MAX_DELEGATE 50 #define MAX_CATAL_DEPTH 50 @@ -60,7 +62,7 @@ *> values "system" and "public". I have made the default be "system" to *> match yours. */ -#define TODO \ +#define TODO \ xmlGenericError(xmlGenericErrorContext, \ "Unimplemented block at %s:%d\n", \ __FILE__, __LINE__); @@ -206,7 +208,7 @@ /************************************************************************ * * - * Catalog error handlers * + * Catalog error handlers * * * ************************************************************************/ @@ -259,9 +261,9 @@ * @name: name of the entry * @value: value of the entry * @prefer: the PUBLIC vs. SYSTEM current preference value - * @group: for members of a group, the group entry + * @group: for members of a group, the group entry * - * create a new Catalog entry, this type is shared both by XML and + * create a new Catalog entry, this type is shared both by XML and * SGML catalogs, but the acceptable types values differs. * * Returns the xmlCatalogEntryPtr or NULL in case of error @@ -399,7 +401,7 @@ * @type: type of catalog * @prefer: the PUBLIC vs. SYSTEM current preference value * - * create a new Catalog, this type is shared both by XML and + * create a new Catalog, this type is shared both by XML and * SGML catalogs, but the acceptable types values differs. * * Returns the xmlCatalogPtr or NULL in case of error @@ -567,7 +569,7 @@ xns = xmlSearchNsByHref(doc, node, XML_XML_NAMESPACE); if (xns != NULL) xmlSetNsProp(node, xns, BAD_CAST "base", - cur->value); + cur->value); } switch (cur->prefer) { case XML_CATA_PREFER_NONE: @@ -685,7 +687,7 @@ xmlAddChild((xmlNodePtr) doc, catalog); xmlDumpXMLCatalogNode(catal, catalog, doc, ns, NULL); - + /* * reserialize it */ @@ -822,7 +824,7 @@ if (xmlStrncmp(urn, BAD_CAST XML_URN_PUBID, sizeof(XML_URN_PUBID) - 1)) return(NULL); urn += sizeof(XML_URN_PUBID) - 1; - + while (*urn != 0) { if (i > sizeof(result) - 4) break; @@ -912,10 +914,7 @@ inputStream->filename = (char *) xmlCanonicPath((const xmlChar *)filename); inputStream->buf = buf; - inputStream->base = inputStream->buf->buffer->content; - inputStream->cur = inputStream->buf->buffer->content; - inputStream->end = - &inputStream->buf->buffer->content[inputStream->buf->buffer->use]; + xmlBufResetInput(buf->buffer, inputStream); inputPush(ctxt, inputStream); if ((ctxt->directory == NULL) && (directory == NULL)) @@ -938,7 +937,7 @@ ctxt->myDoc = NULL; } xmlFreeParserCtxt(ctxt); - + return(ret); } @@ -1328,7 +1327,7 @@ * * Parses the catalog file to extract the XML tree and then analyze the * tree to build a list of Catalog entries corresponding to this catalog - * + * * Returns the resulting Catalog entries list */ static xmlCatalogEntryPtr @@ -1396,19 +1395,17 @@ * @catal: an existing but incomplete catalog entry * * Fetch and parse the subcatalog referenced by an entry - * + * * Returns 0 in case of success, -1 otherwise */ static int xmlFetchXMLCatalogFile(xmlCatalogEntryPtr catal) { xmlCatalogEntryPtr doc; - if (catal == NULL) + if (catal == NULL) return(-1); if (catal->URL == NULL) return(-1); - if (catal->children != NULL) - return(-1); /* * lock the whole catalog for modification @@ -1497,7 +1494,7 @@ xmlCatalogEntryType typ; int doregister = 0; - if ((catal == NULL) || + if ((catal == NULL) || ((catal->type != XML_CATA_CATALOG) && (catal->type != XML_CATA_BROKEN_CATALOG))) return(-1); @@ -1573,7 +1570,7 @@ xmlCatalogEntryPtr cur; int ret = 0; - if ((catal == NULL) || + if ((catal == NULL) || ((catal->type != XML_CATA_CATALOG) && (catal->type != XML_CATA_BROKEN_CATALOG))) return(-1); @@ -1788,7 +1785,7 @@ } if (nbList < MAX_DELEGATE) delegates[nbList++] = cur->URL; - + if (cur->children == NULL) { xmlFetchXMLCatalogFile(cur); } @@ -2001,7 +1998,7 @@ xmlChar *ret = NULL; xmlChar *urnID = NULL; xmlChar *normid; - + if (catal == NULL) return(NULL); if ((pubID == NULL) && (sysID == NULL)) @@ -2010,7 +2007,7 @@ normid = xmlCatalogNormalizePublic(pubID); if (normid != NULL) pubID = (*normid != 0 ? normid : NULL); - + if (!xmlStrncmp(pubID, BAD_CAST XML_URN_PUBID, sizeof(XML_URN_PUBID) - 1)) { urnID = xmlCatalogUnWrapURN(pubID); if (xmlDebugCatalogs) { @@ -2090,7 +2087,7 @@ xmlCatalogListXMLResolveURI(xmlCatalogEntryPtr catal, const xmlChar *URI) { xmlChar *ret = NULL; xmlChar *urnID = NULL; - + if (catal == NULL) return(NULL); if (URI == NULL) @@ -2150,7 +2147,7 @@ */ static const xmlChar * xmlParseSGMLCatalogComment(const xmlChar *cur) { - if ((cur[0] != '-') || (cur[1] != '-')) + if ((cur[0] != '-') || (cur[1] != '-')) return(cur); SKIP(2); while ((cur[0] != 0) && ((cur[0] != '-') || ((cur[1] != '-')))) @@ -2685,7 +2682,7 @@ first = content; - + while ((*first != 0) && (*first != '-') && (*first != '<') && (!(((*first >= 'A') && (*first <= 'Z')) || ((*first >= 'a') && (*first <= 'z'))))) @@ -2780,7 +2777,7 @@ if ((sysID == NULL) || (catal == NULL)) return(NULL); - + if (xmlDebugCatalogs) xmlGenericError(xmlGenericErrorContext, "Resolve sysID %s\n", sysID); @@ -2815,7 +2812,7 @@ if ((pubID == NULL) || (catal == NULL)) return(NULL); - + if (xmlDebugCatalogs) xmlGenericError(xmlGenericErrorContext, "Resolve pubID %s\n", pubID); @@ -2934,7 +2931,7 @@ } else { xmlHashScan(catal->sgml, (xmlHashScanner) xmlCatalogDumpEntry, out); - } + } } #endif /* LIBXML_OUTPUT_ENABLED */ @@ -2942,7 +2939,7 @@ * xmlACatalogAdd: * @catal: a Catalog * @type: the type of record to add to the catalog - * @orig: the system, public or prefix to match + * @orig: the system, public or prefix to match * @replace: the replacement value for the match * * Add an entry in the catalog, it may overwrite existing but @@ -3001,7 +2998,7 @@ (xmlHashDeallocator) xmlFreeCatalogEntry); if (res == 0) res = 1; - } + } return(res); } @@ -3060,7 +3057,7 @@ return(1); if (res < 0) return(-1); - } + } return(0); } @@ -3083,7 +3080,7 @@ if (xmlCatalogInitialized != 0) return; - if (getenv("XML_DEBUG_CATALOG")) + if (getenv("XML_DEBUG_CATALOG")) xmlDebugCatalogs = 1; xmlCatalogMutex = xmlNewRMutex(); @@ -3104,7 +3101,7 @@ xmlInitializeCatalogData(); xmlRMutexLock(xmlCatalogMutex); - if (getenv("XML_DEBUG_CATALOG")) + if (getenv("XML_DEBUG_CATALOG")) xmlDebugCatalogs = 1; if (xmlDefaultCatalog == NULL) { @@ -3127,7 +3124,7 @@ unsigned long len = GetModuleFileNameA(hmodule, buf, 255); if (len != 0) { char* p = &(buf[len]); - while (*p != '\\' && p > buf) + while (*p != '\\' && p > buf) p--; if (p != buf) { xmlChar* uri; @@ -3146,15 +3143,15 @@ catalogs = XML_XML_DEFAULT_CATALOG; #endif - catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE, + catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE, xmlCatalogDefaultPrefer); if (catal != NULL) { - /* the XML_CATALOG_FILES envvar is allowed to contain a + /* the XML_CATALOG_FILES envvar is allowed to contain a space-separated list of entries. */ cur = catalogs; nextent = &catal->xml; while (*cur != '\0') { - while (xmlIsBlank_ch(*cur)) + while (xmlIsBlank_ch(*cur)) cur++; if (*cur != 0) { paths = cur; @@ -3279,7 +3276,7 @@ xmlGenericError(xmlGenericErrorContext, "Catalogs cleanup\n"); if (xmlCatalogXMLFiles != NULL) - xmlHashFree(xmlCatalogXMLFiles, + xmlHashFree(xmlCatalogXMLFiles, (xmlHashDeallocator)xmlFreeCatalogHashEntryList); xmlCatalogXMLFiles = NULL; if (xmlDefaultCatalog != NULL) @@ -3394,7 +3391,7 @@ /** * xmlCatalogAdd: * @type: the type of record to add to the catalog - * @orig: the system, public or prefix to match + * @orig: the system, public or prefix to match * @replace: the replacement value for the match * * Add an entry in the catalog, it may overwrite existing but @@ -3425,7 +3422,7 @@ xmlRMutexUnlock(xmlCatalogMutex); return(0); - } + } res = xmlACatalogAdd(xmlDefaultCatalog, type, orig, replace); xmlRMutexUnlock(xmlCatalogMutex); @@ -3613,7 +3610,7 @@ * * Returns the updated list */ -void * +void * xmlCatalogAddLocal(void *catalogs, const xmlChar *URL) { xmlCatalogEntryPtr catal, add; @@ -3633,7 +3630,7 @@ return(catalogs); catal = (xmlCatalogEntryPtr) catalogs; - if (catal == NULL) + if (catal == NULL) return((void *) add); while (catal->next != NULL) @@ -3648,7 +3645,7 @@ * @pubID: the public ID string * @sysID: the system ID string * - * Do a complete resolution lookup of an External Identifier using a + * Do a complete resolution lookup of an External Identifier using a * document's private catalog list * * Returns the URI of the resource or NULL if not found, it must be freed @@ -3693,7 +3690,7 @@ * @catalogs: a document's list of catalogs * @URI: the URI * - * Do a complete resolution lookup of an URI using a + * Do a complete resolution lookup of an URI using a * document's private catalog list * * Returns the URI of the resource or NULL if not found, it must be freed @@ -3754,7 +3751,7 @@ if (sysID == NULL) return(NULL); - + /* * Check first the XML catalogs */ @@ -3798,7 +3795,7 @@ if (pubID == NULL) return(NULL); - + /* * Check first the XML catalogs */ Index: chvalid.c =================================================================== --- chvalid.c (revision 58183) +++ chvalid.c (working copy) @@ -46,109 +46,109 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static const xmlChSRange xmlIsBaseChar_srng[] = { {0x100, 0x131}, - {0x134, 0x13e}, {0x141, 0x148}, {0x14a, 0x17e}, {0x180, 0x1c3}, - {0x1cd, 0x1f0}, {0x1f4, 0x1f5}, {0x1fa, 0x217}, {0x250, 0x2a8}, - {0x2bb, 0x2c1}, {0x386, 0x386}, {0x388, 0x38a}, {0x38c, 0x38c}, - {0x38e, 0x3a1}, {0x3a3, 0x3ce}, {0x3d0, 0x3d6}, {0x3da, 0x3da}, - {0x3dc, 0x3dc}, {0x3de, 0x3de}, {0x3e0, 0x3e0}, {0x3e2, 0x3f3}, - {0x401, 0x40c}, {0x40e, 0x44f}, {0x451, 0x45c}, {0x45e, 0x481}, - {0x490, 0x4c4}, {0x4c7, 0x4c8}, {0x4cb, 0x4cc}, {0x4d0, 0x4eb}, - {0x4ee, 0x4f5}, {0x4f8, 0x4f9}, {0x531, 0x556}, {0x559, 0x559}, - {0x561, 0x586}, {0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a}, - {0x641, 0x64a}, {0x671, 0x6b7}, {0x6ba, 0x6be}, {0x6c0, 0x6ce}, - {0x6d0, 0x6d3}, {0x6d5, 0x6d5}, {0x6e5, 0x6e6}, {0x905, 0x939}, - {0x93d, 0x93d}, {0x958, 0x961}, {0x985, 0x98c}, {0x98f, 0x990}, - {0x993, 0x9a8}, {0x9aa, 0x9b0}, {0x9b2, 0x9b2}, {0x9b6, 0x9b9}, - {0x9dc, 0x9dd}, {0x9df, 0x9e1}, {0x9f0, 0x9f1}, {0xa05, 0xa0a}, - {0xa0f, 0xa10}, {0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa32, 0xa33}, - {0xa35, 0xa36}, {0xa38, 0xa39}, {0xa59, 0xa5c}, {0xa5e, 0xa5e}, - {0xa72, 0xa74}, {0xa85, 0xa8b}, {0xa8d, 0xa8d}, {0xa8f, 0xa91}, - {0xa93, 0xaa8}, {0xaaa, 0xab0}, {0xab2, 0xab3}, {0xab5, 0xab9}, - {0xabd, 0xabd}, {0xae0, 0xae0}, {0xb05, 0xb0c}, {0xb0f, 0xb10}, - {0xb13, 0xb28}, {0xb2a, 0xb30}, {0xb32, 0xb33}, {0xb36, 0xb39}, - {0xb3d, 0xb3d}, {0xb5c, 0xb5d}, {0xb5f, 0xb61}, {0xb85, 0xb8a}, - {0xb8e, 0xb90}, {0xb92, 0xb95}, {0xb99, 0xb9a}, {0xb9c, 0xb9c}, - {0xb9e, 0xb9f}, {0xba3, 0xba4}, {0xba8, 0xbaa}, {0xbae, 0xbb5}, - {0xbb7, 0xbb9}, {0xc05, 0xc0c}, {0xc0e, 0xc10}, {0xc12, 0xc28}, - {0xc2a, 0xc33}, {0xc35, 0xc39}, {0xc60, 0xc61}, {0xc85, 0xc8c}, - {0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, - {0xcde, 0xcde}, {0xce0, 0xce1}, {0xd05, 0xd0c}, {0xd0e, 0xd10}, - {0xd12, 0xd28}, {0xd2a, 0xd39}, {0xd60, 0xd61}, {0xe01, 0xe2e}, - {0xe30, 0xe30}, {0xe32, 0xe33}, {0xe40, 0xe45}, {0xe81, 0xe82}, - {0xe84, 0xe84}, {0xe87, 0xe88}, {0xe8a, 0xe8a}, {0xe8d, 0xe8d}, - {0xe94, 0xe97}, {0xe99, 0xe9f}, {0xea1, 0xea3}, {0xea5, 0xea5}, - {0xea7, 0xea7}, {0xeaa, 0xeab}, {0xead, 0xeae}, {0xeb0, 0xeb0}, - {0xeb2, 0xeb3}, {0xebd, 0xebd}, {0xec0, 0xec4}, {0xf40, 0xf47}, - {0xf49, 0xf69}, {0x10a0, 0x10c5}, {0x10d0, 0x10f6}, {0x1100, 0x1100}, - {0x1102, 0x1103}, {0x1105, 0x1107}, {0x1109, 0x1109}, {0x110b, 0x110c}, - {0x110e, 0x1112}, {0x113c, 0x113c}, {0x113e, 0x113e}, {0x1140, 0x1140}, - {0x114c, 0x114c}, {0x114e, 0x114e}, {0x1150, 0x1150}, {0x1154, 0x1155}, - {0x1159, 0x1159}, {0x115f, 0x1161}, {0x1163, 0x1163}, {0x1165, 0x1165}, - {0x1167, 0x1167}, {0x1169, 0x1169}, {0x116d, 0x116e}, {0x1172, 0x1173}, - {0x1175, 0x1175}, {0x119e, 0x119e}, {0x11a8, 0x11a8}, {0x11ab, 0x11ab}, - {0x11ae, 0x11af}, {0x11b7, 0x11b8}, {0x11ba, 0x11ba}, {0x11bc, 0x11c2}, - {0x11eb, 0x11eb}, {0x11f0, 0x11f0}, {0x11f9, 0x11f9}, {0x1e00, 0x1e9b}, - {0x1ea0, 0x1ef9}, {0x1f00, 0x1f15}, {0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, - {0x1f48, 0x1f4d}, {0x1f50, 0x1f57}, {0x1f59, 0x1f59}, {0x1f5b, 0x1f5b}, - {0x1f5d, 0x1f5d}, {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, {0x1fb6, 0x1fbc}, - {0x1fbe, 0x1fbe}, {0x1fc2, 0x1fc4}, {0x1fc6, 0x1fcc}, {0x1fd0, 0x1fd3}, - {0x1fd6, 0x1fdb}, {0x1fe0, 0x1fec}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffc}, - {0x2126, 0x2126}, {0x212a, 0x212b}, {0x212e, 0x212e}, {0x2180, 0x2182}, +static const xmlChSRange xmlIsBaseChar_srng[] = { {0x100, 0x131}, + {0x134, 0x13e}, {0x141, 0x148}, {0x14a, 0x17e}, {0x180, 0x1c3}, + {0x1cd, 0x1f0}, {0x1f4, 0x1f5}, {0x1fa, 0x217}, {0x250, 0x2a8}, + {0x2bb, 0x2c1}, {0x386, 0x386}, {0x388, 0x38a}, {0x38c, 0x38c}, + {0x38e, 0x3a1}, {0x3a3, 0x3ce}, {0x3d0, 0x3d6}, {0x3da, 0x3da}, + {0x3dc, 0x3dc}, {0x3de, 0x3de}, {0x3e0, 0x3e0}, {0x3e2, 0x3f3}, + {0x401, 0x40c}, {0x40e, 0x44f}, {0x451, 0x45c}, {0x45e, 0x481}, + {0x490, 0x4c4}, {0x4c7, 0x4c8}, {0x4cb, 0x4cc}, {0x4d0, 0x4eb}, + {0x4ee, 0x4f5}, {0x4f8, 0x4f9}, {0x531, 0x556}, {0x559, 0x559}, + {0x561, 0x586}, {0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a}, + {0x641, 0x64a}, {0x671, 0x6b7}, {0x6ba, 0x6be}, {0x6c0, 0x6ce}, + {0x6d0, 0x6d3}, {0x6d5, 0x6d5}, {0x6e5, 0x6e6}, {0x905, 0x939}, + {0x93d, 0x93d}, {0x958, 0x961}, {0x985, 0x98c}, {0x98f, 0x990}, + {0x993, 0x9a8}, {0x9aa, 0x9b0}, {0x9b2, 0x9b2}, {0x9b6, 0x9b9}, + {0x9dc, 0x9dd}, {0x9df, 0x9e1}, {0x9f0, 0x9f1}, {0xa05, 0xa0a}, + {0xa0f, 0xa10}, {0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa32, 0xa33}, + {0xa35, 0xa36}, {0xa38, 0xa39}, {0xa59, 0xa5c}, {0xa5e, 0xa5e}, + {0xa72, 0xa74}, {0xa85, 0xa8b}, {0xa8d, 0xa8d}, {0xa8f, 0xa91}, + {0xa93, 0xaa8}, {0xaaa, 0xab0}, {0xab2, 0xab3}, {0xab5, 0xab9}, + {0xabd, 0xabd}, {0xae0, 0xae0}, {0xb05, 0xb0c}, {0xb0f, 0xb10}, + {0xb13, 0xb28}, {0xb2a, 0xb30}, {0xb32, 0xb33}, {0xb36, 0xb39}, + {0xb3d, 0xb3d}, {0xb5c, 0xb5d}, {0xb5f, 0xb61}, {0xb85, 0xb8a}, + {0xb8e, 0xb90}, {0xb92, 0xb95}, {0xb99, 0xb9a}, {0xb9c, 0xb9c}, + {0xb9e, 0xb9f}, {0xba3, 0xba4}, {0xba8, 0xbaa}, {0xbae, 0xbb5}, + {0xbb7, 0xbb9}, {0xc05, 0xc0c}, {0xc0e, 0xc10}, {0xc12, 0xc28}, + {0xc2a, 0xc33}, {0xc35, 0xc39}, {0xc60, 0xc61}, {0xc85, 0xc8c}, + {0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, + {0xcde, 0xcde}, {0xce0, 0xce1}, {0xd05, 0xd0c}, {0xd0e, 0xd10}, + {0xd12, 0xd28}, {0xd2a, 0xd39}, {0xd60, 0xd61}, {0xe01, 0xe2e}, + {0xe30, 0xe30}, {0xe32, 0xe33}, {0xe40, 0xe45}, {0xe81, 0xe82}, + {0xe84, 0xe84}, {0xe87, 0xe88}, {0xe8a, 0xe8a}, {0xe8d, 0xe8d}, + {0xe94, 0xe97}, {0xe99, 0xe9f}, {0xea1, 0xea3}, {0xea5, 0xea5}, + {0xea7, 0xea7}, {0xeaa, 0xeab}, {0xead, 0xeae}, {0xeb0, 0xeb0}, + {0xeb2, 0xeb3}, {0xebd, 0xebd}, {0xec0, 0xec4}, {0xf40, 0xf47}, + {0xf49, 0xf69}, {0x10a0, 0x10c5}, {0x10d0, 0x10f6}, {0x1100, 0x1100}, + {0x1102, 0x1103}, {0x1105, 0x1107}, {0x1109, 0x1109}, {0x110b, 0x110c}, + {0x110e, 0x1112}, {0x113c, 0x113c}, {0x113e, 0x113e}, {0x1140, 0x1140}, + {0x114c, 0x114c}, {0x114e, 0x114e}, {0x1150, 0x1150}, {0x1154, 0x1155}, + {0x1159, 0x1159}, {0x115f, 0x1161}, {0x1163, 0x1163}, {0x1165, 0x1165}, + {0x1167, 0x1167}, {0x1169, 0x1169}, {0x116d, 0x116e}, {0x1172, 0x1173}, + {0x1175, 0x1175}, {0x119e, 0x119e}, {0x11a8, 0x11a8}, {0x11ab, 0x11ab}, + {0x11ae, 0x11af}, {0x11b7, 0x11b8}, {0x11ba, 0x11ba}, {0x11bc, 0x11c2}, + {0x11eb, 0x11eb}, {0x11f0, 0x11f0}, {0x11f9, 0x11f9}, {0x1e00, 0x1e9b}, + {0x1ea0, 0x1ef9}, {0x1f00, 0x1f15}, {0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, + {0x1f48, 0x1f4d}, {0x1f50, 0x1f57}, {0x1f59, 0x1f59}, {0x1f5b, 0x1f5b}, + {0x1f5d, 0x1f5d}, {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, {0x1fb6, 0x1fbc}, + {0x1fbe, 0x1fbe}, {0x1fc2, 0x1fc4}, {0x1fc6, 0x1fcc}, {0x1fd0, 0x1fd3}, + {0x1fd6, 0x1fdb}, {0x1fe0, 0x1fec}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffc}, + {0x2126, 0x2126}, {0x212a, 0x212b}, {0x212e, 0x212e}, {0x2180, 0x2182}, {0x3041, 0x3094}, {0x30a1, 0x30fa}, {0x3105, 0x312c}, {0xac00, 0xd7a3}}; const xmlChRangeGroup xmlIsBaseCharGroup = {197, 0, xmlIsBaseChar_srng, (xmlChLRangePtr)0}; -static const xmlChSRange xmlIsChar_srng[] = { {0x100, 0xd7ff}, +static const xmlChSRange xmlIsChar_srng[] = { {0x100, 0xd7ff}, {0xe000, 0xfffd}}; static const xmlChLRange xmlIsChar_lrng[] = { {0x10000, 0x10ffff}}; const xmlChRangeGroup xmlIsCharGroup = {2, 1, xmlIsChar_srng, xmlIsChar_lrng}; -static const xmlChSRange xmlIsCombining_srng[] = { {0x300, 0x345}, - {0x360, 0x361}, {0x483, 0x486}, {0x591, 0x5a1}, {0x5a3, 0x5b9}, - {0x5bb, 0x5bd}, {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4}, - {0x64b, 0x652}, {0x670, 0x670}, {0x6d6, 0x6dc}, {0x6dd, 0x6df}, - {0x6e0, 0x6e4}, {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x901, 0x903}, - {0x93c, 0x93c}, {0x93e, 0x94c}, {0x94d, 0x94d}, {0x951, 0x954}, - {0x962, 0x963}, {0x981, 0x983}, {0x9bc, 0x9bc}, {0x9be, 0x9be}, - {0x9bf, 0x9bf}, {0x9c0, 0x9c4}, {0x9c7, 0x9c8}, {0x9cb, 0x9cd}, - {0x9d7, 0x9d7}, {0x9e2, 0x9e3}, {0xa02, 0xa02}, {0xa3c, 0xa3c}, - {0xa3e, 0xa3e}, {0xa3f, 0xa3f}, {0xa40, 0xa42}, {0xa47, 0xa48}, - {0xa4b, 0xa4d}, {0xa70, 0xa71}, {0xa81, 0xa83}, {0xabc, 0xabc}, - {0xabe, 0xac5}, {0xac7, 0xac9}, {0xacb, 0xacd}, {0xb01, 0xb03}, - {0xb3c, 0xb3c}, {0xb3e, 0xb43}, {0xb47, 0xb48}, {0xb4b, 0xb4d}, - {0xb56, 0xb57}, {0xb82, 0xb83}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8}, - {0xbca, 0xbcd}, {0xbd7, 0xbd7}, {0xc01, 0xc03}, {0xc3e, 0xc44}, - {0xc46, 0xc48}, {0xc4a, 0xc4d}, {0xc55, 0xc56}, {0xc82, 0xc83}, - {0xcbe, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xcd5, 0xcd6}, - {0xd02, 0xd03}, {0xd3e, 0xd43}, {0xd46, 0xd48}, {0xd4a, 0xd4d}, - {0xd57, 0xd57}, {0xe31, 0xe31}, {0xe34, 0xe3a}, {0xe47, 0xe4e}, - {0xeb1, 0xeb1}, {0xeb4, 0xeb9}, {0xebb, 0xebc}, {0xec8, 0xecd}, - {0xf18, 0xf19}, {0xf35, 0xf35}, {0xf37, 0xf37}, {0xf39, 0xf39}, - {0xf3e, 0xf3e}, {0xf3f, 0xf3f}, {0xf71, 0xf84}, {0xf86, 0xf8b}, - {0xf90, 0xf95}, {0xf97, 0xf97}, {0xf99, 0xfad}, {0xfb1, 0xfb7}, - {0xfb9, 0xfb9}, {0x20d0, 0x20dc}, {0x20e1, 0x20e1}, {0x302a, 0x302f}, +static const xmlChSRange xmlIsCombining_srng[] = { {0x300, 0x345}, + {0x360, 0x361}, {0x483, 0x486}, {0x591, 0x5a1}, {0x5a3, 0x5b9}, + {0x5bb, 0x5bd}, {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4}, + {0x64b, 0x652}, {0x670, 0x670}, {0x6d6, 0x6dc}, {0x6dd, 0x6df}, + {0x6e0, 0x6e4}, {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x901, 0x903}, + {0x93c, 0x93c}, {0x93e, 0x94c}, {0x94d, 0x94d}, {0x951, 0x954}, + {0x962, 0x963}, {0x981, 0x983}, {0x9bc, 0x9bc}, {0x9be, 0x9be}, + {0x9bf, 0x9bf}, {0x9c0, 0x9c4}, {0x9c7, 0x9c8}, {0x9cb, 0x9cd}, + {0x9d7, 0x9d7}, {0x9e2, 0x9e3}, {0xa02, 0xa02}, {0xa3c, 0xa3c}, + {0xa3e, 0xa3e}, {0xa3f, 0xa3f}, {0xa40, 0xa42}, {0xa47, 0xa48}, + {0xa4b, 0xa4d}, {0xa70, 0xa71}, {0xa81, 0xa83}, {0xabc, 0xabc}, + {0xabe, 0xac5}, {0xac7, 0xac9}, {0xacb, 0xacd}, {0xb01, 0xb03}, + {0xb3c, 0xb3c}, {0xb3e, 0xb43}, {0xb47, 0xb48}, {0xb4b, 0xb4d}, + {0xb56, 0xb57}, {0xb82, 0xb83}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8}, + {0xbca, 0xbcd}, {0xbd7, 0xbd7}, {0xc01, 0xc03}, {0xc3e, 0xc44}, + {0xc46, 0xc48}, {0xc4a, 0xc4d}, {0xc55, 0xc56}, {0xc82, 0xc83}, + {0xcbe, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xcd5, 0xcd6}, + {0xd02, 0xd03}, {0xd3e, 0xd43}, {0xd46, 0xd48}, {0xd4a, 0xd4d}, + {0xd57, 0xd57}, {0xe31, 0xe31}, {0xe34, 0xe3a}, {0xe47, 0xe4e}, + {0xeb1, 0xeb1}, {0xeb4, 0xeb9}, {0xebb, 0xebc}, {0xec8, 0xecd}, + {0xf18, 0xf19}, {0xf35, 0xf35}, {0xf37, 0xf37}, {0xf39, 0xf39}, + {0xf3e, 0xf3e}, {0xf3f, 0xf3f}, {0xf71, 0xf84}, {0xf86, 0xf8b}, + {0xf90, 0xf95}, {0xf97, 0xf97}, {0xf99, 0xfad}, {0xfb1, 0xfb7}, + {0xfb9, 0xfb9}, {0x20d0, 0x20dc}, {0x20e1, 0x20e1}, {0x302a, 0x302f}, {0x3099, 0x3099}, {0x309a, 0x309a}}; const xmlChRangeGroup xmlIsCombiningGroup = {95, 0, xmlIsCombining_srng, (xmlChLRangePtr)0}; -static const xmlChSRange xmlIsDigit_srng[] = { {0x660, 0x669}, - {0x6f0, 0x6f9}, {0x966, 0x96f}, {0x9e6, 0x9ef}, {0xa66, 0xa6f}, - {0xae6, 0xaef}, {0xb66, 0xb6f}, {0xbe7, 0xbef}, {0xc66, 0xc6f}, - {0xce6, 0xcef}, {0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9}, +static const xmlChSRange xmlIsDigit_srng[] = { {0x660, 0x669}, + {0x6f0, 0x6f9}, {0x966, 0x96f}, {0x9e6, 0x9ef}, {0xa66, 0xa6f}, + {0xae6, 0xaef}, {0xb66, 0xb6f}, {0xbe7, 0xbef}, {0xc66, 0xc6f}, + {0xce6, 0xcef}, {0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9}, {0xf20, 0xf29}}; const xmlChRangeGroup xmlIsDigitGroup = {14, 0, xmlIsDigit_srng, (xmlChLRangePtr)0}; -static const xmlChSRange xmlIsExtender_srng[] = { {0x2d0, 0x2d0}, - {0x2d1, 0x2d1}, {0x387, 0x387}, {0x640, 0x640}, {0xe46, 0xe46}, - {0xec6, 0xec6}, {0x3005, 0x3005}, {0x3031, 0x3035}, {0x309d, 0x309e}, +static const xmlChSRange xmlIsExtender_srng[] = { {0x2d0, 0x2d0}, + {0x2d1, 0x2d1}, {0x387, 0x387}, {0x640, 0x640}, {0xe46, 0xe46}, + {0xec6, 0xec6}, {0x3005, 0x3005}, {0x3031, 0x3035}, {0x309d, 0x309e}, {0x30fc, 0x30fe}}; const xmlChRangeGroup xmlIsExtenderGroup = {10, 0, xmlIsExtender_srng, (xmlChLRangePtr)0}; -static const xmlChSRange xmlIsIdeographic_srng[] = { {0x3007, 0x3007}, +static const xmlChSRange xmlIsIdeographic_srng[] = { {0x3007, 0x3007}, {0x3021, 0x3029}, {0x4e00, 0x9fa5}}; const xmlChRangeGroup xmlIsIdeographicGroup = {3, 0, xmlIsIdeographic_srng, (xmlChLRangePtr)0}; Index: config.h.in =================================================================== --- config.h.in (revision 58183) +++ config.h.in (working copy) @@ -1,21 +1,5 @@ /* config.h.in. Generated from configure.in by autoheader. */ -#undef PACKAGE -#undef VERSION -#undef HAVE_LIBZ -#undef HAVE_LIBM -#undef HAVE_ISINF -#undef HAVE_ISNAN -#undef HAVE_LIBHISTORY -#undef HAVE_LIBREADLINE -#undef HAVE_LIBPTHREAD -#undef HAVE_PTHREAD_H -/* Define if IPV6 support is there */ -#undef SUPPORT_IP6 - -/* Define if getaddrinfo is there */ -#undef HAVE_GETADDRINFO - /* Define to 1 if you have the header file. */ #undef HAVE_ANSIDECL_H @@ -85,8 +69,8 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H_H +/* Define to 1 if you have the `isascii' function. */ +#undef HAVE_ISASCII /* Define if isinf is there */ #undef HAVE_ISINF @@ -100,6 +84,9 @@ /* Define if history library is there (-lhistory) */ #undef HAVE_LIBHISTORY +/* Have compression library */ +#undef HAVE_LIBLZMA + /* Define if pthread library is there (-lpthread) */ #undef HAVE_LIBPTHREAD @@ -115,6 +102,9 @@ /* Define to 1 if you have the `localtime' function. */ #undef HAVE_LOCALTIME +/* Define to 1 if you have the header file. */ +#undef HAVE_LZMA_H + /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H @@ -124,6 +114,17 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H +/* Define to 1 if you have the `mmap' function. */ +#undef HAVE_MMAP + +/* Define to 1 if you have the `munmap' function. */ +#undef HAVE_MUNMAP + +/* mmap() is no good without munmap() */ +#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP) +# undef /**/ HAVE_MMAP +#endif + /* Define to 1 if you have the header file. */ #undef HAVE_NAN_H @@ -145,6 +146,15 @@ /* Define if is there */ #undef HAVE_PTHREAD_H +/* Define to 1 if you have the `putenv' function. */ +#undef HAVE_PUTENV + +/* Define to 1 if you have the `rand' function. */ +#undef HAVE_RAND + +/* Define to 1 if you have the `rand_r' function. */ +#undef HAVE_RAND_R + /* Define to 1 if you have the header file. */ #undef HAVE_RESOLV_H @@ -163,6 +173,9 @@ /* Define to 1 if you have the `sprintf' function. */ #undef HAVE_SPRINTF +/* Define to 1 if you have the `srand' function. */ +#undef HAVE_SRAND + /* Define to 1 if you have the `sscanf' function. */ #undef HAVE_SSCANF @@ -225,6 +238,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H +/* Define to 1 if you have the `time' function. */ +#undef HAVE_TIME + /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H @@ -274,15 +290,9 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME -/* Define to the home page for this package. */ -#undef PACKAGE_URL - /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if the C compiler supports function prototypes. */ -#undef PROTOTYPES - /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS @@ -295,17 +305,17 @@ /* Determine what socket length (socklen_t) data type is */ #undef XML_SOCKLEN_T +/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT32_T + /* Using the Win32 Socket implementation */ #undef _WINSOCKAPI_ -/* Define like PROTOTYPES; this can be used by system headers. */ -#undef __PROTOTYPES - -/* Win32 Std C name mangling work-around */ -#undef snprintf - /* ss_family is not defined here, use __ss_family instead */ #undef ss_family -/* Win32 Std C name mangling work-around */ -#undef vsnprintf +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef uint32_t