summaryrefslogtreecommitdiff
path: root/xpointer.c
diff options
context:
space:
mode:
authorMike Hommey <glandium@debian.org>2009-09-10 22:10:39 +0200
committerMike Hommey <glandium@debian.org>2009-09-10 22:10:39 +0200
commitc3e4f3c26035bc93a69e5aa2ad435809e8be8a4e (patch)
treee65557c2e042fe8a77635b0548db10ad97bc1bfe /xpointer.c
parente248b20a3b7df364cc9617b8685b4c190338bcd2 (diff)
downloadlibxml2-c3e4f3c26035bc93a69e5aa2ad435809e8be8a4e.tar.gz
Import upstream version 2.7.4upstream/2.7.4.dfsg
Diffstat (limited to 'xpointer.c')
-rw-r--r--xpointer.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/xpointer.c b/xpointer.c
index 5298fa5..7a42d02 100644
--- a/xpointer.c
+++ b/xpointer.c
@@ -1152,10 +1152,12 @@ xmlXPtrEvalFullXPtr(xmlXPathParserContextPtr ctxt, xmlChar *name) {
if (name == NULL)
XP_ERROR(XPATH_EXPR_ERROR);
while (name != NULL) {
+ ctxt->error = XPATH_EXPRESSION_OK;
xmlXPtrEvalXPtrPart(ctxt, name);
/* in case of syntax error, break here */
- if (ctxt->error != XPATH_EXPRESSION_OK)
+ if ((ctxt->error != XPATH_EXPRESSION_OK) &&
+ (ctxt->error != XML_XPTR_UNKNOWN_SCHEME))
return;
/*
@@ -1299,12 +1301,19 @@ xmlXPtrEvalXPointer(xmlXPathParserContextPtr ctxt) {
* *
************************************************************************/
+static
void xmlXPtrStringRangeFunction(xmlXPathParserContextPtr ctxt, int nargs);
+static
void xmlXPtrStartPointFunction(xmlXPathParserContextPtr ctxt, int nargs);
+static
void xmlXPtrEndPointFunction(xmlXPathParserContextPtr ctxt, int nargs);
+static
void xmlXPtrHereFunction(xmlXPathParserContextPtr ctxt, int nargs);
+static
void xmlXPtrOriginFunction(xmlXPathParserContextPtr ctxt, int nargs);
+static
void xmlXPtrRangeInsideFunction(xmlXPathParserContextPtr ctxt, int nargs);
+static
void xmlXPtrRangeFunction(xmlXPathParserContextPtr ctxt, int nargs);
/**
@@ -1732,7 +1741,7 @@ xmlXPtrNbLocChildren(xmlNodePtr node) {
* Function implementing here() operation
* as described in 5.4.3
*/
-void
+static void
xmlXPtrHereFunction(xmlXPathParserContextPtr ctxt, int nargs) {
CHECK_ARITY(0);
@@ -1750,7 +1759,7 @@ xmlXPtrHereFunction(xmlXPathParserContextPtr ctxt, int nargs) {
* Function implementing origin() operation
* as described in 5.4.3
*/
-void
+static void
xmlXPtrOriginFunction(xmlXPathParserContextPtr ctxt, int nargs) {
CHECK_ARITY(0);
@@ -1783,7 +1792,7 @@ xmlXPtrOriginFunction(xmlXPathParserContextPtr ctxt, int nargs) {
* ----------------
*
*/
-void
+static void
xmlXPtrStartPointFunction(xmlXPathParserContextPtr ctxt, int nargs) {
xmlXPathObjectPtr tmp, obj, point;
xmlLocationSetPtr newset = NULL;
@@ -1877,7 +1886,7 @@ xmlXPtrStartPointFunction(xmlXPathParserContextPtr ctxt, int nargs) {
* syntax error.
* ----------------------------
*/
-void
+static void
xmlXPtrEndPointFunction(xmlXPathParserContextPtr ctxt, int nargs) {
xmlXPathObjectPtr tmp, obj, point;
xmlLocationSetPtr newset = NULL;
@@ -2022,7 +2031,7 @@ xmlXPtrCoveringRange(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr loc) {
* location-set, a range location representing the covering range of
* x is added to the result location-set.
*/
-void
+static void
xmlXPtrRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) {
int i;
xmlXPathObjectPtr set;
@@ -2168,7 +2177,7 @@ xmlXPtrInsideRange(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr loc) {
* location children of x.
*
*/
-void
+static void
xmlXPtrRangeInsideFunction(xmlXPathParserContextPtr ctxt, int nargs) {
int i;
xmlXPathObjectPtr set;
@@ -2622,13 +2631,12 @@ xmlXPtrGetLastChar(xmlNodePtr *node, int *indx) {
if (cur == NULL)
return(-1);
-
+
if ((cur->type == XML_ELEMENT_NODE) ||
(cur->type == XML_DOCUMENT_NODE) ||
(cur->type == XML_HTML_DOCUMENT_NODE)) {
if (pos > 0) {
cur = xmlXPtrGetNthChild(cur, pos);
- pos = 0;
}
}
while (cur != NULL) {
@@ -2757,7 +2765,7 @@ xmlXPtrGetEndPoint(xmlXPathObjectPtr obj, xmlNodePtr *node, int *indx) {
* all be character points.
* ------------------------------
*/
-void
+static void
xmlXPtrStringRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) {
int i, startindex, endindex = 0, fendindex;
xmlNodePtr start, end = 0, fend;