Annotation of win32/gnome/libxslt-x.x.x/libxslt/extensions.h, revision 1.2
1.1 paf 1: /*
2: * extension.h: interface for the extension support
3: *
4: * See Copyright for the status of this software.
5: *
6: * daniel@veillard.com
7: */
8:
9: #ifndef __XML_XSLT_EXTENSION_H__
10: #define __XML_XSLT_EXTENSION_H__
11:
12: #include "libxml/xpath.h"
13: #include "xsltInternals.h"
14:
15: #ifdef __cplusplus
16: extern "C" {
17: #endif
18:
19: /**
1.2 ! paf 20: * Extension Modules API.
1.1 paf 21: */
22:
23: /**
24: * xsltStyleExtInitFunction:
25: * @ctxt: an XSLT stylesheet
26: * @URI: the namespace URI for the extension
27: *
1.2 ! paf 28: * A function called at initialization time of an XSLT extension module.
1.1 paf 29: *
1.2 ! paf 30: * Returns a pointer to the module specific data for this transformation.
1.1 paf 31: */
32: typedef void * (*xsltStyleExtInitFunction) (xsltStylesheetPtr style,
33: const xmlChar *URI);
34:
35: /**
36: * xsltStyleExtShutdownFunction:
37: * @ctxt: an XSLT stylesheet
38: * @URI: the namespace URI for the extension
39: * @data: the data associated to this module
40: *
1.2 ! paf 41: * A function called at shutdown time of an XSLT extension module.
1.1 paf 42: */
43: typedef void (*xsltStyleExtShutdownFunction) (xsltStylesheetPtr style,
44: const xmlChar *URI,
45: void *data);
46:
47: /**
48: * xsltExtInitFunction:
49: * @ctxt: an XSLT transformation context
50: * @URI: the namespace URI for the extension
51: *
1.2 ! paf 52: * A function called at initialization time of an XSLT extension module.
1.1 paf 53: *
1.2 ! paf 54: * Returns a pointer to the module specific data for this transformation.
1.1 paf 55: */
56: typedef void * (*xsltExtInitFunction) (xsltTransformContextPtr ctxt,
57: const xmlChar *URI);
58:
59: /**
60: * xsltExtShutdownFunction:
61: * @ctxt: an XSLT transformation context
62: * @URI: the namespace URI for the extension
63: * @data: the data associated to this module
64: *
1.2 ! paf 65: * A function called at shutdown time of an XSLT extension module.
1.1 paf 66: */
67: typedef void (*xsltExtShutdownFunction) (xsltTransformContextPtr ctxt,
68: const xmlChar *URI,
69: void *data);
70:
71: int xsltRegisterExtModule (const xmlChar *URI,
72: xsltExtInitFunction initFunc,
73: xsltExtShutdownFunction shutdownFunc);
74: int xsltRegisterExtModuleFull
75: (const xmlChar * URI,
76: xsltExtInitFunction initFunc,
77: xsltExtShutdownFunction shutdownFunc,
78: xsltStyleExtInitFunction styleInitFunc,
79: xsltStyleExtShutdownFunction styleShutdownFunc);
80:
81: int xsltUnregisterExtModule (const xmlChar * URI);
82:
83: void * xsltGetExtData (xsltTransformContextPtr ctxt,
84: const xmlChar *URI);
85:
86: void * xsltStyleGetExtData (xsltStylesheetPtr style,
87: const xmlChar *URI);
88:
89: void xsltShutdownCtxtExts (xsltTransformContextPtr ctxt);
90:
91: void xsltShutdownExts (xsltStylesheetPtr style);
92:
1.2 ! paf 93: xsltTransformContextPtr xsltXPathGetTransformContext
1.1 paf 94: (xmlXPathParserContextPtr ctxt);
95:
96: /*
97: * extension functions
98: */
99: int xsltRegisterExtModuleFunction (const xmlChar *name,
100: const xmlChar *URI,
101: xmlXPathFunction function);
102: xmlXPathFunction
103: xsltExtFunctionLookup (xsltTransformContextPtr ctxt,
104: const xmlChar *name,
105: const xmlChar *URI);
106: xmlXPathFunction
107: xsltExtModuleFunctionLookup (const xmlChar *name,
108: const xmlChar *URI);
109: int xsltUnregisterExtModuleFunction (const xmlChar *name,
110: const xmlChar *URI);
111:
112: /*
113: * extension elements
114: */
1.2 ! paf 115: typedef xsltElemPreCompPtr (*xsltPreComputeFunction)
! 116: (xsltStylesheetPtr style,
1.1 paf 117: xmlNodePtr inst,
118: xsltTransformFunction function);
119:
1.2 ! paf 120: xsltElemPreCompPtr xsltNewElemPreComp (xsltStylesheetPtr style,
1.1 paf 121: xmlNodePtr inst,
122: xsltTransformFunction function);
123: void xsltInitElemPreComp (xsltElemPreCompPtr comp,
124: xsltStylesheetPtr style,
125: xmlNodePtr inst,
126: xsltTransformFunction function,
127: xsltElemPreCompDeallocator freeFunc);
128:
129: int xsltRegisterExtModuleElement (const xmlChar *name,
130: const xmlChar *URI,
131: xsltPreComputeFunction precomp,
132: xsltTransformFunction transform);
1.2 ! paf 133: xsltTransformFunction xsltExtElementLookup(xsltTransformContextPtr ctxt,
1.1 paf 134: const xmlChar *name,
135: const xmlChar *URI);
1.2 ! paf 136: xsltTransformFunction xsltExtModuleElementLookup(const xmlChar *name,
1.1 paf 137: const xmlChar *URI);
1.2 ! paf 138: xsltPreComputeFunction xsltExtModuleElementPreComputeLookup (const xmlChar *name,
1.1 paf 139: const xmlChar *URI);
140: int xsltUnregisterExtModuleElement (const xmlChar *name,
141: const xmlChar *URI);
142:
143: /*
144: * top-level elements
145: */
1.2 ! paf 146: typedef void (*xsltTopLevelFunction) (xsltStylesheetPtr style,
1.1 paf 147: xmlNodePtr inst);
148:
149: int xsltRegisterExtModuleTopLevel (const xmlChar *name,
150: const xmlChar *URI,
151: xsltTopLevelFunction function);
1.2 ! paf 152: xsltTopLevelFunction xsltExtModuleTopLevelLookup (const xmlChar *name,
1.1 paf 153: const xmlChar *URI);
154: int xsltUnregisterExtModuleTopLevel (const xmlChar *name,
155: const xmlChar *URI);
156:
157:
1.2 ! paf 158: /* These 2 functions are deprecated for use within modules. */
1.1 paf 159: int xsltRegisterExtFunction (xsltTransformContextPtr ctxt,
160: const xmlChar *name,
161: const xmlChar *URI,
162: xmlXPathFunction function);
163: int xsltRegisterExtElement (xsltTransformContextPtr ctxt,
164: const xmlChar *name,
165: const xmlChar *URI,
166: xsltTransformFunction function);
167:
1.2 ! paf 168: /*
! 169: * Extension Prefix handling API.
1.1 paf 170: * Those are used by the XSLT (pre)processor.
171: */
172:
173: int xsltRegisterExtPrefix (xsltStylesheetPtr style,
174: const xmlChar *prefix,
175: const xmlChar *URI);
176: int xsltCheckExtPrefix (xsltStylesheetPtr style,
177: const xmlChar *prefix);
178: int xsltInitCtxtExts (xsltTransformContextPtr ctxt);
179: void xsltFreeCtxtExts (xsltTransformContextPtr ctxt);
180: void xsltFreeExts (xsltStylesheetPtr style);
181:
1.2 ! paf 182: xsltElemPreCompPtr xsltPreComputeExtModuleElement(xsltStylesheetPtr style,
1.1 paf 183: xmlNodePtr inst);
184:
185: /**
186: * Test module http://xmlsoft.org/XSLT/
187: */
188: void xsltRegisterTestModule (void);
1.2 ! paf 189: void xsltDebugDumpExtensions(FILE * output);
! 190:
1.1 paf 191:
192: #ifdef __cplusplus
193: }
194: #endif
195:
196: #endif /* __XML_XSLT_EXTENSION_H__ */
197:
E-mail: