Commit a5db68a3 authored by Daniel Veillard's avatar Daniel Veillard
Browse files

- xpath.c xpathInternals.h: applied a large cleaning patch

  from TOM <ptittom@free.fr>, it also add namespace support
  for function and variables registration.
Daniel
parent bd20df79
Sun Oct 29 19:03:11 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* xpath.c xpathInternals.h: applied a large cleaning patch
from TOM <ptittom@free.fr>, it also add namespace support
for function and variables registration.
Sun Oct 29 18:51:46 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* uri.c: Wayne Davison's patch fixing xmlBuildURI()
......
......@@ -38,12 +38,23 @@ extern "C" {
#define CHECK_TYPE(typeval) \
if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \
XP_ERROR(XPATH_INVALID_TYPE) \
XP_ERROR(XPATH_INVALID_TYPE)
#define CHECK_ARITY(x) \
if (nargs != (x)) { \
XP_ERROR(XPATH_INVALID_ARITY); \
} \
if (nargs != (x)) \
XP_ERROR(XPATH_INVALID_ARITY);
#define CAST_TO_STRING \
if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING)) \
xmlXPathStringFunction(ctxt, 1);
#define CAST_TO_NUMBER \
if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER)) \
xmlXPathNumberFunction(ctxt, 1);
#define CAST_TO_BOOLEAN \
if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN)) \
xmlXPathBooleanFunction(ctxt, 1);
void xmlXPatherror (xmlXPathParserContextPtr ctxt,
const char *file,
......@@ -60,14 +71,28 @@ void xmlXPathDebugDumpObject (FILE *output,
int xmlXPathRegisterFunc (xmlXPathContextPtr ctxt,
const xmlChar *name,
xmlXPathFunction f);
int xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt,
const xmlChar *name,
const xmlChar *ns_uri,
xmlXPathFunction f);
int xmlXPathRegisterVariable (xmlXPathContextPtr ctxt,
const xmlChar *name,
xmlXPathObjectPtr value);
int xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt,
const xmlChar *name,
const xmlChar *ns_uri,
xmlXPathObjectPtr value);
xmlXPathFunction xmlXPathFunctionLookup (xmlXPathContextPtr ctxt,
const xmlChar *name);
xmlXPathFunction xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt,
const xmlChar *name,
const xmlChar *ns_uri);
void xmlXPathRegisteredFuncsCleanup(xmlXPathContextPtr ctxt);
xmlXPathObjectPtr xmlXPathVariableLookup (xmlXPathContextPtr ctxt,
const xmlChar *name);
xmlXPathObjectPtr xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt,
const xmlChar *name,
const xmlChar *ns_uri);
void xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt);
/**
......
This diff is collapsed.
......@@ -38,12 +38,23 @@ extern "C" {
#define CHECK_TYPE(typeval) \
if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \
XP_ERROR(XPATH_INVALID_TYPE) \
XP_ERROR(XPATH_INVALID_TYPE)
#define CHECK_ARITY(x) \
if (nargs != (x)) { \
XP_ERROR(XPATH_INVALID_ARITY); \
} \
if (nargs != (x)) \
XP_ERROR(XPATH_INVALID_ARITY);
#define CAST_TO_STRING \
if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING)) \
xmlXPathStringFunction(ctxt, 1);
#define CAST_TO_NUMBER \
if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER)) \
xmlXPathNumberFunction(ctxt, 1);
#define CAST_TO_BOOLEAN \
if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN)) \
xmlXPathBooleanFunction(ctxt, 1);
void xmlXPatherror (xmlXPathParserContextPtr ctxt,
const char *file,
......@@ -60,14 +71,28 @@ void xmlXPathDebugDumpObject (FILE *output,
int xmlXPathRegisterFunc (xmlXPathContextPtr ctxt,
const xmlChar *name,
xmlXPathFunction f);
int xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt,
const xmlChar *name,
const xmlChar *ns_uri,
xmlXPathFunction f);
int xmlXPathRegisterVariable (xmlXPathContextPtr ctxt,
const xmlChar *name,
xmlXPathObjectPtr value);
int xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt,
const xmlChar *name,
const xmlChar *ns_uri,
xmlXPathObjectPtr value);
xmlXPathFunction xmlXPathFunctionLookup (xmlXPathContextPtr ctxt,
const xmlChar *name);
xmlXPathFunction xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt,
const xmlChar *name,
const xmlChar *ns_uri);
void xmlXPathRegisteredFuncsCleanup(xmlXPathContextPtr ctxt);
xmlXPathObjectPtr xmlXPathVariableLookup (xmlXPathContextPtr ctxt,
const xmlChar *name);
xmlXPathObjectPtr xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt,
const xmlChar *name,
const xmlChar *ns_uri);
void xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt);
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment