Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c52e0919
Commit
c52e0919
authored
Jul 31, 2008
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 01, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Prepare libxml2 callbacks for IVBSAX... interfaces implementation.
parent
cafbf853
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
22 deletions
+72
-22
saxreader.c
dlls/msxml3/saxreader.c
+72
-22
No files found.
dlls/msxml3/saxreader.c
View file @
c52e0919
...
...
@@ -52,7 +52,9 @@ typedef struct _saxreader
const
struct
ISAXXMLReaderVtbl
*
lpSAXXMLReaderVtbl
;
LONG
ref
;
struct
ISAXContentHandler
*
contentHandler
;
struct
IVBSAXContentHandler
*
vbcontentHandler
;
struct
ISAXErrorHandler
*
errorHandler
;
struct
IVBSAXErrorHandler
*
vberrorHandler
;
xmlSAXHandler
sax
;
}
saxreader
;
...
...
@@ -69,6 +71,7 @@ typedef struct _saxlocator
xmlChar
*
lastCur
;
int
line
;
int
column
;
BOOL
vbInterface
;
}
saxlocator
;
typedef
struct
_saxattributes
...
...
@@ -152,8 +155,15 @@ static void format_error_message_from_id(saxlocator *This, HRESULT hr)
msg
[
0
]
=
'\0'
;
}
ISAXErrorHandler_fatalError
(
This
->
saxreader
->
errorHandler
,
(
ISAXLocator
*
)
&
This
->
lpSAXLocatorVtbl
,
msg
,
hr
);
if
(
This
->
vbInterface
)
{
BSTR
bstrMsg
=
SysAllocString
(
msg
);
IVBSAXErrorHandler_fatalError
(
This
->
saxreader
->
vberrorHandler
,
(
IVBSAXLocator
*
)
&
This
->
lpVBSAXLocatorVtbl
,
&
bstrMsg
,
hr
);
}
else
ISAXErrorHandler_fatalError
(
This
->
saxreader
->
errorHandler
,
(
ISAXLocator
*
)
&
This
->
lpSAXLocatorVtbl
,
msg
,
hr
);
}
}
...
...
@@ -848,7 +858,11 @@ static void libxmlStartDocument(void *ctx)
if
(
This
->
saxreader
->
contentHandler
)
{
hr
=
ISAXContentHandler_startDocument
(
This
->
saxreader
->
contentHandler
);
if
(
This
->
vbInterface
)
hr
=
IVBSAXContentHandler_startDocument
(
This
->
saxreader
->
vbcontentHandler
);
else
hr
=
ISAXContentHandler_startDocument
(
This
->
saxreader
->
contentHandler
);
if
(
hr
!=
S_OK
)
format_error_message_from_id
(
This
,
hr
);
}
...
...
@@ -868,7 +882,11 @@ static void libxmlEndDocument(void *ctx)
if
(
This
->
saxreader
->
contentHandler
)
{
hr
=
ISAXContentHandler_endDocument
(
This
->
saxreader
->
contentHandler
);
if
(
This
->
vbInterface
)
hr
=
IVBSAXContentHandler_endDocument
(
This
->
saxreader
->
vbcontentHandler
);
else
hr
=
ISAXContentHandler_endDocument
(
This
->
saxreader
->
contentHandler
);
if
(
hr
!=
S_OK
)
format_error_message_from_id
(
This
,
hr
);
}
...
...
@@ -901,12 +919,18 @@ static void libxmlStartElementNS(
hr
=
SAXAttributes_create
(
&
attr
,
nb_attributes
,
attributes
);
if
(
hr
==
S_OK
)
{
hr
=
ISAXContentHandler_startElement
(
This
->
saxreader
->
contentHandler
,
NamespaceUri
,
SysStringLen
(
NamespaceUri
),
LocalName
,
SysStringLen
(
LocalName
),
QName
,
SysStringLen
(
QName
),
(
ISAXAttributes
*
)
&
attr
->
lpSAXAttributesVtbl
);
if
(
This
->
vbInterface
)
hr
=
IVBSAXContentHandler_startElement
(
This
->
saxreader
->
vbcontentHandler
,
&
NamespaceUri
,
&
LocalName
,
&
QName
,
(
IVBSAXAttributes
*
)
&
attr
->
lpVBSAXAttributesVtbl
);
else
hr
=
ISAXContentHandler_startElement
(
This
->
saxreader
->
contentHandler
,
NamespaceUri
,
SysStringLen
(
NamespaceUri
),
LocalName
,
SysStringLen
(
LocalName
),
QName
,
SysStringLen
(
QName
),
(
ISAXAttributes
*
)
&
attr
->
lpSAXAttributesVtbl
);
ISAXAttributes_Release
((
ISAXAttributes
*
)
&
attr
->
lpSAXAttributesVtbl
);
}
...
...
@@ -941,11 +965,16 @@ static void libxmlEndElementNS(
LocalName
=
bstr_from_xmlChar
(
localname
);
QName
=
bstr_from_xmlChar
(
localname
);
hr
=
ISAXContentHandler_endElement
(
This
->
saxreader
->
contentHandler
,
NamespaceUri
,
SysStringLen
(
NamespaceUri
),
LocalName
,
SysStringLen
(
LocalName
),
QName
,
SysStringLen
(
QName
));
if
(
This
->
vbInterface
)
hr
=
IVBSAXContentHandler_endElement
(
This
->
saxreader
->
vbcontentHandler
,
&
NamespaceUri
,
&
LocalName
,
&
QName
);
else
hr
=
ISAXContentHandler_endElement
(
This
->
saxreader
->
contentHandler
,
NamespaceUri
,
SysStringLen
(
NamespaceUri
),
LocalName
,
SysStringLen
(
LocalName
),
QName
,
SysStringLen
(
QName
));
SysFreeString
(
NamespaceUri
);
SysFreeString
(
LocalName
);
...
...
@@ -1011,7 +1040,14 @@ static void libxmlCharacters(
}
else
if
(
*
end
==
'\r'
)
Chars
[
end
-
This
->
lastCur
]
=
'\n'
;
hr
=
ISAXContentHandler_characters
(
This
->
saxreader
->
contentHandler
,
Chars
,
end
-
This
->
lastCur
+
1
);
if
(
This
->
vbInterface
)
hr
=
IVBSAXContentHandler_characters
(
This
->
saxreader
->
vbcontentHandler
,
&
Chars
);
else
hr
=
ISAXContentHandler_characters
(
This
->
saxreader
->
contentHandler
,
Chars
,
end
-
This
->
lastCur
+
1
);
SysFreeString
(
Chars
);
if
(
hr
!=
S_OK
)
{
...
...
@@ -1040,8 +1076,14 @@ static void libxmlSetDocumentLocator(
saxlocator
*
This
=
ctx
;
HRESULT
hr
;
hr
=
ISAXContentHandler_putDocumentLocator
(
This
->
saxreader
->
contentHandler
,
(
ISAXLocator
*
)
&
This
->
lpSAXLocatorVtbl
);
if
(
This
->
vbInterface
)
hr
=
IVBSAXContentHandler_putref_documentLocator
(
This
->
saxreader
->
vbcontentHandler
,
(
IVBSAXLocator
*
)
&
This
->
lpVBSAXLocatorVtbl
);
else
hr
=
ISAXContentHandler_putDocumentLocator
(
This
->
saxreader
->
contentHandler
,
(
ISAXLocator
*
)
&
This
->
lpSAXLocatorVtbl
);
if
(
FAILED
(
hr
))
format_error_message_from_id
(
This
,
hr
);
...
...
@@ -1072,8 +1114,15 @@ void libxmlFatalError(void *ctx, const char *msg, ...)
wszError
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
len
);
MultiByteToWideChar
(
CP_ACP
,
0
,
message
,
-
1
,
(
LPWSTR
)
wszError
,
len
);
ISAXErrorHandler_fatalError
(
This
->
saxreader
->
errorHandler
,
(
ISAXLocator
*
)
&
This
->
lpSAXLocatorVtbl
,
wszError
,
E_FAIL
);
if
(
This
->
vbInterface
)
{
BSTR
bstrError
=
SysAllocString
(
wszError
);
IVBSAXErrorHandler_fatalError
(
This
->
saxreader
->
vberrorHandler
,
(
IVBSAXLocator
*
)
&
This
->
lpVBSAXLocatorVtbl
,
&
bstrError
,
E_FAIL
);
}
else
ISAXErrorHandler_fatalError
(
This
->
saxreader
->
errorHandler
,
(
ISAXLocator
*
)
&
This
->
lpSAXLocatorVtbl
,
wszError
,
E_FAIL
);
HeapFree
(
GetProcessHeap
(),
0
,
wszError
);
...
...
@@ -1213,7 +1262,7 @@ static const struct ISAXLocatorVtbl isaxlocator_vtbl =
isaxlocator_getSystemId
};
static
HRESULT
SAXLocator_create
(
saxreader
*
reader
,
saxlocator
**
ppsaxlocator
)
static
HRESULT
SAXLocator_create
(
saxreader
*
reader
,
saxlocator
**
ppsaxlocator
,
BOOL
vbInterface
)
{
saxlocator
*
locator
;
...
...
@@ -1223,6 +1272,7 @@ static HRESULT SAXLocator_create(saxreader *reader, saxlocator **ppsaxlocator)
locator
->
lpSAXLocatorVtbl
=
&
isaxlocator_vtbl
;
locator
->
ref
=
1
;
locator
->
vbInterface
=
vbInterface
;
locator
->
saxreader
=
reader
;
ISAXXMLReader_AddRef
((
ISAXXMLReader
*
)
&
reader
->
lpSAXXMLReaderVtbl
);
...
...
@@ -1814,7 +1864,7 @@ static HRESULT parse_buffer(saxreader *This, const char *buffer, int size)
saxlocator
*
locator
;
HRESULT
hr
;
hr
=
SAXLocator_create
(
This
,
&
locator
);
hr
=
SAXLocator_create
(
This
,
&
locator
,
FALSE
);
if
(
FAILED
(
hr
))
return
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