home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / libxslt / extensions.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-07-28  |  6.8 KB  |  257 lines

  1. /*
  2.  * Summary: interface for the extension support
  3.  * Description: This provide the API needed for simple and module
  4.  *              extension support.
  5.  *
  6.  * Copy: See Copyright for the status of this software.
  7.  *
  8.  * Author: Daniel Veillard
  9.  */
  10.  
  11. #ifndef __XML_XSLT_EXTENSION_H__
  12. #define __XML_XSLT_EXTENSION_H__
  13.  
  14. #include <libxml/xpath.h>
  15. #include "xsltexports.h"
  16. #include "xsltInternals.h"
  17.  
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21.  
  22. /**
  23.  * Extension Modules API.
  24.  */
  25.  
  26. /**
  27.  * xsltStyleExtInitFunction:
  28.  * @ctxt:  an XSLT stylesheet
  29.  * @URI:  the namespace URI for the extension
  30.  *
  31.  * A function called at initialization time of an XSLT extension module.
  32.  *
  33.  * Returns a pointer to the module specific data for this transformation.
  34.  */
  35. typedef void * (*xsltStyleExtInitFunction)    (xsltStylesheetPtr style,
  36.                          const xmlChar *URI);
  37.  
  38. /**
  39.  * xsltStyleExtShutdownFunction:
  40.  * @ctxt:  an XSLT stylesheet
  41.  * @URI:  the namespace URI for the extension
  42.  * @data:  the data associated to this module
  43.  *
  44.  * A function called at shutdown time of an XSLT extension module.
  45.  */
  46. typedef void (*xsltStyleExtShutdownFunction)    (xsltStylesheetPtr style,
  47.                          const xmlChar *URI,
  48.                          void *data);
  49.  
  50. /**
  51.  * xsltExtInitFunction:
  52.  * @ctxt:  an XSLT transformation context
  53.  * @URI:  the namespace URI for the extension
  54.  *
  55.  * A function called at initialization time of an XSLT extension module.
  56.  *
  57.  * Returns a pointer to the module specific data for this transformation.
  58.  */
  59. typedef void * (*xsltExtInitFunction)    (xsltTransformContextPtr ctxt,
  60.                      const xmlChar *URI);
  61.  
  62. /**
  63.  * xsltExtShutdownFunction:
  64.  * @ctxt:  an XSLT transformation context
  65.  * @URI:  the namespace URI for the extension
  66.  * @data:  the data associated to this module
  67.  *
  68.  * A function called at shutdown time of an XSLT extension module.
  69.  */
  70. typedef void (*xsltExtShutdownFunction) (xsltTransformContextPtr ctxt,
  71.                      const xmlChar *URI,
  72.                      void *data);
  73.  
  74. XSLTPUBFUN int XSLTCALL
  75.         xsltRegisterExtModule    (const xmlChar *URI,
  76.                      xsltExtInitFunction initFunc,
  77.                      xsltExtShutdownFunction shutdownFunc);
  78. XSLTPUBFUN int XSLTCALL
  79.         xsltRegisterExtModuleFull
  80.                     (const xmlChar * URI,
  81.                      xsltExtInitFunction initFunc,
  82.                      xsltExtShutdownFunction shutdownFunc,
  83.                      xsltStyleExtInitFunction styleInitFunc,
  84.                      xsltStyleExtShutdownFunction styleShutdownFunc);
  85.  
  86. XSLTPUBFUN int XSLTCALL
  87.         xsltUnregisterExtModule    (const xmlChar * URI);
  88.  
  89. XSLTPUBFUN void * XSLTCALL        
  90.         xsltGetExtData        (xsltTransformContextPtr ctxt,
  91.                      const xmlChar *URI);
  92.  
  93. XSLTPUBFUN void * XSLTCALL        
  94.         xsltStyleGetExtData    (xsltStylesheetPtr style,
  95.                      const xmlChar *URI);
  96. #ifdef XSLT_REFACTORED
  97. XSLTPUBFUN void * XSLTCALL
  98.         xsltStyleStylesheetLevelGetExtData(
  99.                      xsltStylesheetPtr style,
  100.                      const xmlChar * URI);
  101. #endif
  102. XSLTPUBFUN void XSLTCALL        
  103.             xsltShutdownCtxtExts    (xsltTransformContextPtr ctxt);
  104.  
  105. XSLTPUBFUN void XSLTCALL        
  106.             xsltShutdownExts    (xsltStylesheetPtr style);
  107.  
  108. XSLTPUBFUN xsltTransformContextPtr XSLTCALL 
  109.             xsltXPathGetTransformContext
  110.                     (xmlXPathParserContextPtr ctxt);
  111.  
  112. /*
  113.  * extension functions
  114. */
  115. XSLTPUBFUN int XSLTCALL    
  116.         xsltRegisterExtModuleFunction    
  117.                     (const xmlChar *name,
  118.                      const xmlChar *URI,
  119.                      xmlXPathFunction function);
  120. XSLTPUBFUN xmlXPathFunction XSLTCALL
  121.     xsltExtFunctionLookup        (xsltTransformContextPtr ctxt,
  122.                      const xmlChar *name,
  123.                      const xmlChar *URI);
  124. XSLTPUBFUN xmlXPathFunction XSLTCALL
  125.     xsltExtModuleFunctionLookup    (const xmlChar *name,
  126.                      const xmlChar *URI);
  127. XSLTPUBFUN int XSLTCALL    
  128.         xsltUnregisterExtModuleFunction    
  129.                     (const xmlChar *name,
  130.                      const xmlChar *URI);
  131.  
  132. /*
  133.  * extension elements
  134.  */
  135. typedef xsltElemPreCompPtr (*xsltPreComputeFunction)
  136.                         (xsltStylesheetPtr style,
  137.                      xmlNodePtr inst,
  138.                      xsltTransformFunction function);
  139.  
  140. XSLTPUBFUN xsltElemPreCompPtr XSLTCALL
  141.         xsltNewElemPreComp    (xsltStylesheetPtr style,
  142.                      xmlNodePtr inst,
  143.                      xsltTransformFunction function);
  144. XSLTPUBFUN void XSLTCALL    
  145.         xsltInitElemPreComp    (xsltElemPreCompPtr comp,
  146.                      xsltStylesheetPtr style,
  147.                      xmlNodePtr inst,
  148.                      xsltTransformFunction function,
  149.                      xsltElemPreCompDeallocator freeFunc);
  150.  
  151. XSLTPUBFUN int XSLTCALL    
  152.         xsltRegisterExtModuleElement    
  153.                     (const xmlChar *name,
  154.                      const xmlChar *URI,
  155.                      xsltPreComputeFunction precomp,
  156.                      xsltTransformFunction transform);
  157. XSLTPUBFUN xsltTransformFunction XSLTCALL 
  158.         xsltExtElementLookup    (xsltTransformContextPtr ctxt,
  159.                      const xmlChar *name,
  160.                      const xmlChar *URI);
  161. XSLTPUBFUN xsltTransformFunction XSLTCALL 
  162.         xsltExtModuleElementLookup
  163.                     (const xmlChar *name,
  164.                      const xmlChar *URI);
  165. XSLTPUBFUN xsltPreComputeFunction XSLTCALL 
  166.         xsltExtModuleElementPreComputeLookup 
  167.                     (const xmlChar *name,
  168.                      const xmlChar *URI);
  169. XSLTPUBFUN int XSLTCALL    
  170.         xsltUnregisterExtModuleElement    
  171.                     (const xmlChar *name,
  172.                      const xmlChar *URI);
  173.  
  174. /*
  175.  * top-level elements
  176.  */
  177. typedef void (*xsltTopLevelFunction)    (xsltStylesheetPtr style,
  178.                      xmlNodePtr inst);
  179.  
  180. XSLTPUBFUN int XSLTCALL    
  181.         xsltRegisterExtModuleTopLevel
  182.                     (const xmlChar *name,
  183.                      const xmlChar *URI,
  184.                      xsltTopLevelFunction function);
  185. XSLTPUBFUN xsltTopLevelFunction XSLTCALL 
  186.         xsltExtModuleTopLevelLookup 
  187.                     (const xmlChar *name,
  188.                      const xmlChar *URI);
  189. XSLTPUBFUN int XSLTCALL    
  190.         xsltUnregisterExtModuleTopLevel    
  191.                     (const xmlChar *name,
  192.                      const xmlChar *URI);
  193.  
  194.  
  195. /* These 2 functions are deprecated for use within modules. */
  196. XSLTPUBFUN int XSLTCALL        
  197.         xsltRegisterExtFunction    (xsltTransformContextPtr ctxt,
  198.                      const xmlChar *name,
  199.                      const xmlChar *URI,
  200.                      xmlXPathFunction function);
  201. XSLTPUBFUN int XSLTCALL        
  202.         xsltRegisterExtElement    (xsltTransformContextPtr ctxt,
  203.                      const xmlChar *name,
  204.                      const xmlChar *URI,
  205.                      xsltTransformFunction function);
  206.  
  207. /*
  208.  * Extension Prefix handling API.
  209.  * Those are used by the XSLT (pre)processor.
  210.  */
  211.  
  212. XSLTPUBFUN int XSLTCALL        
  213.         xsltRegisterExtPrefix    (xsltStylesheetPtr style,
  214.                      const xmlChar *prefix,
  215.                      const xmlChar *URI);
  216. XSLTPUBFUN int XSLTCALL        
  217.         xsltCheckExtPrefix    (xsltStylesheetPtr style,
  218.                      const xmlChar *URI);
  219. XSLTPUBFUN int XSLTCALL
  220.         xsltCheckExtURI        (xsltStylesheetPtr style,
  221.                      const xmlChar *URI);
  222. XSLTPUBFUN int XSLTCALL        
  223.         xsltInitCtxtExts    (xsltTransformContextPtr ctxt);
  224. XSLTPUBFUN void XSLTCALL        
  225.         xsltFreeCtxtExts    (xsltTransformContextPtr ctxt);
  226. XSLTPUBFUN void XSLTCALL        
  227.         xsltFreeExts        (xsltStylesheetPtr style);
  228.  
  229. XSLTPUBFUN xsltElemPreCompPtr XSLTCALL 
  230.         xsltPreComputeExtModuleElement
  231.                     (xsltStylesheetPtr style,
  232.                      xmlNodePtr inst);
  233. /*
  234.  * Extension Infos access.
  235.  * Used by exslt initialisation
  236.  */
  237.  
  238. XSLTPUBFUN xmlHashTablePtr XSLTCALL 
  239.         xsltGetExtInfo        (xsltStylesheetPtr style, 
  240.                      const xmlChar *URI);
  241.  
  242. /**
  243.  * Test module http://xmlsoft.org/XSLT/
  244.  */
  245. XSLTPUBFUN void XSLTCALL    
  246.         xsltRegisterTestModule    (void);
  247. XSLTPUBFUN void XSLTCALL    
  248.         xsltDebugDumpExtensions    (FILE * output);
  249.  
  250.  
  251. #ifdef __cplusplus
  252. }
  253. #endif
  254.  
  255. #endif /* __XML_XSLT_EXTENSION_H__ */
  256.  
  257.