23 #include "wine/port.h" 31 # ifdef SONAME_LIBXSLT 32 # ifdef HAVE_LIBXSLT_PATTERN_H 35 # ifdef HAVE_LIBXSLT_TRANSFORM_H 56 #include "wine/unicode.h" 105 wine_dbg_log(dbcl, &__wine_dbch_msxml, caller,
"error code %d",
err->code);
113 static int wineXmlMatchCallback (
char const *
filename)
130 static void *wineXmlOpenCallback (
char const *
filename)
155 ERR(
"Failed to read file\n");
159 TRACE(
"Read %d\n", dwBytesRead);
164 static int wineXmlFileCloseCallback (
void *
context)
169 void* libxslt_handle =
NULL;
170 #ifdef SONAME_LIBXSLT 171 # define DECL_FUNCPTR(f) typeof(f) * p##f = NULL 188 static void init_libxslt(
void)
190 #ifdef SONAME_LIBXSLT 197 #define LOAD_FUNCPTR(f, needed) \ 198 if ((p##f = wine_dlsym(libxslt_handle, #f, NULL, 0)) == NULL) \ 199 if (needed) { WARN("Can't find symbol %s\n", #f); goto sym_not_found; } 219 pxsltSetLoaderFunc(xslt_doc_default_loader);
220 pxsltRegisterExtModuleFunction(
222 (
const xmlChar *)
"urn:schemas-microsoft-com:xslt",
223 pxsltFunctionNodeSet);
229 libxslt_handle =
NULL;
233 static int to_utf8(
int cp,
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
238 if (!
in || !inlen)
return 0;
253 static int from_utf8(
int cp,
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
258 if (!
in || !inlen)
return 0;
273 static int win1250_to_utf8(
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
275 return to_utf8(1250,
out, outlen,
in, inlen);
278 static int utf8_to_win1250(
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
280 return from_utf8(1250,
out, outlen,
in, inlen);
283 static int win1251_to_utf8(
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
285 return to_utf8(1251,
out, outlen,
in, inlen);
288 static int utf8_to_win1251(
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
290 return from_utf8(1251,
out, outlen,
in, inlen);
293 static int win1252_to_utf8(
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
295 return to_utf8(1252,
out, outlen,
in, inlen);
298 static int utf8_to_win1252(
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
300 return from_utf8(1252,
out, outlen,
in, inlen);
303 static int win1253_to_utf8(
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
305 return to_utf8(1253,
out, outlen,
in, inlen);
308 static int utf8_to_win1253(
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
310 return from_utf8(1253,
out, outlen,
in, inlen);
312 static int win1254_to_utf8(
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
314 return to_utf8(1254,
out, outlen,
in, inlen);
317 static int utf8_to_win1254(
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
319 return from_utf8(1254,
out, outlen,
in, inlen);
322 static int win1255_to_utf8(
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
324 return to_utf8(1255,
out, outlen,
in, inlen);
327 static int utf8_to_win1255(
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
329 return from_utf8(1255,
out, outlen,
in, inlen);
332 static int win1256_to_utf8(
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
334 return to_utf8(1256,
out, outlen,
in, inlen);
337 static int utf8_to_win1256(
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
339 return from_utf8(1256,
out, outlen,
in, inlen);
342 static int win1257_to_utf8(
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
344 return to_utf8(1257,
out, outlen,
in, inlen);
347 static int utf8_to_win1257(
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
349 return from_utf8(1257,
out, outlen,
in, inlen);
352 static int win1258_to_utf8(
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
354 return to_utf8(1258,
out, outlen,
in, inlen);
357 static int utf8_to_win1258(
unsigned char *
out,
int *outlen,
const unsigned char *
in,
int *inlen)
359 return from_utf8(1258,
out, outlen,
in, inlen);
362 static void init_char_encoders(
void)
371 {
"windows-1250", win1250_to_utf8, utf8_to_win1250 },
372 {
"windows-1251", win1251_to_utf8, utf8_to_win1251 },
373 {
"windows-1252", win1252_to_utf8, utf8_to_win1252 },
374 {
"windows-1253", win1253_to_utf8, utf8_to_win1253 },
375 {
"windows-1254", win1254_to_utf8, utf8_to_win1254 },
376 {
"windows-1255", win1255_to_utf8, utf8_to_win1255 },
377 {
"windows-1256", win1256_to_utf8, utf8_to_win1256 },
378 {
"windows-1257", win1257_to_utf8, utf8_to_win1257 },
379 {
"windows-1258", win1258_to_utf8, utf8_to_win1258 }
421 wineXmlReadCallback, wineXmlFileCloseCallback) == -1)
422 WARN(
"Failed to register callbacks\n");
424 init_char_encoders();
434 #ifdef SONAME_LIBXSLT 437 pxsltCleanupGlobals();
void xsltFreeStylesheet(xsltStylesheetPtr style)
XMLPUBFUN void XMLCALL xmlCleanupInputCallbacks(void)
static UCHAR ULONG UCHAR ULONG UCHAR * output
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
#define WideCharToMultiByte
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
WINE_DEFAULT_DEBUG_CHANNEL(wmic)
xsltStylesheetPtr xsltNextImport(xsltStylesheetPtr cur)
XMLPUBFUN void XMLCALL xmlInitParser(void)
XMLPUBFUN void XMLCALL xmlRegisterDefaultInputCallbacks(void)
XMLPUBFUN const char *XMLCALL xmlThrDefTreeIndentString(const char *v)
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
#define INVALID_HANDLE_VALUE
#define DLL_PROCESS_ATTACH
static void * heap_alloc(size_t len)
int(* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen, const unsigned char *in, int *inlen)
HRESULT WINAPI DllRegisterServer(void)
HRESULT WINAPI DllUnregisterServer(void)
int xsltSaveResultTo(xmlOutputBufferPtr buf, xmlDocPtr result, xsltStylesheetPtr style)
int(* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen, const unsigned char *in, int *inlen)
void * wine_dlopen(const char *filename, int flag, char *error, size_t errorsize)
XMLPUBVAR const char * xmlTreeIndentString
#define DLL_PROCESS_DETACH
int xsltRegisterExtModuleFunction(const xmlChar *name, const xmlChar *URI, xmlXPathFunction function)
void xsltSetLoaderFunc(xsltDocLoaderFunc f)
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL xmlNewCharEncodingHandler(const char *name, xmlCharEncodingInputFunc input, xmlCharEncodingOutputFunc output)
XMLPUBFUN void XMLCALL xmlInitCharEncodingHandlers(void)
void release_typelib(void)
void xsltCleanupGlobals(void)
#define FILE_ATTRIBUTE_NORMAL
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL xmlFindCharEncodingHandler(const char *name)
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
xsltStylesheetPtr xsltParseStylesheetDoc(xmlDocPtr doc)
GLenum GLenum GLenum input
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
int xsltQuoteUserParams(xsltTransformContextPtr ctxt, const char **params)
const char int int wine_dbg_log(enum __wine_debug_class cls, struct __wine_debug_channel *ch, const char *func, const char *format,...) __WINE_PRINTF_ATTR(4
HRESULT WINAPI DllCanUnloadNow(void)
#define ReadFile(a, b, c, d, e)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
#define MultiByteToWideChar
HINSTANCE MSXML_hInstance
void int int ULONGLONG int va_list * ap
XMLPUBFUN void XMLCALL xmlCleanupParser(void)
static unsigned char buff[32768]
int wine_dlclose(void *handle, char *error, size_t errorsize)
static BOOL heap_free(void *mem)
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
XMLPUBFUN int XMLCALL xmlRegisterInputCallbacks(xmlInputMatchCallback matchFunc, xmlInputOpenCallback openFunc, xmlInputReadCallback readFunc, xmlInputCloseCallback closeFunc)