diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2001-07-03 10:35:50 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2001-07-03 10:35:50 +0000 |
commit | f06307e2c172284bb41376c396f757bdac9bdd19 (patch) | |
tree | 5b1572d809dabc1a3982499141d8ed9ff63585b4 /include | |
parent | 770447311ea514b8d0036cab18ed62be38e5dcea (diff) | |
download | libxml2-f06307e2c172284bb41376c396f757bdac9bdd19.tar.gz |
- xpath.c include/libxml/xpath.h include/libxml/xpathInternals.h:
lot of optimization work, results in significant improvements
when handling really complex XPath queries. Add a small optimizer
for unions, improve [n] and [last()], avoid some costly ops.
Daniel
Diffstat (limited to 'include')
-rw-r--r-- | include/libxml/xpath.h | 1 | ||||
-rw-r--r-- | include/libxml/xpathInternals.h | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/libxml/xpath.h b/include/libxml/xpath.h index a330e385..37556780 100644 --- a/include/libxml/xpath.h +++ b/include/libxml/xpath.h @@ -255,6 +255,7 @@ struct _xmlXPathParserContext { xmlXPathCompExprPtr comp; /* the precompiled expression */ int xptr; /* it this an XPointer expression */ + xmlNodePtr ancestor; /* used for walking preceding axis */ }; /** diff --git a/include/libxml/xpathInternals.h b/include/libxml/xpathInternals.h index 7f3f75e7..40c3bcee 100644 --- a/include/libxml/xpathInternals.h +++ b/include/libxml/xpathInternals.h @@ -75,6 +75,17 @@ extern "C" { XP_ERROR(XPATH_INVALID_TYPE) /** + * CHECK_TYPE0: + * @typeval: the XPath type + * + * Macro to check that the value on top of the XPath stack is of a given + * type. return(0) in case of failure + */ +#define CHECK_TYPE0(typeval) \ + if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \ + XP_ERROR0(XPATH_INVALID_TYPE) + +/** * CHECK_ARITY: * @x: the number of expected args * |