ReactOS  0.4.15-dev-5606-gf34e425
xsltutils.h
Go to the documentation of this file.
1 /*
2  * Summary: set of utilities for the XSLT engine
3  * Description: interfaces for the utilities module of the XSLT engine.
4  * things like message handling, profiling, and other
5  * generally useful routines.
6  *
7  * Copy: See Copyright for the status of this software.
8  *
9  * Author: Daniel Veillard
10  */
11 
12 #ifndef __XML_XSLTUTILS_H__
13 #define __XML_XSLTUTILS_H__
14 
15 #include <libxslt/xsltconfig.h>
16 #include <libxml/xpath.h>
17 #include <libxml/dict.h>
18 #include <libxml/xmlerror.h>
19 #include "xsltexports.h"
20 #include "xsltInternals.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
31 #define XSLT_TODO \
32  xsltGenericError(xsltGenericErrorContext, \
33  "Unimplemented block at %s:%d\n", \
34  __FILE__, __LINE__);
35 
41 #define XSLT_STRANGE \
42  xsltGenericError(xsltGenericErrorContext, \
43  "Internal error at %s:%d\n", \
44  __FILE__, __LINE__);
45 
51 #define IS_XSLT_ELEM(n) \
52  (((n) != NULL) && ((n)->type == XML_ELEMENT_NODE) && \
53  ((n)->ns != NULL) && (xmlStrEqual((n)->ns->href, XSLT_NAMESPACE)))
54 
60 #define IS_XSLT_NAME(n, val) \
61  (xmlStrEqual((n)->name, (const xmlChar *) (val)))
62 
68 #define IS_XSLT_REAL_NODE(n) \
69  (((n) != NULL) && \
70  (((n)->type == XML_ELEMENT_NODE) || \
71  ((n)->type == XML_TEXT_NODE) || \
72  ((n)->type == XML_CDATA_SECTION_NODE) || \
73  ((n)->type == XML_ATTRIBUTE_NODE) || \
74  ((n)->type == XML_DOCUMENT_NODE) || \
75  ((n)->type == XML_HTML_DOCUMENT_NODE) || \
76  ((n)->type == XML_COMMENT_NODE) || \
77  ((n)->type == XML_PI_NODE)))
78 
79 /*
80  * Our own version of namespaced attributes lookup.
81  */
84  const xmlChar *name,
85  const xmlChar *nameSpace);
89  const xmlChar *name,
90  const xmlChar *nameSpace);
92  xsltGetUTF8Char (const unsigned char *utf,
93  int *len);
94 
95 /*
96  * XSLT Debug Tracing Tracing Types
97  */
98 typedef enum {
112  XSLT_TRACE_IF = 1<<11,
119 
125 #define XSLT_TRACE(ctxt,code,call) \
126  if (ctxt->traceCode && (*(ctxt->traceCode) & code)) \
127  call
128 
129 XSLTPUBFUN void XSLTCALL
133 
134 /*
135  * XSLT specific error and debug reporting functions.
136  */
141 
142 XSLTPUBFUN void XSLTCALL
145  xmlNodePtr node);
146 XSLTPUBFUN void XSLTCALL
149  xmlNodePtr inst);
150 XSLTPUBFUN void XSLTCALL
153 XSLTPUBFUN void XSLTCALL
156 XSLTPUBFUN void XSLTCALL
158  void *ctx,
160 XSLTPUBFUN void XSLTCALL
164  const char *msg,
165  ...) LIBXSLT_ATTR_FORMAT(4,5);
166 
169  int options);
170 /*
171  * Sorting.
172  */
173 
174 XSLTPUBFUN void XSLTCALL
175  xsltDocumentSortFunction (xmlNodeSetPtr list);
176 XSLTPUBFUN void XSLTCALL
178 XSLTPUBFUN void XSLTCALL
181 XSLTPUBFUN void XSLTCALL
183  xmlNodePtr *sorts,
184  int nbsorts);
185 XSLTPUBFUN void XSLTCALL
187  xmlNodePtr * sorts,
188  int nbsorts);
189 XSLTPUBFUN xmlXPathObjectPtr * XSLTCALL
191  xmlNodePtr sort);
192 
193 /*
194  * QNames handling.
195  */
196 
199  const xmlChar *name,
200  const xmlChar **prefix);
203  xmlChar **name);
204 
208  const xmlChar **name);
209 
210 /*
211  * Output, reuse libxml I/O buffers.
212  */
218  xsltSaveResultToFilename (const char *URI,
221  int compression);
227  xsltSaveResultToFd (int fd,
231  xsltSaveResultToString (xmlChar **doc_txt_ptr,
232  int * doc_txt_len,
235 
236 /*
237  * XPath interface
238  */
239 XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL
241  const xmlChar *str);
242 XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL
244  const xmlChar *str,
245  int flags);
246 
247 /*
248  * Profiling.
249  */
250 XSLTPUBFUN void XSLTCALL
252  FILE *output);
255 
256 XSLTPUBFUN long XSLTCALL
257  xsltTimestamp (void);
258 XSLTPUBFUN void XSLTCALL
259  xsltCalibrateAdjust (long delta);
260 
266 #define XSLT_TIMESTAMP_TICS_PER_SEC 100000l
267 
268 /*
269  * Hooks for the debugger.
270  */
271 
272 typedef enum {
273  XSLT_DEBUG_NONE = 0, /* no debugging allowed */
284 
286 
291 
292 XSLTPUBFUN void XSLTCALL
295  xsltGetDebuggerStatus (void);
297  xsltSetDebuggerCallbacks (int no, void *block);
301 XSLTPUBFUN void XSLTCALL
302  xslDropCall (void);
303 
304 #ifdef __cplusplus
305 }
306 #endif
307 
308 #endif /* __XML_XSLTUTILS_H__ */
309 
310 
static unsigned int block
Definition: xmlmemory.c:101
XSLTPUBFUN xsltDebugTraceCodes XSLTCALL xsltDebugGetDefaultTrace(void)
Definition: transform.c:460
XSLTPUBFUN xmlDocPtr XSLTCALL xsltGetProfileInformation(xsltTransformContextPtr ctxt)
XSLTPUBFUN int XSLTCALL xsltSaveResultToString(xmlChar **doc_txt_ptr, int *doc_txt_len, xmlDocPtr result, xsltStylesheetPtr style)
Definition: xsltutils.c:1767
Definition: pdh_main.c:93
void(* xsltDropCallCallback)(void)
Definition: xsltutils.h:290
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
GLuint64EXT * result
Definition: glext.h:11304
XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL xsltXPathCompileFlags(xsltStylesheetPtr style, const xmlChar *str, int flags)
Definition: xsltutils.c:2313
XSLTPUBFUN void XSLTCALL xsltSetCtxtSortFunc(xsltTransformContextPtr ctxt, xsltSortFunc handler)
Definition: xsltutils.c:1404
XSLTPUBFUN void XSLTCALL xsltCalibrateAdjust(long delta)
XSLTPUBFUN xmlXPathObjectPtr *XSLTCALL xsltComputeSortResult(xsltTransformContextPtr ctxt, xmlNodePtr sort)
Definition: xsltutils.c:1067
_STLP_MOVE_TO_STD_NAMESPACE void sort(_RandomAccessIter __first, _RandomAccessIter __last)
Definition: _algo.c:993
XSLTPUBFUN int XSLTCALL xsltSaveResultToFilename(const char *URI, xmlDocPtr result, xsltStylesheetPtr style, int compression)
Definition: xsltutils.c:1636
XSLTPUBFUN void XSLTCALL xsltTransformError(xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node, const char *msg,...) LIBXSLT_ATTR_FORMAT(4
static int fd
Definition: io.c:51
xsltDebugStatusCodes
Definition: xsltutils.h:272
XSLTPUBFUN long XSLTCALL xsltTimestamp(void)
XSLTPUBFUN void XSLTCALL xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts, int nbsorts)
Definition: xsltutils.c:1081
XSLTPUBFUN const xmlChar *XSLTCALL xsltGetQNameURI2(xsltStylesheetPtr style, xmlNodePtr node, const xmlChar **name)
Definition: xsltutils.c:827
XSLTPUBVAR int xslDebugStatus
Definition: xsltutils.h:285
XSLTPUBFUN int XSLTCALL xsltSetDebuggerCallbacks(int no, void *block)
XSLTPUBFUN xmlChar *XSLTCALL xsltGetNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace)
Definition: xsltutils.c:142
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
struct node node
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void _In_opt_ PIRP _In_ LIST_ENTRY _In_ uint8_t compression
Definition: btrfs_drv.h:1364
XSLTPUBFUN void XSLTCALL xsltPrintErrorContext(xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node)
Definition: xsltutils.c:583
XSLTPUBVAR void * xsltGenericDebugContext
Definition: xsltutils.h:140
xmlOutputBuffer * xmlOutputBufferPtr
Definition: tree.h:32
XSLTPUBFUN void XSLTCALL xslDropCall(void)
XSLTPUBVAR xmlGenericErrorFunc xsltGenericError
Definition: xsltutils.h:137
const WCHAR * str
XSLTPUBFUN const xmlChar *XSLTCALL xsltGetQNameURI(xmlNodePtr node, xmlChar **name)
Definition: xsltutils.c:753
XSLTPUBFUN const xmlChar *XSLTCALL xsltSplitQName(xmlDictPtr dict, const xmlChar *name, const xmlChar **prefix)
Definition: xsltutils.c:720
Definition: dict.c:111
GLuint GLfloat * val
Definition: glext.h:7180
XSLTPUBFUN int XSLTCALL xsltGetDebuggerStatus(void)
Definition: xsltutils.c:2376
static WCHAR no[MAX_STRING_RESOURCE_LEN]
Definition: object.c:2340
XSLTPUBFUN void XSLTCALL xsltDoSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts, int nbsorts)
Definition: xsltutils.c:1369
XSLTPUBVAR xmlGenericErrorFunc xsltGenericDebug
Definition: xsltutils.h:139
XSLTPUBFUN void XSLTCALL xsltSaveProfiling(xsltTransformContextPtr ctxt, FILE *output)
void(* xsltHandleDebuggerCallback)(xmlNodePtr cur, xmlNodePtr node, xsltTemplatePtr templ, xsltTransformContextPtr ctxt)
Definition: xsltutils.h:287
void(* xsltSortFunc)(xsltTransformContextPtr ctxt, xmlNodePtr *sorts, int nbsorts)
GLbitfield flags
Definition: glext.h:7161
XSLTPUBFUN const xmlChar *XSLTCALL xsltGetCNsProp(xsltStylesheetPtr style, xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace)
Definition: xsltutils.c:52
XSLTPUBFUN void XSLTCALL xsltDebugSetDefaultTrace(xsltDebugTraceCodes val)
Definition: transform.c:449
Definition: tree.h:489
XSLTPUBFUN int XSLTCALL xsltSaveResultTo(xmlOutputBufferPtr buf, xmlDocPtr result, xsltStylesheetPtr style)
Definition: xsltutils.c:1460
unsigned char xmlChar
Definition: xmlstring.h:28
GLenum GLsizei len
Definition: glext.h:6722
XSLTPUBFUN void XSLTCALL xsltSetDebuggerStatus(int value)
Definition: _list.h:228
XSLTPUBFUN int XSLTCALL xsltSaveResultToFd(int fd, xmlDocPtr result, xsltStylesheetPtr style)
Definition: xsltutils.c:1724
XSLTPUBFUN void XSLTCALL xsltDocumentSortFunction(xmlNodeSetPtr list)
Definition: xsltutils.c:903
#define XSLTPUBVAR
Definition: xsltexports.h:55
XSLTPUBFUN void XSLTCALL xsltSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler)
Definition: xsltutils.c:520
FxCollectionEntry * cur
#define LIBXSLT_ATTR_FORMAT(fmt, args)
Definition: xsltconfig.h:159
#define XSLTPUBFUN
Definition: xsltexports.h:48
XSLTPUBFUN void XSLTCALL xsltSetSortFunc(xsltSortFunc handler)
Definition: xsltutils.c:1386
GLsizei GLsizei GLchar * source
Definition: glext.h:6048
XSLTPUBFUN int XSLTCALL xsltSaveResultToFile(FILE *file, xmlDocPtr result, xsltStylesheetPtr style)
Definition: xsltutils.c:1680
#define XSLTCALL
Definition: xsltexports.h:39
Definition: tree.h:551
#define msg(x)
Definition: auth_time.c:54
Definition: name.c:38
void(XMLCDECL * xmlGenericErrorFunc)(void *ctx, const char *msg,...) LIBXML_ATTR_FORMAT(2
Definition: xmlerror.h:847
XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL xsltXPathCompile(xsltStylesheetPtr style, const xmlChar *str)
Definition: xsltutils.c:2356
XSLTPUBFUN int XSLTCALL xslAddCall(xsltTemplatePtr templ, xmlNodePtr source)
#define const
Definition: zconf.h:230
XSLTPUBVAR void * xsltGenericErrorContext
Definition: xsltutils.h:138
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7482
xsltDebugTraceCodes
Definition: xsltutils.h:98
Arabic default style
Definition: afstyles.h:93
XSLTPUBFUN void XSLTCALL XSLTPUBFUN int XSLTCALL xsltSetCtxtParseOptions(xsltTransformContextPtr ctxt, int options)
Definition: xsltutils.c:1425
XSLTPUBFUN void XSLTCALL xsltMessage(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst)
Definition: xsltutils.c:408
XSLTPUBFUN void XSLTCALL xsltSetGenericDebugFunc(void *ctx, xmlGenericErrorFunc handler)
Definition: xsltutils.c:566
XSLTPUBFUN void XSLTCALL xsltSetTransformErrorFunc(xsltTransformContextPtr ctxt, void *ctx, xmlGenericErrorFunc handler)
Definition: xsltutils.c:659
int(* xsltAddCallCallback)(xsltTemplatePtr templ, xmlNodePtr source)
Definition: xsltutils.h:289
Definition: dlist.c:348
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
XSLTPUBFUN int XSLTCALL xsltGetUTF8Char(const unsigned char *utf, int *len)
Definition: xsltutils.c:227
Definition: fci.c:126