Annotation of win32/gnome/libxslt-x.x.x/libxslt/xsltutils.h, revision 1.1
1.1 ! paf 1: /*
! 2: * xsltutils.h: interfaces for the utilities module of the XSLT engine
! 3: *
! 4: * See Copyright for the status of this software.
! 5: *
! 6: * daniel@veillard.com
! 7: */
! 8:
! 9: #ifndef __XML_XSLTUTILS_H__
! 10: #define __XML_XSLTUTILS_H__
! 11:
! 12: #if defined(WIN32) && defined(_MSC_VER)
! 13: #include <libxslt/xsltwin32config.h>
! 14: #else
! 15: #include <libxslt/xsltconfig.h>
! 16: #endif
! 17:
! 18: #include <libxml/xpath.h>
! 19: #include <libxml/xmlerror.h>
! 20: #include "xsltInternals.h"
! 21:
! 22: #ifdef __cplusplus
! 23: extern "C" {
! 24: #endif
! 25:
! 26: /**
! 27: * TODO:
! 28: *
! 29: * macro to flag unimplemented blocks
! 30: */
! 31: #define XSLT_TODO \
! 32: xsltGenericError(xsltGenericErrorContext, \
! 33: "Unimplemented block at %s:%d\n", \
! 34: __FILE__, __LINE__);
! 35:
! 36: /**
! 37: * STRANGE:
! 38: *
! 39: * macro to flag that a problem was detected internally
! 40: */
! 41: #define XSLT_STRANGE \
! 42: xsltGenericError(xsltGenericErrorContext, \
! 43: "Internal error at %s:%d\n", \
! 44: __FILE__, __LINE__);
! 45:
! 46: /**
! 47: * IS_XSLT_ELEM:
! 48: *
! 49: * Checks that the element pertains to XSLt namespace
! 50: */
! 51: #define IS_XSLT_ELEM(n) \
! 52: (((n) != NULL) && ((n)->ns != NULL) && \
! 53: (xmlStrEqual((n)->ns->href, XSLT_NAMESPACE)))
! 54:
! 55: /**
! 56: * IS_XSLT_NAME:
! 57: *
! 58: * Checks the value of an element in XSLT namespace
! 59: */
! 60: #define IS_XSLT_NAME(n, val) \
! 61: (xmlStrEqual((n)->name, (const xmlChar *) (val)))
! 62:
! 63: /**
! 64: * IS_XSLT_REAL_NODE:
! 65: *
! 66: * check that a node is a 'real' one: document, element, text or attribute
! 67: */
! 68: #ifdef LIBXML_DOCB_ENABLED
! 69: #define IS_XSLT_REAL_NODE(n) \
! 70: (((n) != NULL) && \
! 71: (((n)->type == XML_ELEMENT_NODE) || \
! 72: ((n)->type == XML_TEXT_NODE) || \
! 73: ((n)->type == XML_ATTRIBUTE_NODE) || \
! 74: ((n)->type == XML_DOCUMENT_NODE) || \
! 75: ((n)->type == XML_HTML_DOCUMENT_NODE) || \
! 76: ((n)->type == XML_DOCB_DOCUMENT_NODE)))
! 77: #else
! 78: #define IS_XSLT_REAL_NODE(n) \
! 79: (((n) != NULL) && \
! 80: (((n)->type == XML_ELEMENT_NODE) || \
! 81: ((n)->type == XML_TEXT_NODE) || \
! 82: ((n)->type == XML_ATTRIBUTE_NODE) || \
! 83: ((n)->type == XML_DOCUMENT_NODE) || \
! 84: ((n)->type == XML_HTML_DOCUMENT_NODE)))
! 85: #endif
! 86:
! 87: /*
! 88: * Our own version of namespaced atributes lookup
! 89: */
! 90: xmlChar * xsltGetNsProp (xmlNodePtr node,
! 91: const xmlChar *name,
! 92: const xmlChar *nameSpace);
! 93:
! 94: /*
! 95: * XSLT specific error and debug reporting functions
! 96: */
! 97: LIBXSLT_PUBLIC extern xmlGenericErrorFunc xsltGenericError;
! 98: LIBXSLT_PUBLIC extern void *xsltGenericErrorContext;
! 99: LIBXSLT_PUBLIC extern xmlGenericErrorFunc xsltGenericDebug;
! 100: LIBXSLT_PUBLIC extern void *xsltGenericDebugContext;
! 101:
! 102: void xsltPrintErrorContext (xsltTransformContextPtr ctxt,
! 103: xsltStylesheetPtr style,
! 104: xmlNodePtr node);
! 105: void xsltMessage (xsltTransformContextPtr ctxt,
! 106: xmlNodePtr node,
! 107: xmlNodePtr inst);
! 108: void xsltSetGenericErrorFunc (void *ctx,
! 109: xmlGenericErrorFunc handler);
! 110: void xsltSetGenericDebugFunc (void *ctx,
! 111: xmlGenericErrorFunc handler);
! 112:
! 113: /*
! 114: * Sorting
! 115: */
! 116:
! 117: void xsltDocumentSortFunction (xmlNodeSetPtr list);
! 118: void xsltDoSortFunction (xsltTransformContextPtr ctxt,
! 119: xmlNodePtr *sorts,
! 120: int nbsorts);
! 121:
! 122: /*
! 123: * QNames handling
! 124: */
! 125:
! 126: const xmlChar * xsltGetQNameURI (xmlNodePtr node,
! 127: xmlChar **name);
! 128:
! 129: /*
! 130: * Output, reuse libxml I/O buffers
! 131: */
! 132: int xsltSaveResultTo (xmlOutputBufferPtr buf,
! 133: xmlDocPtr result,
! 134: xsltStylesheetPtr style);
! 135: int xsltSaveResultToFilename (const char *URI,
! 136: xmlDocPtr result,
! 137: xsltStylesheetPtr style,
! 138: int compression);
! 139: int xsltSaveResultToFile (FILE *file,
! 140: xmlDocPtr result,
! 141: xsltStylesheetPtr style);
! 142: int xsltSaveResultToFd (int fd,
! 143: xmlDocPtr result,
! 144: xsltStylesheetPtr style);
! 145:
! 146: /*
! 147: * profiling
! 148: */
! 149: void xsltSaveProfiling (xsltTransformContextPtr ctxt,
! 150: FILE *output);
! 151:
! 152: long xsltTimestamp (void);
! 153: void xsltCalibrateAdjust (long delta);
! 154:
! 155: #define XSLT_TIMESTAMP_TICS_PER_SEC 100000l
! 156:
! 157: /*
! 158: * Hooks for the debugger
! 159: */
! 160:
! 161: typedef enum {
! 162: XSLT_DEBUG_NONE = 0, /* no debugging allowed */
! 163: XSLT_DEBUG_INIT,
! 164: XSLT_DEBUG_STEP,
! 165: XSLT_DEBUG_STEPOUT,
! 166: XSLT_DEBUG_NEXT,
! 167: XSLT_DEBUG_STOP,
! 168: XSLT_DEBUG_CONT,
! 169: XSLT_DEBUG_RUN,
! 170: XSLT_DEBUG_RUN_RESTART,
! 171: XSLT_DEBUG_QUIT
! 172: } xsltDebugStatusCodes;
! 173:
! 174: LIBXSLT_PUBLIC extern int xslDebugStatus;
! 175:
! 176: typedef void (*xsltHandleDebuggerCallback) (xmlNodePtr cur, xmlNodePtr node,
! 177: xsltTemplatePtr templ, xsltTransformContextPtr ctxt);
! 178: typedef int (*xsltAddCallCallback) (xsltTemplatePtr templ, xmlNodePtr source);
! 179: typedef void (*xsltDropCallCallback) (void);
! 180:
! 181: int xsltSetDebuggerCallbacks (int no, void *block);
! 182: int xslAddCall (xsltTemplatePtr templ,
! 183: xmlNodePtr source);
! 184: void xslDropCall (void);
! 185:
! 186: #ifdef __cplusplus
! 187: }
! 188: #endif
! 189:
! 190: #endif /* __XML_XSLTUTILS_H__ */
! 191:
E-mail: