ReactOS  0.4.14-dev-606-g14ebc0b
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 #ifdef HAVE_STDARG_H
17 #include <stdarg.h>
18 #endif
19 #include <libxml/xpath.h>
20 #include <libxml/dict.h>
21 #include <libxml/xmlerror.h>
22 #include "xsltexports.h"
23 #include "xsltInternals.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
34 #define XSLT_TODO \
35  xsltGenericError(xsltGenericErrorContext, \
36  "Unimplemented block at %s:%d\n", \
37  __FILE__, __LINE__);
38 
44 #define XSLT_STRANGE \
45  xsltGenericError(xsltGenericErrorContext, \
46  "Internal error at %s:%d\n", \
47  __FILE__, __LINE__);
48 
54 #define IS_XSLT_ELEM(n) \
55  (((n) != NULL) && ((n)->type == XML_ELEMENT_NODE) && \
56  ((n)->ns != NULL) && (xmlStrEqual((n)->ns->href, XSLT_NAMESPACE)))
57 
63 #define IS_XSLT_NAME(n, val) \
64  (xmlStrEqual((n)->name, (const xmlChar *) (val)))
65 
71 #define IS_XSLT_REAL_NODE(n) \
72  (((n) != NULL) && \
73  (((n)->type == XML_ELEMENT_NODE) || \
74  ((n)->type == XML_TEXT_NODE) || \
75  ((n)->type == XML_CDATA_SECTION_NODE) || \
76  ((n)->type == XML_ATTRIBUTE_NODE) || \
77  ((n)->type == XML_DOCUMENT_NODE) || \
78  ((n)->type == XML_HTML_DOCUMENT_NODE) || \
79  ((n)->type == XML_COMMENT_NODE) || \
80  ((n)->type == XML_PI_NODE)))
81 
82 /*
83  * Our own version of namespaced atributes lookup.
84  */
87  const xmlChar *name,
88  const xmlChar *nameSpace);
92  const xmlChar *name,
93  const xmlChar *nameSpace);
95  xsltGetUTF8Char (const unsigned char *utf,
96  int *len);
97 
98 /*
99  * XSLT Debug Tracing Tracing Types
100  */
101 typedef enum {
115  XSLT_TRACE_IF = 1<<11,
122 
128 #define XSLT_TRACE(ctxt,code,call) \
129  if (ctxt->traceCode && (*(ctxt->traceCode) & code)) \
130  call
131 
132 XSLTPUBFUN void XSLTCALL
136 
137 /*
138  * XSLT specific error and debug reporting functions.
139  */
144 
145 XSLTPUBFUN void XSLTCALL
148  xmlNodePtr node);
149 XSLTPUBFUN void XSLTCALL
152  xmlNodePtr inst);
153 XSLTPUBFUN void XSLTCALL
154  xsltSetGenericErrorFunc (void *ctx,
156 XSLTPUBFUN void XSLTCALL
157  xsltSetGenericDebugFunc (void *ctx,
159 XSLTPUBFUN void XSLTCALL
161  void *ctx,
163 XSLTPUBFUN void XSLTCALL
167  const char *msg,
168  ...) LIBXSLT_ATTR_FORMAT(4,5);
169 
172  int options);
173 /*
174  * Sorting.
175  */
176 
177 XSLTPUBFUN void XSLTCALL
178  xsltDocumentSortFunction (xmlNodeSetPtr list);
179 XSLTPUBFUN void XSLTCALL
181 XSLTPUBFUN void XSLTCALL
184 XSLTPUBFUN void XSLTCALL
186  xmlNodePtr *sorts,
187  int nbsorts);
188 XSLTPUBFUN void XSLTCALL
190  xmlNodePtr * sorts,
191  int nbsorts);
192 XSLTPUBFUN xmlXPathObjectPtr * XSLTCALL
194  xmlNodePtr sort);
195 
196 /*
197  * QNames handling.
198  */
199 
202  const xmlChar *name,
203  const xmlChar **prefix);
206  xmlChar **name);
207 
211  const xmlChar **name);
212 
213 /*
214  * Output, reuse libxml I/O buffers.
215  */
221  xsltSaveResultToFilename (const char *URI,
224  int compression);
230  xsltSaveResultToFd (int fd,
234  xsltSaveResultToString (xmlChar **doc_txt_ptr,
235  int * doc_txt_len,
238 
239 /*
240  * XPath interface
241  */
242 XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL
244  const xmlChar *str);
245 XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL
247  const xmlChar *str,
248  int flags);
249 
250 /*
251  * Profiling.
252  */
253 XSLTPUBFUN void XSLTCALL
255  FILE *output);
258 
259 XSLTPUBFUN long XSLTCALL
260  xsltTimestamp (void);
261 XSLTPUBFUN void XSLTCALL
262  xsltCalibrateAdjust (long delta);
263 
269 #define XSLT_TIMESTAMP_TICS_PER_SEC 100000l
270 
271 /*
272  * Hooks for the debugger.
273  */
274 
275 typedef enum {
276  XSLT_DEBUG_NONE = 0, /* no debugging allowed */
287 
289 
294 
295 XSLTPUBFUN void XSLTCALL
298  xsltGetDebuggerStatus (void);
300  xsltSetDebuggerCallbacks (int no, void *block);
304 XSLTPUBFUN void XSLTCALL
305  xslDropCall (void);
306 
307 #ifdef __cplusplus
308 }
309 #endif
310 
311 #endif /* __XML_XSLTUTILS_H__ */
312 
313 
static unsigned int block
Definition: xmlmemory.c:118
XSLTPUBFUN xsltDebugTraceCodes XSLTCALL xsltDebugGetDefaultTrace(void)
Definition: transform.c:456
XSLTPUBFUN xmlDocPtr XSLTCALL xsltGetProfileInformation(xsltTransformContextPtr ctxt)
Definition: xsltutils.c:2157
XSLTPUBFUN int XSLTCALL xsltSaveResultToString(xmlChar **doc_txt_ptr, int *doc_txt_len, xmlDocPtr result, xsltStylesheetPtr style)
Definition: xsltutils.c:1720
void(* xsltDropCallCallback)(void)
Definition: xsltutils.h:293
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL xsltXPathCompileFlags(xsltStylesheetPtr style, const xmlChar *str, int flags)
Definition: xsltutils.c:2262
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
XSLTPUBFUN void XSLTCALL xsltSetCtxtSortFunc(xsltTransformContextPtr ctxt, xsltSortFunc handler)
Definition: xsltutils.c:1367
XSLTPUBFUN void XSLTCALL xsltCalibrateAdjust(long delta)
Definition: xsltutils.c:1802
XSLTPUBFUN xmlXPathObjectPtr *XSLTCALL xsltComputeSortResult(xsltTransformContextPtr ctxt, xmlNodePtr sort)
Definition: xsltutils.c:937
_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:1589
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:275
XSLTPUBFUN long XSLTCALL xsltTimestamp(void)
Definition: xsltutils.c:1815
XSLTPUBFUN void XSLTCALL xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts, int nbsorts)
Definition: xsltutils.c:1064
XSLTPUBFUN const xmlChar *XSLTCALL xsltGetQNameURI2(xsltStylesheetPtr style, xmlNodePtr node, const xmlChar **name)
Definition: xsltutils.c:827
XSLTPUBVAR int xslDebugStatus
Definition: xsltutils.h:288
XSLTPUBFUN int XSLTCALL xsltSetDebuggerCallbacks(int no, void *block)
Definition: xsltutils.c:2396
XSLTPUBFUN xmlChar *XSLTCALL xsltGetNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace)
Definition: xsltutils.c:142
struct node node
XSLTPUBFUN void XSLTCALL xsltPrintErrorContext(xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node)
Definition: xsltutils.c:583
XSLTPUBVAR void * xsltGenericDebugContext
Definition: xsltutils.h:143
xmlOutputBuffer * xmlOutputBufferPtr
Definition: tree.h:32
XSLTPUBFUN void XSLTCALL xslDropCall(void)
Definition: xsltutils.c:2452
XSLTPUBVAR xmlGenericErrorFunc xsltGenericError
Definition: xsltutils.h:140
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
GLuint GLfloat * val
Definition: glext.h:7180
XSLTPUBFUN int XSLTCALL xsltGetDebuggerStatus(void)
Definition: xsltutils.c:2379
static WCHAR no[MAX_STRING_RESOURCE_LEN]
Definition: object.c:2340
XSLTPUBFUN void XSLTCALL xsltDoSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts, int nbsorts)
Definition: xsltutils.c:1332
XSLTPUBVAR xmlGenericErrorFunc xsltGenericDebug
Definition: xsltutils.h:142
XSLTPUBFUN void XSLTCALL xsltSaveProfiling(xsltTransformContextPtr ctxt, FILE *output)
Definition: xsltutils.c:1937
void(* xsltHandleDebuggerCallback)(xmlNodePtr cur, xmlNodePtr node, xsltTemplatePtr templ, xsltTransformContextPtr ctxt)
Definition: xsltutils.h:290
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:445
Definition: tree.h:489
XSLTPUBFUN int XSLTCALL xsltSaveResultTo(xmlOutputBufferPtr buf, xmlDocPtr result, xsltStylesheetPtr style)
Definition: xsltutils.c:1423
_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:1314
unsigned char xmlChar
Definition: xmlstring.h:28
GLenum GLsizei len
Definition: glext.h:6722
XSLTPUBFUN void XSLTCALL xsltSetDebuggerStatus(int value)
Definition: xsltutils.c:2366
Definition: _list.h:228
XSLTPUBFUN int XSLTCALL xsltSaveResultToFd(int fd, xmlDocPtr result, xsltStylesheetPtr style)
Definition: xsltutils.c:1677
XSLTPUBFUN void XSLTCALL xsltDocumentSortFunction(xmlNodeSetPtr list)
Definition: xsltutils.c:903
#define XSLTPUBVAR
Definition: xsltexports.h:37
XSLTPUBFUN void XSLTCALL xsltSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler)
Definition: xsltutils.c:520
#define LIBXSLT_ATTR_FORMAT(fmt, args)
Definition: xsltconfig.h:150
__XML_EXTERNC typedef xmlDict * xmlDictPtr
Definition: dict.h:24
#define XSLTPUBFUN
Definition: xsltexports.h:31
XSLTPUBFUN void XSLTCALL xsltSetSortFunc(xsltSortFunc handler)
Definition: xsltutils.c:1349
GLsizei GLsizei GLchar * source
Definition: glext.h:6048
XSLTPUBFUN int XSLTCALL xsltSaveResultToFile(FILE *file, xmlDocPtr result, xsltStylesheetPtr style)
Definition: xsltutils.c:1633
#define XSLTCALL
Definition: xsltexports.h:43
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:845
XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL xsltXPathCompile(xsltStylesheetPtr style, const xmlChar *str)
Definition: xsltutils.c:2327
XSLTPUBFUN int XSLTCALL xslAddCall(xsltTemplatePtr templ, xmlNodePtr source)
Definition: xsltutils.c:2439
#define const
Definition: zconf.h:230
XSLTPUBVAR void * xsltGenericErrorContext
Definition: xsltutils.h:141
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786
xsltDebugTraceCodes
Definition: xsltutils.h:101
Arabic default style
Definition: afstyles.h:93
XSLTPUBFUN void XSLTCALL XSLTPUBFUN int XSLTCALL xsltSetCtxtParseOptions(xsltTransformContextPtr ctxt, int options)
Definition: xsltutils.c:1388
GLuint64EXT * result
Definition: glext.h:11304
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:292
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