You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

126 lines
3.3 KiB

4 years ago
  1. /*
  2. * Summary: interface for the variable matching and lookup.
  3. * Description: interface for the variable matching and lookup.
  4. *
  5. * Copy: See Copyright for the status of this software.
  6. *
  7. * Author: Daniel Veillard
  8. */
  9. #ifndef __XML_XSLT_VARIABLES_H__
  10. #define __XML_XSLT_VARIABLES_H__
  11. #include <libxml/xpath.h>
  12. #include <libxml/xpathInternals.h>
  13. #include "xsltexports.h"
  14. #include "xsltInternals.h"
  15. #include "functions.h"
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /**
  20. * XSLT_REGISTER_VARIABLE_LOOKUP:
  21. *
  22. * Registering macro, not general purpose at all but used in different modules.
  23. */
  24. #define XSLT_REGISTER_VARIABLE_LOOKUP(ctxt) \
  25. xmlXPathRegisterVariableLookup((ctxt)->xpathCtxt, \
  26. xsltXPathVariableLookup, (void *)(ctxt)); \
  27. xsltRegisterAllFunctions((ctxt)->xpathCtxt); \
  28. xsltRegisterAllElement(ctxt); \
  29. (ctxt)->xpathCtxt->extra = ctxt
  30. /*
  31. * Flags for memory management of RVTs
  32. */
  33. /**
  34. * XSLT_RVT_LOCAL:
  35. *
  36. * RVT is destroyed after the current instructions ends.
  37. */
  38. #define XSLT_RVT_LOCAL ((void *)1)
  39. /**
  40. * XSLT_RVT_VARIABLE:
  41. *
  42. * RVT is part of a local variable and destroyed after the variable goes out
  43. * of scope.
  44. */
  45. #define XSLT_RVT_VARIABLE ((void *)2)
  46. /**
  47. * XSLT_RVT_FUNC_RESULT:
  48. *
  49. * RVT is part of results returned with func:result. The RVT won't be
  50. * destroyed after exiting a template and will be reset to XSLT_RVT_LOCAL or
  51. * XSLT_RVT_VARIABLE in the template that receives the return value.
  52. */
  53. #define XSLT_RVT_FUNC_RESULT ((void *)3)
  54. /**
  55. * XSLT_RVT_GLOBAL:
  56. *
  57. * RVT is part of a global variable.
  58. */
  59. #define XSLT_RVT_GLOBAL ((void *)4)
  60. /*
  61. * Interfaces for the variable module.
  62. */
  63. XSLTPUBFUN int XSLTCALL
  64. xsltEvalGlobalVariables (xsltTransformContextPtr ctxt);
  65. XSLTPUBFUN int XSLTCALL
  66. xsltEvalUserParams (xsltTransformContextPtr ctxt,
  67. const char **params);
  68. XSLTPUBFUN int XSLTCALL
  69. xsltQuoteUserParams (xsltTransformContextPtr ctxt,
  70. const char **params);
  71. XSLTPUBFUN int XSLTCALL
  72. xsltEvalOneUserParam (xsltTransformContextPtr ctxt,
  73. const xmlChar * name,
  74. const xmlChar * value);
  75. XSLTPUBFUN int XSLTCALL
  76. xsltQuoteOneUserParam (xsltTransformContextPtr ctxt,
  77. const xmlChar * name,
  78. const xmlChar * value);
  79. XSLTPUBFUN void XSLTCALL
  80. xsltParseGlobalVariable (xsltStylesheetPtr style,
  81. xmlNodePtr cur);
  82. XSLTPUBFUN void XSLTCALL
  83. xsltParseGlobalParam (xsltStylesheetPtr style,
  84. xmlNodePtr cur);
  85. XSLTPUBFUN void XSLTCALL
  86. xsltParseStylesheetVariable (xsltTransformContextPtr ctxt,
  87. xmlNodePtr cur);
  88. XSLTPUBFUN void XSLTCALL
  89. xsltParseStylesheetParam (xsltTransformContextPtr ctxt,
  90. xmlNodePtr cur);
  91. XSLTPUBFUN xsltStackElemPtr XSLTCALL
  92. xsltParseStylesheetCallerParam (xsltTransformContextPtr ctxt,
  93. xmlNodePtr cur);
  94. XSLTPUBFUN int XSLTCALL
  95. xsltAddStackElemList (xsltTransformContextPtr ctxt,
  96. xsltStackElemPtr elems);
  97. XSLTPUBFUN void XSLTCALL
  98. xsltFreeGlobalVariables (xsltTransformContextPtr ctxt);
  99. XSLTPUBFUN xmlXPathObjectPtr XSLTCALL
  100. xsltVariableLookup (xsltTransformContextPtr ctxt,
  101. const xmlChar *name,
  102. const xmlChar *ns_uri);
  103. XSLTPUBFUN xmlXPathObjectPtr XSLTCALL
  104. xsltXPathVariableLookup (void *ctxt,
  105. const xmlChar *name,
  106. const xmlChar *ns_uri);
  107. #ifdef __cplusplus
  108. }
  109. #endif
  110. #endif /* __XML_XSLT_VARIABLES_H__ */