Path: blob/master/venv/Lib/site-packages/lxml/includes/libxslt/extensions.h
811 views
/*1* Summary: interface for the extension support2* Description: This provide the API needed for simple and module3* extension support.4*5* Copy: See Copyright for the status of this software.6*7* Author: Daniel Veillard8*/910#ifndef __XML_XSLT_EXTENSION_H__11#define __XML_XSLT_EXTENSION_H__1213#include <libxml/xpath.h>14#include "xsltexports.h"15#include "xsltInternals.h"1617#ifdef __cplusplus18extern "C" {19#endif2021/**22* Extension Modules API.23*/2425/**26* xsltInitGlobals:27*28* Initialize the global variables for extensions29*30*/3132XSLTPUBFUN void XSLTCALL33xsltInitGlobals (void);3435/**36* xsltStyleExtInitFunction:37* @ctxt: an XSLT stylesheet38* @URI: the namespace URI for the extension39*40* A function called at initialization time of an XSLT extension module.41*42* Returns a pointer to the module specific data for this transformation.43*/44typedef void * (*xsltStyleExtInitFunction) (xsltStylesheetPtr style,45const xmlChar *URI);4647/**48* xsltStyleExtShutdownFunction:49* @ctxt: an XSLT stylesheet50* @URI: the namespace URI for the extension51* @data: the data associated to this module52*53* A function called at shutdown time of an XSLT extension module.54*/55typedef void (*xsltStyleExtShutdownFunction) (xsltStylesheetPtr style,56const xmlChar *URI,57void *data);5859/**60* xsltExtInitFunction:61* @ctxt: an XSLT transformation context62* @URI: the namespace URI for the extension63*64* A function called at initialization time of an XSLT extension module.65*66* Returns a pointer to the module specific data for this transformation.67*/68typedef void * (*xsltExtInitFunction) (xsltTransformContextPtr ctxt,69const xmlChar *URI);7071/**72* xsltExtShutdownFunction:73* @ctxt: an XSLT transformation context74* @URI: the namespace URI for the extension75* @data: the data associated to this module76*77* A function called at shutdown time of an XSLT extension module.78*/79typedef void (*xsltExtShutdownFunction) (xsltTransformContextPtr ctxt,80const xmlChar *URI,81void *data);8283XSLTPUBFUN int XSLTCALL84xsltRegisterExtModule (const xmlChar *URI,85xsltExtInitFunction initFunc,86xsltExtShutdownFunction shutdownFunc);87XSLTPUBFUN int XSLTCALL88xsltRegisterExtModuleFull89(const xmlChar * URI,90xsltExtInitFunction initFunc,91xsltExtShutdownFunction shutdownFunc,92xsltStyleExtInitFunction styleInitFunc,93xsltStyleExtShutdownFunction styleShutdownFunc);9495XSLTPUBFUN int XSLTCALL96xsltUnregisterExtModule (const xmlChar * URI);9798XSLTPUBFUN void * XSLTCALL99xsltGetExtData (xsltTransformContextPtr ctxt,100const xmlChar *URI);101102XSLTPUBFUN void * XSLTCALL103xsltStyleGetExtData (xsltStylesheetPtr style,104const xmlChar *URI);105#ifdef XSLT_REFACTORED106XSLTPUBFUN void * XSLTCALL107xsltStyleStylesheetLevelGetExtData(108xsltStylesheetPtr style,109const xmlChar * URI);110#endif111XSLTPUBFUN void XSLTCALL112xsltShutdownCtxtExts (xsltTransformContextPtr ctxt);113114XSLTPUBFUN void XSLTCALL115xsltShutdownExts (xsltStylesheetPtr style);116117XSLTPUBFUN xsltTransformContextPtr XSLTCALL118xsltXPathGetTransformContext119(xmlXPathParserContextPtr ctxt);120121/*122* extension functions123*/124XSLTPUBFUN int XSLTCALL125xsltRegisterExtModuleFunction126(const xmlChar *name,127const xmlChar *URI,128xmlXPathFunction function);129XSLTPUBFUN xmlXPathFunction XSLTCALL130xsltExtModuleFunctionLookup (const xmlChar *name,131const xmlChar *URI);132XSLTPUBFUN int XSLTCALL133xsltUnregisterExtModuleFunction134(const xmlChar *name,135const xmlChar *URI);136137/*138* extension elements139*/140typedef xsltElemPreCompPtr (*xsltPreComputeFunction)141(xsltStylesheetPtr style,142xmlNodePtr inst,143xsltTransformFunction function);144145XSLTPUBFUN xsltElemPreCompPtr XSLTCALL146xsltNewElemPreComp (xsltStylesheetPtr style,147xmlNodePtr inst,148xsltTransformFunction function);149XSLTPUBFUN void XSLTCALL150xsltInitElemPreComp (xsltElemPreCompPtr comp,151xsltStylesheetPtr style,152xmlNodePtr inst,153xsltTransformFunction function,154xsltElemPreCompDeallocator freeFunc);155156XSLTPUBFUN int XSLTCALL157xsltRegisterExtModuleElement158(const xmlChar *name,159const xmlChar *URI,160xsltPreComputeFunction precomp,161xsltTransformFunction transform);162XSLTPUBFUN xsltTransformFunction XSLTCALL163xsltExtElementLookup (xsltTransformContextPtr ctxt,164const xmlChar *name,165const xmlChar *URI);166XSLTPUBFUN xsltTransformFunction XSLTCALL167xsltExtModuleElementLookup168(const xmlChar *name,169const xmlChar *URI);170XSLTPUBFUN xsltPreComputeFunction XSLTCALL171xsltExtModuleElementPreComputeLookup172(const xmlChar *name,173const xmlChar *URI);174XSLTPUBFUN int XSLTCALL175xsltUnregisterExtModuleElement176(const xmlChar *name,177const xmlChar *URI);178179/*180* top-level elements181*/182typedef void (*xsltTopLevelFunction) (xsltStylesheetPtr style,183xmlNodePtr inst);184185XSLTPUBFUN int XSLTCALL186xsltRegisterExtModuleTopLevel187(const xmlChar *name,188const xmlChar *URI,189xsltTopLevelFunction function);190XSLTPUBFUN xsltTopLevelFunction XSLTCALL191xsltExtModuleTopLevelLookup192(const xmlChar *name,193const xmlChar *URI);194XSLTPUBFUN int XSLTCALL195xsltUnregisterExtModuleTopLevel196(const xmlChar *name,197const xmlChar *URI);198199200/* These 2 functions are deprecated for use within modules. */201XSLTPUBFUN int XSLTCALL202xsltRegisterExtFunction (xsltTransformContextPtr ctxt,203const xmlChar *name,204const xmlChar *URI,205xmlXPathFunction function);206XSLTPUBFUN int XSLTCALL207xsltRegisterExtElement (xsltTransformContextPtr ctxt,208const xmlChar *name,209const xmlChar *URI,210xsltTransformFunction function);211212/*213* Extension Prefix handling API.214* Those are used by the XSLT (pre)processor.215*/216217XSLTPUBFUN int XSLTCALL218xsltRegisterExtPrefix (xsltStylesheetPtr style,219const xmlChar *prefix,220const xmlChar *URI);221XSLTPUBFUN int XSLTCALL222xsltCheckExtPrefix (xsltStylesheetPtr style,223const xmlChar *URI);224XSLTPUBFUN int XSLTCALL225xsltCheckExtURI (xsltStylesheetPtr style,226const xmlChar *URI);227XSLTPUBFUN int XSLTCALL228xsltInitCtxtExts (xsltTransformContextPtr ctxt);229XSLTPUBFUN void XSLTCALL230xsltFreeCtxtExts (xsltTransformContextPtr ctxt);231XSLTPUBFUN void XSLTCALL232xsltFreeExts (xsltStylesheetPtr style);233234XSLTPUBFUN xsltElemPreCompPtr XSLTCALL235xsltPreComputeExtModuleElement236(xsltStylesheetPtr style,237xmlNodePtr inst);238/*239* Extension Infos access.240* Used by exslt initialisation241*/242243XSLTPUBFUN xmlHashTablePtr XSLTCALL244xsltGetExtInfo (xsltStylesheetPtr style,245const xmlChar *URI);246247/**248* Test module http://xmlsoft.org/XSLT/249*/250XSLTPUBFUN void XSLTCALL251xsltRegisterTestModule (void);252XSLTPUBFUN void XSLTCALL253xsltDebugDumpExtensions (FILE * output);254255256#ifdef __cplusplus257}258#endif259260#endif /* __XML_XSLT_EXTENSION_H__ */261262263264