Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
fec2199f
Commit
fec2199f
authored
Oct 27, 2010
by
Adam Martinson
Committed by
Alexandre Julliard
Oct 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: libxml2 error/warning callback functions.
parent
62f9966f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
112 additions
and
10 deletions
+112
-10
domdoc.c
dlls/msxml3/domdoc.c
+45
-8
main.c
dlls/msxml3/main.c
+43
-1
msxml_private.h
dlls/msxml3/msxml_private.h
+17
-0
queryresult.c
dlls/msxml3/queryresult.c
+7
-1
No files found.
dlls/msxml3/domdoc.c
View file @
fec2199f
...
...
@@ -356,6 +356,27 @@ static void sax_characters(void *ctx, const xmlChar *ch, int len)
xmlSAX2Characters
(
ctx
,
ch
,
len
);
}
static
void
LIBXML2_LOG_CALLBACK
sax_error
(
void
*
ctx
,
char
const
*
msg
,
...)
{
va_list
ap
;
va_start
(
ap
,
msg
);
LIBXML2_CALLBACK_ERR
(
doparse
,
msg
,
ap
);
va_end
(
ap
);
}
static
void
LIBXML2_LOG_CALLBACK
sax_warning
(
void
*
ctx
,
char
const
*
msg
,
...)
{
va_list
ap
;
va_start
(
ap
,
msg
);
LIBXML2_CALLBACK_WARN
(
doparse
,
msg
,
ap
);
va_end
(
ap
);
}
static
void
sax_serror
(
void
*
ctx
,
xmlErrorPtr
err
)
{
LIBXML2_CALLBACK_SERROR
(
doparse
,
err
);
}
static
xmlDocPtr
doparse
(
domdoc
*
This
,
char
*
ptr
,
int
len
,
xmlChar
const
*
encoding
)
{
xmlDocPtr
doc
=
NULL
;
...
...
@@ -382,9 +403,9 @@ static xmlDocPtr doparse(domdoc* This, char *ptr, int len, xmlChar const* encodi
sax_characters
,
/* ignorableWhitespace */
xmlSAX2ProcessingInstruction
,
/* processingInstruction */
xmlSAX2Comment
,
/* comment */
NULL
,
/* TODO:
warning */
NULL
,
/* TODO:
error */
NULL
,
/* TODO:
fatalError */
sax_warning
,
/*
warning */
sax_error
,
/*
error */
sax_error
,
/*
fatalError */
xmlSAX2GetParameterEntity
,
/* getParameterEntity */
xmlSAX2CDataBlock
,
/* cdataBlock */
xmlSAX2ExternalSubset
,
/* externalSubset */
...
...
@@ -392,7 +413,7 @@ static xmlDocPtr doparse(domdoc* This, char *ptr, int len, xmlChar const* encodi
NULL
,
/* _private */
xmlSAX2StartElementNs
,
/* startElementNs */
xmlSAX2EndElementNs
,
/* endElementNs */
NULL
/* TODO:
serror */
sax_serror
/*
serror */
};
xmlInitParser
();
...
...
@@ -403,9 +424,9 @@ static xmlDocPtr doparse(domdoc* This, char *ptr, int len, xmlChar const* encodi
return
NULL
;
}
if
(
pctx
->
sax
)
xmlFree
(
pctx
->
sax
);
if
(
pctx
->
sax
)
xmlFree
(
pctx
->
sax
);
pctx
->
sax
=
&
sax_handler
;
pctx
->
_private
=
This
;
pctx
->
_private
=
This
;
pctx
->
recovery
=
0
;
pctx
->
encoding
=
xmlStrdup
(
encoding
);
xmlParseDocument
(
pctx
);
...
...
@@ -2417,6 +2438,22 @@ static HRESULT WINAPI domdoc_putref_schemas(
return
hr
;
}
static
void
LIBXML2_LOG_CALLBACK
validate_error
(
void
*
ctx
,
char
const
*
msg
,
...)
{
va_list
ap
;
va_start
(
ap
,
msg
);
LIBXML2_CALLBACK_ERR
(
domdoc_validate
,
msg
,
ap
);
va_end
(
ap
);
}
static
void
LIBXML2_LOG_CALLBACK
validate_warning
(
void
*
ctx
,
char
const
*
msg
,
...)
{
va_list
ap
;
va_start
(
ap
,
msg
);
LIBXML2_CALLBACK_WARN
(
domdoc_validate
,
msg
,
ap
);
va_end
(
ap
);
}
static
HRESULT
WINAPI
domdoc_validate
(
IXMLDOMDocument3
*
iface
,
IXMLDOMParseError
**
err
)
...
...
@@ -2435,8 +2472,8 @@ static HRESULT WINAPI domdoc_validate(
}
vctx
=
xmlNewValidCtxt
();
vctx
->
error
=
NULL
;
/* TODO: error callback */
vctx
->
warning
=
NULL
;
/* TODO: warning callback */
vctx
->
error
=
validate_error
;
vctx
->
warning
=
validate_warning
;
if
(
xmlValidateDocument
(
vctx
,
get_doc
(
This
)))
{
...
...
dlls/msxml3/main.c
View file @
fec2199f
...
...
@@ -42,6 +42,48 @@ WINE_DEFAULT_DEBUG_CHANNEL(msxml);
#ifdef HAVE_LIBXML2
void
wineXmlCallbackLog
(
char
const
*
caller
,
xmlErrorLevel
lvl
,
char
const
*
msg
,
va_list
ap
)
{
char
*
buf
=
NULL
;
int
len
=
32
,
needed
;
enum
__wine_debug_class
dbcl
=
__WINE_DBCL_ERR
;
switch
(
lvl
)
{
case
XML_ERR_NONE
:
dbcl
=
__WINE_DBCL_TRACE
;
break
;
case
XML_ERR_WARNING
:
dbcl
=
__WINE_DBCL_WARN
;
break
;
default:
break
;
}
if
(
ap
)
{
do
{
heap_free
(
buf
);
buf
=
heap_alloc
(
len
);
needed
=
vsnprintf
(
buf
,
len
,
msg
,
ap
);
if
(
needed
==
-
1
)
len
*=
2
;
else
if
(
needed
>=
len
)
len
=
needed
+
1
;
else
needed
=
0
;
}
while
(
needed
);
wine_dbg_log
(
dbcl
,
&
__wine_dbch_msxml
,
caller
,
buf
);
heap_free
(
buf
);
}
else
{
wine_dbg_log
(
dbcl
,
&
__wine_dbch_msxml
,
caller
,
msg
);
}
}
/* Support for loading xml files from a Wine Windows drive */
static
int
wineXmlMatchCallback
(
char
const
*
filename
)
{
...
...
@@ -115,7 +157,7 @@ DECL_FUNCPTR(xsltApplyStylesheet);
DECL_FUNCPTR
(
xsltCleanupGlobals
);
DECL_FUNCPTR
(
xsltFreeStylesheet
);
DECL_FUNCPTR
(
xsltParseStylesheetDoc
);
# undef
MAKE
_FUNCPTR
# undef
DECL
_FUNCPTR
#endif
static
void
init_libxslt
(
void
)
...
...
dlls/msxml3/msxml_private.h
View file @
fec2199f
...
...
@@ -106,6 +106,8 @@ BOOL dispex_query_interface(DispatchEx*,REFIID,void**);
#include <libxml/parser.h>
#endif
#include <libxml/xmlerror.h>
/* constructors */
extern
IUnknown
*
create_domdoc
(
xmlNodePtr
document
);
extern
IUnknown
*
create_xmldoc
(
void
);
...
...
@@ -140,6 +142,21 @@ extern xmlNodePtr xmldoc_unlink_xmldecl(xmlDocPtr doc);
extern
HRESULT
XMLElement_create
(
IUnknown
*
pUnkOuter
,
xmlNodePtr
node
,
LPVOID
*
ppObj
,
BOOL
own
);
extern
void
wineXmlCallbackLog
(
char
const
*
caller
,
xmlErrorLevel
lvl
,
char
const
*
msg
,
va_list
ap
);
#define LIBXML2_LOG_CALLBACK __WINE_PRINTF_ATTR(2,3)
#define LIBXML2_CALLBACK_TRACE(caller, msg, ap) \
wineXmlCallbackLog(#caller, XML_ERR_NONE, msg, ap)
#define LIBXML2_CALLBACK_WARN(caller, msg, ap) \
wineXmlCallbackLog(#caller, XML_ERR_WARNING, msg, ap)
#define LIBXML2_CALLBACK_ERR(caller, msg, ap) \
wineXmlCallbackLog(#caller, XML_ERR_ERROR, msg, ap)
#define LIBXML2_CALLBACK_SERROR(caller, err) \
wineXmlCallbackLog(#caller, err->level, err->message, NULL)
/* IXMLDOMNode Internal Structure */
typedef
struct
_xmlnode
...
...
dlls/msxml3/queryresult.c
View file @
fec2199f
...
...
@@ -491,6 +491,11 @@ void XSLPattern_OP_IGEq(xmlXPathParserContextPtr pctx, int nargs)
xmlFree
(
arg2
);
}
static
void
query_serror
(
void
*
ctx
,
xmlErrorPtr
err
)
{
LIBXML2_CALLBACK_SERROR
(
queryresult_create
,
err
);
}
HRESULT
queryresult_create
(
xmlNodePtr
node
,
LPCWSTR
szQuery
,
IXMLDOMNodeList
**
out
)
{
queryresult
*
This
=
heap_alloc_zero
(
sizeof
(
queryresult
));
...
...
@@ -513,6 +518,7 @@ HRESULT queryresult_create(xmlNodePtr node, LPCWSTR szQuery, IXMLDOMNodeList **o
This
->
node
=
node
;
xmldoc_add_ref
(
This
->
node
->
doc
);
ctxt
->
error
=
query_serror
;
ctxt
->
node
=
node
;
registerNamespaces
(
ctxt
);
...
...
@@ -545,7 +551,7 @@ HRESULT queryresult_create(xmlNodePtr node, LPCWSTR szQuery, IXMLDOMNodeList **o
xmlXPathRegisterFunc
(
ctxt
,
(
xmlChar
const
*
)
"OP_IGEq"
,
XSLPattern_OP_IGEq
);
}
This
->
result
=
xmlXPathEval
(
str
,
ctxt
);
This
->
result
=
xmlXPathEval
Expression
(
str
,
ctxt
);
if
(
!
This
->
result
||
This
->
result
->
type
!=
XPATH_NODESET
)
{
hr
=
E_FAIL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment