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
67c07ff4
Commit
67c07ff4
authored
Nov 17, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite: Store reader input impl pointer in reader structure.
parent
6f7624f5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
25 deletions
+25
-25
reader.c
dlls/xmllite/reader.c
+25
-25
No files found.
dlls/xmllite/reader.c
View file @
67c07ff4
...
@@ -64,17 +64,6 @@ typedef struct
...
@@ -64,17 +64,6 @@ typedef struct
unsigned
int
written
;
unsigned
int
written
;
}
encoded_buffer
;
}
encoded_buffer
;
typedef
struct
_xmlreader
{
IXmlReader
IXmlReader_iface
;
LONG
ref
;
IXmlReaderInput
*
input
;
IMalloc
*
imalloc
;
XmlReadState
state
;
DtdProcessing
dtdmode
;
UINT
line
,
pos
;
/* reader position in XML stream */
}
xmlreader
;
typedef
struct
input_buffer
input_buffer
;
typedef
struct
input_buffer
input_buffer
;
typedef
struct
_xmlreaderinput
typedef
struct
_xmlreaderinput
...
@@ -91,6 +80,17 @@ typedef struct _xmlreaderinput
...
@@ -91,6 +80,17 @@ typedef struct _xmlreaderinput
input_buffer
*
buffer
;
input_buffer
*
buffer
;
}
xmlreaderinput
;
}
xmlreaderinput
;
typedef
struct
_xmlreader
{
IXmlReader
IXmlReader_iface
;
LONG
ref
;
xmlreaderinput
*
input
;
IMalloc
*
imalloc
;
XmlReadState
state
;
DtdProcessing
dtdmode
;
UINT
line
,
pos
;
/* reader position in XML stream */
}
xmlreader
;
struct
input_buffer
struct
input_buffer
{
{
encoded_buffer
utf16
;
encoded_buffer
utf16
;
...
@@ -226,27 +226,24 @@ static void free_input_buffer(input_buffer *buffer)
...
@@ -226,27 +226,24 @@ static void free_input_buffer(input_buffer *buffer)
readerinput_free
(
buffer
->
input
,
buffer
);
readerinput_free
(
buffer
->
input
,
buffer
);
}
}
static
void
xmlreaderinput_release_stream
(
IXmlReaderInput
*
iface
)
static
void
xmlreaderinput_release_stream
(
xmlreaderinput
*
readerinput
)
{
{
xmlreaderinput
*
This
=
impl_from_IXmlReaderInput
(
iface
);
if
(
readerinput
->
stream
)
{
ISequentialStream_Release
(
readerinput
->
stream
);
if
(
This
->
stream
)
{
readerinput
->
stream
=
NULL
;
ISequentialStream_Release
(
This
->
stream
);
This
->
stream
=
NULL
;
}
}
}
}
/* Queries already stored interface for IStream/ISequentialStream.
/* Queries already stored interface for IStream/ISequentialStream.
Interface supplied on creation will be overwritten */
Interface supplied on creation will be overwritten */
static
HRESULT
xmlreaderinput_query_for_stream
(
IXmlReaderInput
*
iface
)
static
HRESULT
xmlreaderinput_query_for_stream
(
xmlreaderinput
*
readerinput
)
{
{
xmlreaderinput
*
This
=
impl_from_IXmlReaderInput
(
iface
);
HRESULT
hr
;
HRESULT
hr
;
xmlreaderinput_release_stream
(
iface
);
xmlreaderinput_release_stream
(
readerinput
);
hr
=
IUnknown_QueryInterface
(
This
->
input
,
&
IID_IStream
,
(
void
**
)
&
This
->
stream
);
hr
=
IUnknown_QueryInterface
(
readerinput
->
input
,
&
IID_IStream
,
(
void
**
)
&
readerinput
->
stream
);
if
(
hr
!=
S_OK
)
if
(
hr
!=
S_OK
)
hr
=
IUnknown_QueryInterface
(
This
->
input
,
&
IID_ISequentialStream
,
(
void
**
)
&
This
->
stream
);
hr
=
IUnknown_QueryInterface
(
readerinput
->
input
,
&
IID_ISequentialStream
,
(
void
**
)
&
readerinput
->
stream
);
return
hr
;
return
hr
;
}
}
...
@@ -291,7 +288,7 @@ static ULONG WINAPI xmlreader_Release(IXmlReader *iface)
...
@@ -291,7 +288,7 @@ static ULONG WINAPI xmlreader_Release(IXmlReader *iface)
if
(
ref
==
0
)
if
(
ref
==
0
)
{
{
IMalloc
*
imalloc
=
This
->
imalloc
;
IMalloc
*
imalloc
=
This
->
imalloc
;
if
(
This
->
input
)
IUnknown_Release
(
This
->
input
);
if
(
This
->
input
)
IUnknown_Release
(
&
This
->
input
->
IXmlReaderInput_iface
);
reader_free
(
This
,
This
);
reader_free
(
This
,
This
);
if
(
imalloc
)
IMalloc_Release
(
imalloc
);
if
(
imalloc
)
IMalloc_Release
(
imalloc
);
}
}
...
@@ -309,7 +306,7 @@ static HRESULT WINAPI xmlreader_SetInput(IXmlReader* iface, IUnknown *input)
...
@@ -309,7 +306,7 @@ static HRESULT WINAPI xmlreader_SetInput(IXmlReader* iface, IUnknown *input)
if
(
This
->
input
)
if
(
This
->
input
)
{
{
xmlreaderinput_release_stream
(
This
->
input
);
xmlreaderinput_release_stream
(
This
->
input
);
IUnknown_Release
(
This
->
input
);
IUnknown_Release
(
&
This
->
input
->
IXmlReaderInput_iface
);
This
->
input
=
NULL
;
This
->
input
=
NULL
;
}
}
...
@@ -326,10 +323,13 @@ static HRESULT WINAPI xmlreader_SetInput(IXmlReader* iface, IUnknown *input)
...
@@ -326,10 +323,13 @@ static HRESULT WINAPI xmlreader_SetInput(IXmlReader* iface, IUnknown *input)
hr
=
IUnknown_QueryInterface
(
input
,
&
IID_IXmlReaderInput
,
(
void
**
)
&
This
->
input
);
hr
=
IUnknown_QueryInterface
(
input
,
&
IID_IXmlReaderInput
,
(
void
**
)
&
This
->
input
);
if
(
hr
!=
S_OK
)
if
(
hr
!=
S_OK
)
{
{
IXmlReaderInput
*
readerinput
;
/* create IXmlReaderInput basing on supplied interface */
/* create IXmlReaderInput basing on supplied interface */
hr
=
CreateXmlReaderInputWithEncodingName
(
input
,
hr
=
CreateXmlReaderInputWithEncodingName
(
input
,
NULL
,
NULL
,
FALSE
,
NULL
,
&
This
->
input
);
NULL
,
NULL
,
FALSE
,
NULL
,
&
reader
input
);
if
(
hr
!=
S_OK
)
return
hr
;
if
(
hr
!=
S_OK
)
return
hr
;
This
->
input
=
impl_from_IXmlReaderInput
(
readerinput
);
}
}
/* set stream for supplied IXmlReaderInput */
/* set stream for supplied IXmlReaderInput */
...
...
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