mirror of
https://gitlab.gnome.org/GNOME/libxslt
synced 2025-08-07 10:42:55 +03:00
Big space and tabs cleanup
Remove spaces followed by tabs, and space and tabs at the end of lines
This commit is contained in:
@@ -99,7 +99,7 @@ typedef struct _exsltDateValDuration exsltDateValDuration;
|
||||
typedef exsltDateValDuration *exsltDateValDurationPtr;
|
||||
struct _exsltDateValDuration {
|
||||
long mon; /* mon stores years also */
|
||||
long day;
|
||||
long day;
|
||||
double sec; /* sec stores min and hour also */
|
||||
};
|
||||
|
||||
@@ -119,7 +119,7 @@ struct _exsltDateVal {
|
||||
* *
|
||||
****************************************************************/
|
||||
|
||||
#if defined(HAVE_TIME_H) \
|
||||
#if defined(HAVE_TIME_H) \
|
||||
&& (defined(HAVE_LOCALTIME) || defined(HAVE_LOCALTIME_R)) \
|
||||
&& (defined(HAVE_GMTIME) || defined(HAVE_GMTIME_R)) \
|
||||
&& defined(HAVE_TIME)
|
||||
@@ -797,19 +797,19 @@ exsltDateCurrent (void)
|
||||
gmTm.tm_sec;
|
||||
|
||||
if (localTm.tm_year < gmTm.tm_year) {
|
||||
ret->value.date.tzo = -((SECS_PER_DAY - local_s) + gm_s)/60;
|
||||
ret->value.date.tzo = -((SECS_PER_DAY - local_s) + gm_s)/60;
|
||||
} else if (localTm.tm_year > gmTm.tm_year) {
|
||||
ret->value.date.tzo = ((SECS_PER_DAY - gm_s) + local_s)/60;
|
||||
ret->value.date.tzo = ((SECS_PER_DAY - gm_s) + local_s)/60;
|
||||
} else if (localTm.tm_mon < gmTm.tm_mon) {
|
||||
ret->value.date.tzo = -((SECS_PER_DAY - local_s) + gm_s)/60;
|
||||
ret->value.date.tzo = -((SECS_PER_DAY - local_s) + gm_s)/60;
|
||||
} else if (localTm.tm_mon > gmTm.tm_mon) {
|
||||
ret->value.date.tzo = ((SECS_PER_DAY - gm_s) + local_s)/60;
|
||||
ret->value.date.tzo = ((SECS_PER_DAY - gm_s) + local_s)/60;
|
||||
} else if (localTm.tm_mday < gmTm.tm_mday) {
|
||||
ret->value.date.tzo = -((SECS_PER_DAY - local_s) + gm_s)/60;
|
||||
ret->value.date.tzo = -((SECS_PER_DAY - local_s) + gm_s)/60;
|
||||
} else if (localTm.tm_mday > gmTm.tm_mday) {
|
||||
ret->value.date.tzo = ((SECS_PER_DAY - gm_s) + local_s)/60;
|
||||
ret->value.date.tzo = ((SECS_PER_DAY - gm_s) + local_s)/60;
|
||||
} else {
|
||||
ret->value.date.tzo = (local_s - gm_s)/60;
|
||||
ret->value.date.tzo = (local_s - gm_s)/60;
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -2835,7 +2835,7 @@ exsltDateSumFunction (xmlXPathParserContextPtr ctxt, int nargs)
|
||||
}
|
||||
|
||||
for (i = 0; i < ns->nodeNr; i++) {
|
||||
int result;
|
||||
int result;
|
||||
tmp = xmlXPathCastNodeToString (ns->nodeTab[i]);
|
||||
if (tmp == NULL) {
|
||||
xmlXPathFreeNodeSet (ns);
|
||||
|
@@ -74,7 +74,7 @@ exsltDynEvaluateFunction(xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
ret = xmlXPathEval(str,ctxt->context);
|
||||
if (ret)
|
||||
valuePush(ctxt,ret);
|
||||
else {
|
||||
else {
|
||||
xsltGenericError(xsltGenericErrorContext,
|
||||
"dyn:evaluate() : unable to evaluate expression '%s'\n",str);
|
||||
valuePush(ctxt,xmlXPathNewNodeSet(NULL));
|
||||
|
@@ -106,16 +106,16 @@ exsltFuncRegisterImportFunc (exsltFuncFunctionData *data,
|
||||
return;
|
||||
|
||||
if (ch->ctxt == NULL || ch->hash == NULL)
|
||||
return;
|
||||
return;
|
||||
|
||||
/* Check if already present */
|
||||
func = (exsltFuncFunctionData*)xmlHashLookup2(ch->hash, URI, name);
|
||||
if (func == NULL) { /* Not yet present - copy it in */
|
||||
func = exsltFuncNewFunctionData();
|
||||
func = exsltFuncNewFunctionData();
|
||||
memcpy(func, data, sizeof(exsltFuncFunctionData));
|
||||
if (xmlHashAddEntry2(ch->hash, URI, name, func) < 0) {
|
||||
xsltGenericError(xsltGenericErrorContext,
|
||||
"Failed to register function {%s}%s\n",
|
||||
"Failed to register function {%s}%s\n",
|
||||
URI, name);
|
||||
} else { /* Do the registration */
|
||||
xsltGenericDebug(xsltGenericDebugContext,
|
||||
|
@@ -106,7 +106,7 @@ exsltStrTokenizeFunction(xmlXPathParserContextPtr ctxt, int nargs)
|
||||
}
|
||||
}
|
||||
if (token != cur) {
|
||||
node = xmlNewDocRawNode(container, NULL,
|
||||
node = xmlNewDocRawNode(container, NULL,
|
||||
(const xmlChar *) "token", token);
|
||||
xmlAddChild((xmlNodePtr) container, node);
|
||||
xmlXPathNodeSetAddUnique(ret->nodesetval, node);
|
||||
|
@@ -147,7 +147,7 @@ static xsltAttrVTPtr
|
||||
xsltSetAttrVTsegment(xsltAttrVTPtr avt, void *val) {
|
||||
if (avt->nb_seg >= avt->max_seg) {
|
||||
avt = (xsltAttrVTPtr) xmlRealloc(avt, sizeof(xsltAttrVT) +
|
||||
avt->max_seg * sizeof(void *));
|
||||
avt->max_seg * sizeof(void *));
|
||||
if (avt == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -36,9 +36,9 @@
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Hooks for the document loader *
|
||||
* *
|
||||
* *
|
||||
* Hooks for the document loader *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
|
@@ -24,22 +24,22 @@ XSLTPUBFUN xsltDocumentPtr XSLTCALL
|
||||
xsltNewDocument (xsltTransformContextPtr ctxt,
|
||||
xmlDocPtr doc);
|
||||
XSLTPUBFUN xsltDocumentPtr XSLTCALL
|
||||
xsltLoadDocument (xsltTransformContextPtr ctxt,
|
||||
xsltLoadDocument (xsltTransformContextPtr ctxt,
|
||||
const xmlChar *URI);
|
||||
XSLTPUBFUN xsltDocumentPtr XSLTCALL
|
||||
xsltFindDocument (xsltTransformContextPtr ctxt,
|
||||
xsltFindDocument (xsltTransformContextPtr ctxt,
|
||||
xmlDocPtr doc);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFreeDocuments (xsltTransformContextPtr ctxt);
|
||||
xsltFreeDocuments (xsltTransformContextPtr ctxt);
|
||||
|
||||
XSLTPUBFUN xsltDocumentPtr XSLTCALL
|
||||
xsltLoadStyleDocument (xsltStylesheetPtr style,
|
||||
xsltLoadStyleDocument (xsltStylesheetPtr style,
|
||||
const xmlChar *URI);
|
||||
XSLTPUBFUN xsltDocumentPtr XSLTCALL
|
||||
xsltNewStyleDocument (xsltStylesheetPtr style,
|
||||
xsltNewStyleDocument (xsltStylesheetPtr style,
|
||||
xmlDocPtr doc);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFreeStyleDocuments (xsltStylesheetPtr style);
|
||||
xsltFreeStyleDocuments (xsltStylesheetPtr style);
|
||||
|
||||
/*
|
||||
* Hooks for document loading
|
||||
|
@@ -44,9 +44,9 @@
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Private Types and Globals *
|
||||
* *
|
||||
* *
|
||||
* Private Types and Globals *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
typedef struct _xsltExtDef xsltExtDef;
|
||||
@@ -89,9 +89,9 @@ static xmlHashTablePtr xsltModuleHash = NULL;
|
||||
static xmlMutexPtr xsltExtMutex = NULL;
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Type functions *
|
||||
* *
|
||||
* *
|
||||
* Type functions *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -463,9 +463,9 @@ xsltExtModuleRegisterDynamic(const xmlChar * URI ATTRIBUTE_UNUSED)
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* The stylesheet extension prefixes handling *
|
||||
* *
|
||||
* *
|
||||
* The stylesheet extension prefixes handling *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
|
||||
@@ -567,9 +567,9 @@ xsltRegisterExtPrefix(xsltStylesheetPtr style,
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* The extensions modules interfaces *
|
||||
* *
|
||||
* *
|
||||
* The extensions modules interfaces *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -1950,15 +1950,15 @@ xsltGetExtInfo(xsltStylesheetPtr style, const xmlChar * URI)
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Test module http://xmlsoft.org/XSLT/ *
|
||||
* *
|
||||
* *
|
||||
* Test module http://xmlsoft.org/XSLT/ *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Test of the extension module API *
|
||||
* *
|
||||
* *
|
||||
* Test of the extension module API *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
static xmlChar *testData = NULL;
|
||||
|
@@ -40,9 +40,9 @@
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Handling of XSLT debugging *
|
||||
* *
|
||||
* *
|
||||
* Handling of XSLT debugging *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -112,9 +112,9 @@ xsltDebug(xsltTransformContextPtr ctxt, xmlNodePtr node ATTRIBUTE_UNUSED,
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Classic extensions as described by M. Kay *
|
||||
* *
|
||||
* *
|
||||
* Classic extensions as described by M. Kay *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
|
@@ -967,9 +967,9 @@ xsltCurrentFunction(xmlXPathParserContextPtr ctxt, int nargs){
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Registration of XSLT and libxslt functions *
|
||||
* *
|
||||
* *
|
||||
* Registration of XSLT and libxslt functions *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
|
@@ -38,9 +38,9 @@ xsltInitDocKeyTable(xsltTransformContextPtr ctxt, const xmlChar *name,
|
||||
const xmlChar *nameURI);
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Type functions *
|
||||
* *
|
||||
* *
|
||||
* Type functions *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -183,9 +183,9 @@ xsltFreeKeyTableList(xsltKeyTablePtr keyt) {
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* The interpreter for the precompiled patterns *
|
||||
* *
|
||||
* *
|
||||
* The interpreter for the precompiled patterns *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
|
||||
|
@@ -759,7 +759,7 @@ xsltCopyNamespaceList(xsltTransformContextPtr ctxt, xmlNodePtr node,
|
||||
if (node != NULL) {
|
||||
if ((node->ns != NULL) &&
|
||||
(xmlStrEqual(node->ns->prefix, cur->prefix)) &&
|
||||
(xmlStrEqual(node->ns->href, cur->href))) {
|
||||
(xmlStrEqual(node->ns->href, cur->href))) {
|
||||
cur = cur->next;
|
||||
continue;
|
||||
}
|
||||
|
@@ -337,7 +337,7 @@ xsltNumberFormatTokenize(const xmlChar *format,
|
||||
* There is always such a token in the list, even if NULL
|
||||
*/
|
||||
while (! (IS_LETTER(val=xmlStringCurrentChar(NULL, format+ix, &len)) ||
|
||||
IS_DIGIT(val)) ) {
|
||||
IS_DIGIT(val)) ) {
|
||||
if (format[ix] == 0) /* if end of format string */
|
||||
break; /* while */
|
||||
ix += len;
|
||||
@@ -1157,7 +1157,7 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
|
||||
/* First do the -ve prefix */
|
||||
nprefix = the_format;
|
||||
nprefix_length = xsltFormatNumberPreSuffix(self,
|
||||
&the_format, &format_info);
|
||||
&the_format, &format_info);
|
||||
if (nprefix_length<0) {
|
||||
found_error = 1;
|
||||
goto OUTPUT_NUMBER;
|
||||
@@ -1209,12 +1209,12 @@ xsltFormatNumberConversion(xsltDecimalFormatPtr self,
|
||||
* if -ve prefix/suffix == +ve ones, discard & use default
|
||||
*/
|
||||
if ((nprefix_length != prefix_length) ||
|
||||
(nsuffix_length != suffix_length) ||
|
||||
(nsuffix_length != suffix_length) ||
|
||||
((nprefix_length > 0) &&
|
||||
(xmlStrncmp(nprefix, prefix, prefix_length) !=0 )) ||
|
||||
((nsuffix_length > 0) &&
|
||||
(xmlStrncmp(nsuffix, suffix, suffix_length) !=0 ))) {
|
||||
prefix = nprefix;
|
||||
prefix = nprefix;
|
||||
prefix_length = nprefix_length;
|
||||
suffix = nsuffix;
|
||||
suffix_length = nsuffix_length;
|
||||
@@ -1292,13 +1292,13 @@ OUTPUT_NUMBER:
|
||||
if (format_info.frac_digits + format_info.frac_hash == 0) {
|
||||
if (format_info.add_decimal)
|
||||
xmlBufferAdd(buffer, self->decimalPoint,
|
||||
xsltUTF8Size(self->decimalPoint));
|
||||
xsltUTF8Size(self->decimalPoint));
|
||||
}
|
||||
else {
|
||||
number -= floor(number);
|
||||
if ((number != 0) || (format_info.frac_digits != 0)) {
|
||||
xmlBufferAdd(buffer, self->decimalPoint,
|
||||
xsltUTF8Size(self->decimalPoint));
|
||||
xsltUTF8Size(self->decimalPoint));
|
||||
number = floor(scale * number + 0.5);
|
||||
for (j = format_info.frac_hash; j > 0; j--) {
|
||||
if (fmod(number, 10.0) >= 1.0)
|
||||
|
@@ -128,9 +128,9 @@ struct _xsltParserContext {
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Type functions *
|
||||
* *
|
||||
* *
|
||||
* Type functions *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -474,9 +474,9 @@ xsltReverseCompMatch(xsltParserContextPtr ctxt, xsltCompMatchPtr comp) {
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* The interpreter for the precompiled patterns *
|
||||
* *
|
||||
* *
|
||||
* The interpreter for the precompiled patterns *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
static int
|
||||
@@ -872,7 +872,7 @@ restart:
|
||||
xmlFree(states.states);
|
||||
}
|
||||
return(xsltTestCompMatchDirect(ctxt, comp, node,
|
||||
comp->nsList, comp->nsNr));
|
||||
comp->nsList, comp->nsNr));
|
||||
}
|
||||
|
||||
doc = node->doc;
|
||||
@@ -1235,17 +1235,17 @@ xsltTestCompMatchList(xsltTransformContextPtr ctxt, xmlNodePtr node,
|
||||
#define NXT(val) ctxt->cur[(val)]
|
||||
#define CUR_PTR ctxt->cur
|
||||
|
||||
#define SKIP_BLANKS \
|
||||
#define SKIP_BLANKS \
|
||||
while (IS_BLANK_CH(CUR)) NEXT
|
||||
|
||||
#define CURRENT (*ctxt->cur)
|
||||
#define NEXT ((*ctxt->cur) ? ctxt->cur++: ctxt->cur)
|
||||
|
||||
|
||||
#define PUSH(op, val, val2, novar) \
|
||||
#define PUSH(op, val, val2, novar) \
|
||||
if (xsltCompMatchAdd(ctxt, ctxt->comp, (op), (val), (val2), (novar))) goto error;
|
||||
|
||||
#define SWAP() \
|
||||
#define SWAP() \
|
||||
xsltSwapTopCompMatch(ctxt->comp);
|
||||
|
||||
#define XSLT_ERROR(X) \
|
||||
@@ -2087,7 +2087,7 @@ xsltAddTemplate(xsltStylesheetPtr style, xsltTemplatePtr cur,
|
||||
pat = xsltCompilePatternInternal(cur->match, style->doc, cur->elem,
|
||||
style, NULL, 1);
|
||||
if (pat == NULL)
|
||||
return(-1);
|
||||
return(-1);
|
||||
while (pat) {
|
||||
next = pat->next;
|
||||
pat->next = NULL;
|
||||
|
@@ -597,11 +597,11 @@ xsltAttrTemplateProcess(xsltTransformContextPtr ctxt, xmlNodePtr target,
|
||||
} else {
|
||||
if (attr->ns) {
|
||||
xsltTransformError(ctxt, NULL, attr->parent,
|
||||
"Internal error: Failed to create attribute '{%s}%s'.\n",
|
||||
"Internal error: Failed to create attribute '{%s}%s'.\n",
|
||||
attr->ns->href, attr->name);
|
||||
} else {
|
||||
xsltTransformError(ctxt, NULL, attr->parent,
|
||||
"Internal error: Failed to create attribute '%s'.\n",
|
||||
"Internal error: Failed to create attribute '%s'.\n",
|
||||
attr->name);
|
||||
}
|
||||
}
|
||||
|
@@ -1633,7 +1633,7 @@ xsltEvalUserParams(xsltTransformContextPtr ctxt, const char **params) {
|
||||
while (params[indx] != NULL) {
|
||||
name = (const xmlChar *) params[indx++];
|
||||
value = (const xmlChar *) params[indx++];
|
||||
if (xsltEvalOneUserParam(ctxt, name, value) != 0)
|
||||
if (xsltEvalOneUserParam(ctxt, name, value) != 0)
|
||||
return(-1);
|
||||
}
|
||||
return 0;
|
||||
@@ -1663,7 +1663,7 @@ xsltQuoteUserParams(xsltTransformContextPtr ctxt, const char **params) {
|
||||
while (params[indx] != NULL) {
|
||||
name = (const xmlChar *) params[indx++];
|
||||
value = (const xmlChar *) params[indx++];
|
||||
if (xsltQuoteOneUserParam(ctxt, name, value) != 0)
|
||||
if (xsltQuoteOneUserParam(ctxt, name, value) != 0)
|
||||
return(-1);
|
||||
}
|
||||
return 0;
|
||||
@@ -1689,7 +1689,7 @@ xsltQuoteUserParams(xsltTransformContextPtr ctxt, const char **params) {
|
||||
|
||||
int
|
||||
xsltEvalOneUserParam(xsltTransformContextPtr ctxt,
|
||||
const xmlChar * name,
|
||||
const xmlChar * name,
|
||||
const xmlChar * value) {
|
||||
return xsltProcessUserParamInternal(ctxt, name, value,
|
||||
1 /* xpath eval ? */);
|
||||
|
@@ -44,37 +44,37 @@ XSLTPUBFUN int XSLTCALL
|
||||
xsltEvalUserParams (xsltTransformContextPtr ctxt,
|
||||
const char **params);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltQuoteUserParams (xsltTransformContextPtr ctxt,
|
||||
xsltQuoteUserParams (xsltTransformContextPtr ctxt,
|
||||
const char **params);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltEvalOneUserParam (xsltTransformContextPtr ctxt,
|
||||
const xmlChar * name,
|
||||
const xmlChar * name,
|
||||
const xmlChar * value);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltQuoteOneUserParam (xsltTransformContextPtr ctxt,
|
||||
const xmlChar * name,
|
||||
xsltQuoteOneUserParam (xsltTransformContextPtr ctxt,
|
||||
const xmlChar * name,
|
||||
const xmlChar * value);
|
||||
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltParseGlobalVariable (xsltStylesheetPtr style,
|
||||
xsltParseGlobalVariable (xsltStylesheetPtr style,
|
||||
xmlNodePtr cur);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltParseGlobalParam (xsltStylesheetPtr style,
|
||||
xsltParseGlobalParam (xsltStylesheetPtr style,
|
||||
xmlNodePtr cur);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltParseStylesheetVariable (xsltTransformContextPtr ctxt,
|
||||
xsltParseStylesheetVariable (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltParseStylesheetParam (xsltTransformContextPtr ctxt,
|
||||
xsltParseStylesheetParam (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
XSLTPUBFUN xsltStackElemPtr XSLTCALL
|
||||
xsltParseStylesheetCallerParam (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltAddStackElemList (xsltTransformContextPtr ctxt,
|
||||
xsltAddStackElemList (xsltTransformContextPtr ctxt,
|
||||
xsltStackElemPtr elems);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltFreeGlobalVariables (xsltTransformContextPtr ctxt);
|
||||
xsltFreeGlobalVariables (xsltTransformContextPtr ctxt);
|
||||
XSLTPUBFUN xmlXPathObjectPtr XSLTCALL
|
||||
xsltVariableLookup (xsltTransformContextPtr ctxt,
|
||||
const xmlChar *name,
|
||||
|
@@ -479,7 +479,7 @@ struct _xsltElemPreComp {
|
||||
xsltElemPreCompPtr next; /* next item in the global chained
|
||||
list hold by xsltStylesheet. */
|
||||
xsltStyleType type; /* type of the element */
|
||||
xsltTransformFunction func; /* handling function */
|
||||
xsltTransformFunction func; /* handling function */
|
||||
xmlNodePtr inst; /* the node in the stylesheet's tree
|
||||
corresponding to this item */
|
||||
|
||||
|
@@ -103,26 +103,26 @@ xsltNewLocale(const xmlChar *languageTag) {
|
||||
/* Convert something like "pt-br" to "pt_BR.utf8" */
|
||||
|
||||
if (languageTag == NULL)
|
||||
return(NULL);
|
||||
return(NULL);
|
||||
|
||||
for (i=0; i<XSLTMAX_ISO639LANGLEN && ISALPHA(*p); ++i)
|
||||
*q++ = TOLOWER(*p++);
|
||||
|
||||
if (i == 0)
|
||||
return(NULL);
|
||||
return(NULL);
|
||||
|
||||
llen = i;
|
||||
|
||||
if (*p) {
|
||||
if (*p++ != '-')
|
||||
return(NULL);
|
||||
if (*p++ != '-')
|
||||
return(NULL);
|
||||
*q++ = '_';
|
||||
|
||||
for (i=0; i<XSLTMAX_ISO3166CNTRYLEN && ISALPHA(*p); ++i)
|
||||
*q++ = TOUPPER(*p++);
|
||||
|
||||
if (i == 0 || *p)
|
||||
return(NULL);
|
||||
if (i == 0 || *p)
|
||||
return(NULL);
|
||||
|
||||
memcpy(q, ".utf8", 6);
|
||||
locale = newlocale(LC_COLLATE_MASK, localeName, NULL);
|
||||
|
@@ -54,9 +54,9 @@
|
||||
#endif /* WIN32 */
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Convenience function *
|
||||
* *
|
||||
* *
|
||||
* Convenience function *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -422,9 +422,9 @@ xsltPointerListClear(xsltPointerListPtr list)
|
||||
#endif /* XSLT_REFACTORED */
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Handling of XSLT stylesheets messages *
|
||||
* *
|
||||
* *
|
||||
* Handling of XSLT stylesheets messages *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -477,9 +477,9 @@ xsltMessage(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst) {
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Handling of out of context errors *
|
||||
* *
|
||||
* *
|
||||
* Handling of out of context errors *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
#define XSLT_GET_VAR_STR(msg, str) { \
|
||||
@@ -489,14 +489,14 @@ xsltMessage(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst) {
|
||||
va_list ap; \
|
||||
\
|
||||
str = (char *) xmlMalloc(150); \
|
||||
if (str == NULL) \
|
||||
if (str == NULL) \
|
||||
return; \
|
||||
\
|
||||
size = 150; \
|
||||
\
|
||||
while (size < 64000) { \
|
||||
va_start(ap, msg); \
|
||||
chars = vsnprintf(str, size, msg, ap); \
|
||||
chars = vsnprintf(str, size, msg, ap); \
|
||||
va_end(ap); \
|
||||
if ((chars > -1) && (chars < size)) \
|
||||
break; \
|
||||
@@ -731,9 +731,9 @@ xsltTransformError(xsltTransformContextPtr ctxt,
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* QNames *
|
||||
* *
|
||||
* *
|
||||
* QNames *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -917,9 +917,9 @@ xsltGetQNameURI2(xsltStylesheetPtr style, xmlNodePtr node,
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Sorting *
|
||||
* *
|
||||
* *
|
||||
* Sorting *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -1254,7 +1254,7 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
|
||||
accordance with XSLT spec */
|
||||
if (xmlXPathIsNaN(res[j]->floatval)) {
|
||||
if (xmlXPathIsNaN(res[j +
|
||||
incr]->floatval))
|
||||
incr]->floatval))
|
||||
tst = 0;
|
||||
else
|
||||
tst = -1;
|
||||
@@ -1397,9 +1397,9 @@ xsltSetCtxtSortFunc(xsltTransformContextPtr ctxt, xsltSortFunc handler) {
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Parsing options *
|
||||
* *
|
||||
* *
|
||||
* Parsing options *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -1431,9 +1431,9 @@ xsltSetCtxtParseOptions(xsltTransformContextPtr ctxt, int options)
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Output *
|
||||
* *
|
||||
* *
|
||||
* Output *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -1793,9 +1793,9 @@ xsltSaveResultToString(xmlChar **doc_txt_ptr, int * doc_txt_len,
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Generating profiling informations *
|
||||
* *
|
||||
* *
|
||||
* Generating profiling informations *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
static long calibration = -1;
|
||||
@@ -2152,9 +2152,9 @@ xsltSaveProfiling(xsltTransformContextPtr ctxt, FILE *output) {
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Fetching profiling informations *
|
||||
* *
|
||||
* *
|
||||
* Fetching profiling informations *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -2267,9 +2267,9 @@ xsltGetProfileInformation(xsltTransformContextPtr ctxt)
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Hooks for libxml2 XPath *
|
||||
* *
|
||||
* *
|
||||
* Hooks for libxml2 XPath *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
@@ -2354,9 +2354,9 @@ xsltXPathCompile(xsltStylesheetPtr style, const xmlChar *str) {
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Hooks for the debugger *
|
||||
* *
|
||||
* *
|
||||
* Hooks for the debugger *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/*
|
||||
|
@@ -31,7 +31,7 @@ extern "C" {
|
||||
*
|
||||
* Macro to flag unimplemented blocks.
|
||||
*/
|
||||
#define XSLT_TODO \
|
||||
#define XSLT_TODO \
|
||||
xsltGenericError(xsltGenericErrorContext, \
|
||||
"Unimplemented block at %s:%d\n", \
|
||||
__FILE__, __LINE__);
|
||||
@@ -41,7 +41,7 @@ extern "C" {
|
||||
*
|
||||
* Macro to flag that a problem was detected internally.
|
||||
*/
|
||||
#define XSLT_STRANGE \
|
||||
#define XSLT_STRANGE \
|
||||
xsltGenericError(xsltGenericErrorContext, \
|
||||
"Internal error at %s:%d\n", \
|
||||
__FILE__, __LINE__);
|
||||
@@ -100,24 +100,24 @@ XSLTPUBFUN int XSLTCALL
|
||||
*/
|
||||
typedef enum {
|
||||
XSLT_TRACE_ALL = -1,
|
||||
XSLT_TRACE_NONE = 0,
|
||||
XSLT_TRACE_COPY_TEXT = 1<<0,
|
||||
XSLT_TRACE_PROCESS_NODE = 1<<1,
|
||||
XSLT_TRACE_APPLY_TEMPLATE = 1<<2,
|
||||
XSLT_TRACE_COPY = 1<<3,
|
||||
XSLT_TRACE_COMMENT = 1<<4,
|
||||
XSLT_TRACE_PI = 1<<5,
|
||||
XSLT_TRACE_COPY_OF = 1<<6,
|
||||
XSLT_TRACE_VALUE_OF = 1<<7,
|
||||
XSLT_TRACE_CALL_TEMPLATE = 1<<8,
|
||||
XSLT_TRACE_APPLY_TEMPLATES = 1<<9,
|
||||
XSLT_TRACE_CHOOSE = 1<<10,
|
||||
XSLT_TRACE_IF = 1<<11,
|
||||
XSLT_TRACE_FOR_EACH = 1<<12,
|
||||
XSLT_TRACE_STRIP_SPACES = 1<<13,
|
||||
XSLT_TRACE_TEMPLATES = 1<<14,
|
||||
XSLT_TRACE_KEYS = 1<<15,
|
||||
XSLT_TRACE_VARIABLES = 1<<16
|
||||
XSLT_TRACE_NONE = 0,
|
||||
XSLT_TRACE_COPY_TEXT = 1<<0,
|
||||
XSLT_TRACE_PROCESS_NODE = 1<<1,
|
||||
XSLT_TRACE_APPLY_TEMPLATE = 1<<2,
|
||||
XSLT_TRACE_COPY = 1<<3,
|
||||
XSLT_TRACE_COMMENT = 1<<4,
|
||||
XSLT_TRACE_PI = 1<<5,
|
||||
XSLT_TRACE_COPY_OF = 1<<6,
|
||||
XSLT_TRACE_VALUE_OF = 1<<7,
|
||||
XSLT_TRACE_CALL_TEMPLATE = 1<<8,
|
||||
XSLT_TRACE_APPLY_TEMPLATES = 1<<9,
|
||||
XSLT_TRACE_CHOOSE = 1<<10,
|
||||
XSLT_TRACE_IF = 1<<11,
|
||||
XSLT_TRACE_FOR_EACH = 1<<12,
|
||||
XSLT_TRACE_STRIP_SPACES = 1<<13,
|
||||
XSLT_TRACE_TEMPLATES = 1<<14,
|
||||
XSLT_TRACE_KEYS = 1<<15,
|
||||
XSLT_TRACE_VARIABLES = 1<<16
|
||||
} xsltDebugTraceCodes;
|
||||
|
||||
/**
|
||||
@@ -147,21 +147,21 @@ XSLTPUBFUN void XSLTCALL
|
||||
xsltStylesheetPtr style,
|
||||
xmlNodePtr node);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltMessage (xsltTransformContextPtr ctxt,
|
||||
xsltMessage (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr node,
|
||||
xmlNodePtr inst);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSetGenericErrorFunc (void *ctx,
|
||||
xsltSetGenericErrorFunc (void *ctx,
|
||||
xmlGenericErrorFunc handler);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSetGenericDebugFunc (void *ctx,
|
||||
xsltSetGenericDebugFunc (void *ctx,
|
||||
xmlGenericErrorFunc handler);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSetTransformErrorFunc (xsltTransformContextPtr ctxt,
|
||||
xsltSetTransformErrorFunc (xsltTransformContextPtr ctxt,
|
||||
void *ctx,
|
||||
xmlGenericErrorFunc handler);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltTransformError (xsltTransformContextPtr ctxt,
|
||||
xsltTransformError (xsltTransformContextPtr ctxt,
|
||||
xsltStylesheetPtr style,
|
||||
xmlNodePtr node,
|
||||
const char *msg,
|
||||
@@ -175,22 +175,22 @@ XSLTPUBFUN int XSLTCALL
|
||||
*/
|
||||
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltDocumentSortFunction (xmlNodeSetPtr list);
|
||||
xsltDocumentSortFunction (xmlNodeSetPtr list);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSetSortFunc (xsltSortFunc handler);
|
||||
xsltSetSortFunc (xsltSortFunc handler);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSetCtxtSortFunc (xsltTransformContextPtr ctxt,
|
||||
xsltSetCtxtSortFunc (xsltTransformContextPtr ctxt,
|
||||
xsltSortFunc handler);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltDefaultSortFunction (xsltTransformContextPtr ctxt,
|
||||
xsltDefaultSortFunction (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr *sorts,
|
||||
int nbsorts);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltDoSortFunction (xsltTransformContextPtr ctxt,
|
||||
xsltDoSortFunction (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr * sorts,
|
||||
int nbsorts);
|
||||
XSLTPUBFUN xmlXPathObjectPtr * XSLTCALL
|
||||
xsltComputeSortResult (xsltTransformContextPtr ctxt,
|
||||
xsltComputeSortResult (xsltTransformContextPtr ctxt,
|
||||
xmlNodePtr sort);
|
||||
|
||||
/*
|
||||
@@ -202,7 +202,7 @@ XSLTPUBFUN const xmlChar * XSLTCALL
|
||||
const xmlChar *name,
|
||||
const xmlChar **prefix);
|
||||
XSLTPUBFUN const xmlChar * XSLTCALL
|
||||
xsltGetQNameURI (xmlNodePtr node,
|
||||
xsltGetQNameURI (xmlNodePtr node,
|
||||
xmlChar **name);
|
||||
|
||||
XSLTPUBFUN const xmlChar * XSLTCALL
|
||||
@@ -214,24 +214,24 @@ XSLTPUBFUN const xmlChar * XSLTCALL
|
||||
* Output, reuse libxml I/O buffers.
|
||||
*/
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSaveResultTo (xmlOutputBufferPtr buf,
|
||||
xsltSaveResultTo (xmlOutputBufferPtr buf,
|
||||
xmlDocPtr result,
|
||||
xsltStylesheetPtr style);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSaveResultToFilename (const char *URI,
|
||||
xsltSaveResultToFilename (const char *URI,
|
||||
xmlDocPtr result,
|
||||
xsltStylesheetPtr style,
|
||||
int compression);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSaveResultToFile (FILE *file,
|
||||
xsltSaveResultToFile (FILE *file,
|
||||
xmlDocPtr result,
|
||||
xsltStylesheetPtr style);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSaveResultToFd (int fd,
|
||||
xsltSaveResultToFd (int fd,
|
||||
xmlDocPtr result,
|
||||
xsltStylesheetPtr style);
|
||||
XSLTPUBFUN int XSLTCALL
|
||||
xsltSaveResultToString (xmlChar **doc_txt_ptr,
|
||||
xsltSaveResultToString (xmlChar **doc_txt_ptr,
|
||||
int * doc_txt_len,
|
||||
xmlDocPtr result,
|
||||
xsltStylesheetPtr style);
|
||||
@@ -251,15 +251,15 @@ XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL
|
||||
* Profiling.
|
||||
*/
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltSaveProfiling (xsltTransformContextPtr ctxt,
|
||||
xsltSaveProfiling (xsltTransformContextPtr ctxt,
|
||||
FILE *output);
|
||||
XSLTPUBFUN xmlDocPtr XSLTCALL
|
||||
xsltGetProfileInformation (xsltTransformContextPtr ctxt);
|
||||
xsltGetProfileInformation (xsltTransformContextPtr ctxt);
|
||||
|
||||
XSLTPUBFUN long XSLTCALL
|
||||
xsltTimestamp (void);
|
||||
xsltTimestamp (void);
|
||||
XSLTPUBFUN void XSLTCALL
|
||||
xsltCalibrateAdjust (long delta);
|
||||
xsltCalibrateAdjust (long delta);
|
||||
|
||||
/**
|
||||
* XSLT_TIMESTAMP_TICS_PER_SEC:
|
||||
|
@@ -331,10 +331,10 @@ libxslt_xsltElementTransformCallback(xsltTransformContextPtr ctxt,
|
||||
}
|
||||
|
||||
args = Py_BuildValue((char *)"OOOO",
|
||||
libxslt_xsltTransformContextPtrWrap(ctxt),
|
||||
libxml_xmlNodePtrWrap(node),
|
||||
libxml_xmlNodePtrWrap(inst),
|
||||
libxslt_xsltElemPreCompPtrWrap(comp));
|
||||
libxslt_xsltTransformContextPtrWrap(ctxt),
|
||||
libxml_xmlNodePtrWrap(node),
|
||||
libxml_xmlNodePtrWrap(inst),
|
||||
libxslt_xsltElemPreCompPtrWrap(comp));
|
||||
|
||||
Py_INCREF(func); /* Protect refcount against reentrant manipulation of callback hash */
|
||||
result = PyEval_CallObject(func, args);
|
||||
|
Reference in New Issue
Block a user