variables.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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_FUNC_RESULT:
  41. *
  42. * RVT is part of results returned with func:result. The RVT won't be
  43. * destroyed after exiting a template and will be reset to XSLT_RVT_LOCAL or
  44. * XSLT_RVT_VARIABLE in the template that receives the return value.
  45. */
  46. #define XSLT_RVT_FUNC_RESULT ((void *)2)
  47. /**
  48. * XSLT_RVT_GLOBAL:
  49. *
  50. * RVT is part of a global variable.
  51. */
  52. #define XSLT_RVT_GLOBAL ((void *)3)
  53. /*
  54. * Interfaces for the variable module.
  55. */
  56. XSLTPUBFUN int XSLTCALL
  57. xsltEvalGlobalVariables (xsltTransformContextPtr ctxt);
  58. XSLTPUBFUN int XSLTCALL
  59. xsltEvalUserParams (xsltTransformContextPtr ctxt,
  60. const char **params);
  61. XSLTPUBFUN int XSLTCALL
  62. xsltQuoteUserParams (xsltTransformContextPtr ctxt,
  63. const char **params);
  64. XSLTPUBFUN int XSLTCALL
  65. xsltEvalOneUserParam (xsltTransformContextPtr ctxt,
  66. const xmlChar * name,
  67. const xmlChar * value);
  68. XSLTPUBFUN int XSLTCALL
  69. xsltQuoteOneUserParam (xsltTransformContextPtr ctxt,
  70. const xmlChar * name,
  71. const xmlChar * value);
  72. XSLTPUBFUN void XSLTCALL
  73. xsltParseGlobalVariable (xsltStylesheetPtr style,
  74. xmlNodePtr cur);
  75. XSLTPUBFUN void XSLTCALL
  76. xsltParseGlobalParam (xsltStylesheetPtr style,
  77. xmlNodePtr cur);
  78. XSLTPUBFUN void XSLTCALL
  79. xsltParseStylesheetVariable (xsltTransformContextPtr ctxt,
  80. xmlNodePtr cur);
  81. XSLTPUBFUN void XSLTCALL
  82. xsltParseStylesheetParam (xsltTransformContextPtr ctxt,
  83. xmlNodePtr cur);
  84. XSLTPUBFUN xsltStackElemPtr XSLTCALL
  85. xsltParseStylesheetCallerParam (xsltTransformContextPtr ctxt,
  86. xmlNodePtr cur);
  87. XSLTPUBFUN int XSLTCALL
  88. xsltAddStackElemList (xsltTransformContextPtr ctxt,
  89. xsltStackElemPtr elems);
  90. XSLTPUBFUN void XSLTCALL
  91. xsltFreeGlobalVariables (xsltTransformContextPtr ctxt);
  92. XSLTPUBFUN xmlXPathObjectPtr XSLTCALL
  93. xsltVariableLookup (xsltTransformContextPtr ctxt,
  94. const xmlChar *name,
  95. const xmlChar *ns_uri);
  96. XSLTPUBFUN xmlXPathObjectPtr XSLTCALL
  97. xsltXPathVariableLookup (void *ctxt,
  98. const xmlChar *name,
  99. const xmlChar *ns_uri);
  100. #ifdef __cplusplus
  101. }
  102. #endif
  103. #endif /* __XML_XSLT_VARIABLES_H__ */