winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
December 2011
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
810 discussions
Start a n
N
ew thread
Nikolay Sivov : msxml3: Properly handle writer output in a form of BSTR.
by Alexandre Julliard
09 Dec '11
09 Dec '11
Module: wine Branch: master Commit: b0f704daaf633d8c713c9212a2ab5dd8a4457e7a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b0f704daaf633d8c713c9212a…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Dec 9 21:34:27 2011 +0300 msxml3: Properly handle writer output in a form of BSTR. --- dlls/msxml3/mxwriter.c | 87 ++++++++++++++++++++++++++--------------- dlls/msxml3/tests/saxreader.c | 13 +++++- 2 files changed, 65 insertions(+), 35 deletions(-) diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c index f4e2960..febabe1 100644 --- a/dlls/msxml3/mxwriter.c +++ b/dlls/msxml3/mxwriter.c @@ -78,8 +78,8 @@ typedef struct _mxwriter IStream *dest; ULONG dest_written; - INT decl_count; /* practically how many times startDocument was called */ - INT decl_written; /* byte length of document prolog */ + int decl_count; /* practically how many times startDocument was called */ + int decl_written; /* byte length of document prolog */ xmlOutputBufferPtr buffer; } mxwriter; @@ -385,11 +385,6 @@ static HRESULT WINAPI mxwriter_put_output(IMXWriter *iface, VARIANT dest) { if (This->dest) IStream_Release(This->dest); This->dest = NULL; - - /* We need to reset the output buffer to UTF-16, since the only way - * the content of the mxwriter can be accessed now is through a BSTR. - */ - This->encoding = xmlParseCharEncoding("UTF-16"); reset_output_buffer(This); break; } @@ -427,48 +422,76 @@ static HRESULT WINAPI mxwriter_get_output(IMXWriter *iface, VARIANT *dest) if (!This->dest) { - BSTR output; + xmlOutputBufferPtr prolog; + BSTR output, body = NULL; + xmlBufferPtr buffer; + WCHAR *ptr; HRESULT hr; + int i; hr = flush_output_buffer(This); if (FAILED(hr)) return hr; - /* TODO: Windows always seems to re-encode the XML to UTF-16 (this includes - * updating the XML decl so it says "UTF-16" instead of "UTF-8"). We don't - * support this yet... - */ - if (This->encoding == XML_CHAR_ENCODING_UTF8) { - FIXME("XML re-encoding not supported yet\n"); - return E_NOTIMPL; + if (This->decl_count) + { + prolog = xmlAllocOutputBuffer(xmlGetCharEncodingHandler(xmlParseCharEncoding("UTF-16"))); + write_prolog_buffer(This, xmlParseCharEncoding("UTF-16"), prolog); } + else + prolog = NULL; - if (This->decl_count) + /* optimize some paticular cases */ + /* 1. no prolog and UTF-8 buffer */ + if (This->encoding == XML_CHAR_ENCODING_UTF8 && !prolog) { - xmlOutputBufferPtr prolog; - INT i = This->decl_count; - WCHAR *ptr; + V_VT(dest) = VT_BSTR; + V_BSTR(dest) = bstr_from_xmlChar(This->buffer->buffer->content); + return S_OK; + } - prolog = xmlAllocOutputBuffer(xmlGetCharEncodingHandler(xmlParseCharEncoding("UTF-16"))); + /* 2. no prolog and UTF-16 buffer */ + if (!prolog) + { + V_VT(dest) = VT_BSTR; + V_BSTR(dest) = SysAllocStringLen((const WCHAR*)This->buffer->conv->content, + This->buffer->conv->use/sizeof(WCHAR)); + return S_OK; + } - write_prolog_buffer(This, xmlParseCharEncoding("UTF-16"), prolog); + V_BSTR(dest) = NULL; + if (This->encoding == XML_CHAR_ENCODING_UTF8) + { + buffer = This->buffer->buffer; + body = bstr_from_xmlChar(buffer->content+This->decl_written); ptr = output = SysAllocStringByteLen(NULL, prolog->conv->use*This->decl_count + - This->buffer->conv->use-This->decl_written); - while (i--) - { - memcpy(ptr, prolog->conv->content, prolog->conv->use); - ptr += prolog->conv->use/sizeof(WCHAR); - } - - memcpy(ptr, This->buffer->conv->content + This->decl_written, This->buffer->conv->use-This->decl_written); - xmlOutputBufferClose(prolog); + SysStringByteLen(body)); } else { - output = SysAllocStringLen((const WCHAR*)This->buffer->conv->content, - This->buffer->conv->use/sizeof(WCHAR)); + buffer = This->buffer->conv; + ptr = output = SysAllocStringByteLen(NULL, prolog->conv->use*This->decl_count + + buffer->use - This->decl_written); + } + + /* write prolog part */ + i = This->decl_count; + while (i--) + { + memcpy(ptr, prolog->conv->content, prolog->conv->use); + ptr += prolog->conv->use/sizeof(WCHAR); + } + xmlOutputBufferClose(prolog); + + /* write main part */ + if (body) + { + memcpy(ptr, body, SysStringByteLen(body)); + SysFreeString(body); } + else + memcpy(ptr, buffer->content + This->decl_written, buffer->use-This->decl_written); V_VT(dest) = VT_BSTR; V_BSTR(dest) = output; diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index 0fac3dd..d713fd3 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -2303,6 +2303,13 @@ static void test_mxwriter_startendelement(void) hr = IMXWriter_put_output(writer, dest); EXPECT_HR(hr, S_OK); + V_VT(&dest) = VT_EMPTY; + hr = IMXWriter_get_output(writer, &dest); + EXPECT_HR(hr, S_OK); + ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); + ok(!lstrcmpW(_bstr_(""), V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); + VariantClear(&dest); + hr = ISAXContentHandler_startDocument(content); EXPECT_HR(hr, S_OK); @@ -2615,9 +2622,9 @@ static void test_mxwriter_encoding(void) */ V_VT(&dest) = VT_EMPTY; hr = IMXWriter_get_output(writer, &dest); - todo_wine ok(hr == S_OK, "get_output failed: %08x\n", hr); - todo_wine ok(V_VT(&dest) == VT_BSTR, "Expected VT_BSTR, got %d\n", V_VT(&dest)); - if (V_VT(&dest) == VT_BSTR) todo_wine ok(!lstrcmpW(_bstr_("<?xml version=\"1.0\" encoding=\"UTF-16\" standalone=\"no\"?>\r\n"), V_BSTR(&dest)), + EXPECT_HR(hr, S_OK); + ok(V_VT(&dest) == VT_BSTR, "Expected VT_BSTR, got %d\n", V_VT(&dest)); + ok(!lstrcmpW(_bstr_("<?xml version=\"1.0\" encoding=\"UTF-16\" standalone=\"no\"?>\r\n"), V_BSTR(&dest)), "got wrong content: %s\n", wine_dbgstr_w(V_BSTR(&dest))); VariantClear(&dest);
1
0
0
0
Nikolay Sivov : msxml3: Write document prolog separately.
by Alexandre Julliard
09 Dec '11
09 Dec '11
Module: wine Branch: master Commit: 197d41156a1a237eb2073524ec36006d6a26ceaa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=197d41156a1a237eb2073524e…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Dec 9 18:24:46 2011 +0300 msxml3: Write document prolog separately. --- dlls/msxml3/mxwriter.c | 135 ++++++++++++++++++++++++++++++++++-------------- 1 files changed, 96 insertions(+), 39 deletions(-) diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c index 049ca3d..f4e2960 100644 --- a/dlls/msxml3/mxwriter.c +++ b/dlls/msxml3/mxwriter.c @@ -78,6 +78,9 @@ typedef struct _mxwriter IStream *dest; ULONG dest_written; + INT decl_count; /* practically how many times startDocument was called */ + INT decl_written; /* byte length of document prolog */ + xmlOutputBufferPtr buffer; } mxwriter; @@ -103,14 +106,58 @@ static HRESULT bstr_from_xmlCharEncoding(xmlCharEncoding enc, BSTR *encoding) return *encoding ? S_OK : E_OUTOFMEMORY; } +/* creates UTF-8 encoded prolog string with specified or store encoding value */ +static int write_prolog_buffer(const mxwriter *This, xmlCharEncoding enc, xmlOutputBufferPtr buffer) +{ + static const char version[] = "<?xml version=\""; + static const char encoding[] = " encoding=\""; + static const char standalone[] = " standalone=\""; + static const char yes[] = "yes\"?>"; + static const char no[] = "no\"?>"; + xmlBufferPtr buf; + xmlChar *s; + int use; + + if (enc == XML_CHAR_ENCODING_UTF8) + buf = buffer->buffer; + else + buf = buffer->conv; + + use = buf->use; + + /* version */ + xmlOutputBufferWrite(buffer, sizeof(version)-1, version); + s = xmlchar_from_wchar(This->version); + xmlOutputBufferWriteString(buffer, (char*)s); + heap_free(s); + xmlOutputBufferWrite(buffer, 1, "\""); + + /* encoding */ + xmlOutputBufferWrite(buffer, sizeof(encoding)-1, encoding); + xmlOutputBufferWriteString(buffer, xmlGetCharEncodingName(enc)); + xmlOutputBufferWrite(buffer, 1, "\""); + + /* standalone */ + xmlOutputBufferWrite(buffer, sizeof(standalone)-1, standalone); + if (This->props[MXWriter_Standalone] == VARIANT_TRUE) + xmlOutputBufferWrite(buffer, sizeof(yes)-1, yes); + else + xmlOutputBufferWrite(buffer, sizeof(no)-1, no); + + xmlOutputBufferWrite(buffer, sizeof(crlfA)-1, crlfA); + xmlOutputBufferFlush(buffer); + + return buf->use - use; +} + /* Attempts to the write data from the mxwriter's buffer to * the destination stream (if there is one). */ static HRESULT write_data_to_stream(mxwriter *This) { - HRESULT hres; + xmlBufferPtr buffer; ULONG written = 0; - xmlBufferPtr buffer = NULL; + HRESULT hr; if (!This->dest) return S_OK; @@ -137,15 +184,15 @@ static HRESULT write_data_to_stream(mxwriter *This) * TODO: Check what Windows does if the IStream doesn't write all of * the data we give it at once. */ - hres = IStream_Write(This->dest, buffer->content+This->dest_written, + hr = IStream_Write(This->dest, buffer->content+This->dest_written, buffer->use-This->dest_written, &written); - if (FAILED(hres)) { - WARN("Failed to write data to IStream (%08x)\n", hres); - return hres; + if (FAILED(hr)) { + WARN("Failed to write data to IStream (0x%08x)\n", hr); + return hr; } This->dest_written += written; - return hres; + return hr; } static void write_output_buffer(const mxwriter *This, const char *data, int len) @@ -189,6 +236,8 @@ static inline void reset_output_buffer(mxwriter *This) xmlOutputBufferClose(This->buffer); This->buffer = xmlAllocOutputBuffer(xmlGetCharEncodingHandler(This->encoding)); This->dest_written = 0; + This->decl_count = 0; + This->decl_written = 0; } static HRESULT writer_set_property(mxwriter *writer, MXWRITER_PROPS property, VARIANT_BOOL value) @@ -378,7 +427,10 @@ static HRESULT WINAPI mxwriter_get_output(IMXWriter *iface, VARIANT *dest) if (!This->dest) { - HRESULT hr = flush_output_buffer(This); + BSTR output; + HRESULT hr; + + hr = flush_output_buffer(This); if (FAILED(hr)) return hr; @@ -391,9 +443,35 @@ static HRESULT WINAPI mxwriter_get_output(IMXWriter *iface, VARIANT *dest) return E_NOTIMPL; } + if (This->decl_count) + { + xmlOutputBufferPtr prolog; + INT i = This->decl_count; + WCHAR *ptr; + + prolog = xmlAllocOutputBuffer(xmlGetCharEncodingHandler(xmlParseCharEncoding("UTF-16"))); + + write_prolog_buffer(This, xmlParseCharEncoding("UTF-16"), prolog); + + ptr = output = SysAllocStringByteLen(NULL, prolog->conv->use*This->decl_count + + This->buffer->conv->use-This->decl_written); + while (i--) + { + memcpy(ptr, prolog->conv->content, prolog->conv->use); + ptr += prolog->conv->use/sizeof(WCHAR); + } + + memcpy(ptr, This->buffer->conv->content + This->decl_written, This->buffer->conv->use-This->decl_written); + xmlOutputBufferClose(prolog); + } + else + { + output = SysAllocStringLen((const WCHAR*)This->buffer->conv->content, + This->buffer->conv->use/sizeof(WCHAR)); + } + V_VT(dest) = VT_BSTR; - V_BSTR(dest) = SysAllocStringLen((const WCHAR*)This->buffer->conv->content, - This->buffer->conv->use/sizeof(WCHAR)); + V_BSTR(dest) = output; return S_OK; } @@ -426,6 +504,7 @@ static HRESULT WINAPI mxwriter_put_encoding(IMXWriter *iface, BSTR encoding) This->encoding = xmlParseCharEncoding(enc); heap_free(enc); + TRACE("got encoding %d\n", This->encoding); reset_output_buffer(This); return S_OK; } @@ -620,14 +699,7 @@ static HRESULT WINAPI mxwriter_saxcontent_putDocumentLocator( static HRESULT WINAPI mxwriter_saxcontent_startDocument(ISAXContentHandler *iface) { - static const char version[] = "<?xml version=\""; - static const char encoding[] = " encoding=\""; - static const char standalone[] = " standalone=\""; - static const char yes[] = "yes\"?>"; - static const char no[] = "no\"?>"; - mxwriter *This = impl_from_ISAXContentHandler( iface ); - xmlChar *s; TRACE("(%p)\n", This); @@ -643,26 +715,8 @@ static HRESULT WINAPI mxwriter_saxcontent_startDocument(ISAXContentHandler *ifac if (This->props[MXWriter_OmitXmlDecl] == VARIANT_TRUE) return S_OK; - /* version */ - write_output_buffer(This, version, sizeof(version)-1); - s = xmlchar_from_wchar(This->version); - write_output_buffer_str(This, (char*)s); - heap_free(s); - write_output_buffer(This, "\"", 1); - - /* encoding */ - write_output_buffer(This, encoding, sizeof(encoding)-1); - write_output_buffer_str(This, xmlGetCharEncodingName(This->encoding)); - write_output_buffer(This, "\"", 1); - - /* standalone */ - write_output_buffer(This, standalone, sizeof(standalone)-1); - if (This->props[MXWriter_Standalone] == VARIANT_TRUE) - write_output_buffer(This, yes, sizeof(yes)-1); - else - write_output_buffer(This, no, sizeof(no)-1); - - write_output_buffer(This, crlfA, sizeof(crlfA)-1); + This->decl_count++; + This->decl_written += write_prolog_buffer(This, This->encoding, This->buffer); if (This->dest && This->encoding == XML_CHAR_ENCODING_UTF16LE) { static const CHAR utf16BOM[] = {0xff,0xfe}; @@ -923,11 +977,14 @@ HRESULT MXWriter_create(MSXML_VERSION version, IUnknown *outer, void **ppObj) This->props[MXWriter_OmitXmlDecl] = VARIANT_FALSE; This->props[MXWriter_Standalone] = VARIANT_FALSE; This->prop_changed = FALSE; - This->encoding = xmlParseCharEncoding("UTF-16"); - This->version = SysAllocString(version10W); + This->encoding = xmlParseCharEncoding("UTF-16"); + This->version = SysAllocString(version10W); This->element = NULL; + This->decl_count = 0; + This->decl_written = 0; + This->dest = NULL; This->dest_written = 0;
1
0
0
0
Nikolay Sivov : msxml3: Use libxml2 buffer support through helpers.
by Alexandre Julliard
09 Dec '11
09 Dec '11
Module: wine Branch: master Commit: a4b24978e9dc2e54057552fc2efffbd58cc25d0a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a4b24978e9dc2e54057552fc2…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Dec 9 14:02:10 2011 +0300 msxml3: Use libxml2 buffer support through helpers. --- dlls/msxml3/mxwriter.c | 63 ++++++++++++++++++++++++++--------------- dlls/msxml3/tests/saxreader.c | 29 +++++++++++++++++++ 2 files changed, 69 insertions(+), 23 deletions(-) diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c index b402259..049ca3d 100644 --- a/dlls/msxml3/mxwriter.c +++ b/dlls/msxml3/mxwriter.c @@ -148,12 +148,23 @@ static HRESULT write_data_to_stream(mxwriter *This) return hres; } +static void write_output_buffer(const mxwriter *This, const char *data, int len) +{ + xmlOutputBufferWrite(This->buffer, len, data); +} + +static void write_output_buffer_str(const mxwriter *This, const char *data) +{ + xmlOutputBufferWriteString(This->buffer, data); +} + /* Newly added element start tag left unclosed cause for empty elements we have to close it differently. */ static void close_element_starttag(const mxwriter *This) { + static const char gt = '>'; if (!This->element) return; - xmlOutputBufferWriteString(This->buffer, ">"); + write_output_buffer(This, >, 1); } static void set_element_name(mxwriter *This, const WCHAR *name, int len) @@ -609,6 +620,12 @@ static HRESULT WINAPI mxwriter_saxcontent_putDocumentLocator( static HRESULT WINAPI mxwriter_saxcontent_startDocument(ISAXContentHandler *iface) { + static const char version[] = "<?xml version=\""; + static const char encoding[] = " encoding=\""; + static const char standalone[] = " standalone=\""; + static const char yes[] = "yes\"?>"; + static const char no[] = "no\"?>"; + mxwriter *This = impl_from_ISAXContentHandler( iface ); xmlChar *s; @@ -627,25 +644,25 @@ static HRESULT WINAPI mxwriter_saxcontent_startDocument(ISAXContentHandler *ifac if (This->props[MXWriter_OmitXmlDecl] == VARIANT_TRUE) return S_OK; /* version */ - xmlOutputBufferWriteString(This->buffer, "<?xml version=\""); + write_output_buffer(This, version, sizeof(version)-1); s = xmlchar_from_wchar(This->version); - xmlOutputBufferWriteString(This->buffer, (char*)s); + write_output_buffer_str(This, (char*)s); heap_free(s); - xmlOutputBufferWriteString(This->buffer, "\""); + write_output_buffer(This, "\"", 1); /* encoding */ - xmlOutputBufferWriteString(This->buffer, " encoding=\""); - xmlOutputBufferWriteString(This->buffer, xmlGetCharEncodingName(This->encoding)); - xmlOutputBufferWriteString(This->buffer, "\""); + write_output_buffer(This, encoding, sizeof(encoding)-1); + write_output_buffer_str(This, xmlGetCharEncodingName(This->encoding)); + write_output_buffer(This, "\"", 1); /* standalone */ - xmlOutputBufferWriteString(This->buffer, " standalone=\""); + write_output_buffer(This, standalone, sizeof(standalone)-1); if (This->props[MXWriter_Standalone] == VARIANT_TRUE) - xmlOutputBufferWriteString(This->buffer, "yes\"?>"); + write_output_buffer(This, yes, sizeof(yes)-1); else - xmlOutputBufferWriteString(This->buffer, "no\"?>"); + write_output_buffer(This, no, sizeof(no)-1); - xmlOutputBufferWriteString(This->buffer, crlfA); + write_output_buffer(This, crlfA, sizeof(crlfA)-1); if (This->dest && This->encoding == XML_CHAR_ENCODING_UTF16LE) { static const CHAR utf16BOM[] = {0xff,0xfe}; @@ -713,9 +730,9 @@ static HRESULT WINAPI mxwriter_saxcontent_startElement( set_element_name(This, QName ? QName : emptyW, QName ? nQName : 0); - xmlOutputBufferWriteString(This->buffer, "<"); + write_output_buffer(This, "<", 1); s = xmlchar_from_wcharn(QName, nQName); - xmlOutputBufferWriteString(This->buffer, (char*)s); + write_output_buffer_str(This, (char*)s); heap_free(s); if (attr) @@ -736,23 +753,23 @@ static HRESULT WINAPI mxwriter_saxcontent_startElement( if (FAILED(hr)) return hr; /* space separator in front of every attribute */ - xmlOutputBufferWriteString(This->buffer, " "); + write_output_buffer(This, " ", 1); s = xmlchar_from_wcharn(str, len); - xmlOutputBufferWriteString(This->buffer, (char*)s); + write_output_buffer_str(This, (char*)s); heap_free(s); - xmlOutputBufferWriteString(This->buffer, "=\""); + write_output_buffer(This, "=\"", 2); len = 0; hr = ISAXAttributes_getValue(attr, i, &str, &len); if (FAILED(hr)) return hr; s = xmlchar_from_wcharn(str, len); - xmlOutputBufferWriteString(This->buffer, (char*)s); + write_output_buffer_str(This, (char*)s); heap_free(s); - xmlOutputBufferWriteString(This->buffer, "\""); + write_output_buffer(This, "\"", 1); } } @@ -778,15 +795,15 @@ static HRESULT WINAPI mxwriter_saxcontent_endElement( if (This->element && QName && !strncmpW(This->element, QName, nQName)) { - xmlOutputBufferWriteString(This->buffer, "/>"); + write_output_buffer(This, "/>", 2); } else { xmlChar *s = xmlchar_from_wcharn(QName, nQName); - xmlOutputBufferWriteString(This->buffer, "</"); - xmlOutputBufferWriteString(This->buffer, (char*)s); - xmlOutputBufferWriteString(This->buffer, ">"); + write_output_buffer(This, "</", 2); + write_output_buffer_str(This, (char*)s); + write_output_buffer(This, ">", 1); heap_free(s); } @@ -813,7 +830,7 @@ static HRESULT WINAPI mxwriter_saxcontent_characters( if (nchars) { xmlChar *s = xmlchar_from_wcharn(chars, nchars); - xmlOutputBufferWriteString(This->buffer, (char*)s); + write_output_buffer_str(This, (char*)s); heap_free(s); } diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index e59c13b..0fac3dd 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -2552,6 +2552,35 @@ static void test_mxwriter_stream(void) "Got wrong content: %s\n", wine_dbgstr_w(V_BSTR(&dest))); VariantClear(&dest); + /* test when BOM is written to output stream */ + V_VT(&dest) = VT_EMPTY; + hr = IMXWriter_put_output(writer, dest); + EXPECT_HR(hr, S_OK); + + pos.QuadPart = 0; + hr = IStream_Seek(stream, pos, STREAM_SEEK_SET, NULL); + EXPECT_HR(hr, S_OK); + + V_VT(&dest) = VT_UNKNOWN; + V_UNKNOWN(&dest) = (IUnknown*)stream; + hr = IMXWriter_put_output(writer, dest); + EXPECT_HR(hr, S_OK); + + hr = IMXWriter_put_byteOrderMark(writer, VARIANT_TRUE); + EXPECT_HR(hr, S_OK); + + hr = IMXWriter_put_encoding(writer, _bstr_("UTF-16")); + EXPECT_HR(hr, S_OK); + + hr = ISAXContentHandler_startDocument(content); + EXPECT_HR(hr, S_OK); + + pos.QuadPart = 0; + pos2.QuadPart = 0; + hr = IStream_Seek(stream, pos, STREAM_SEEK_CUR, &pos2); + EXPECT_HR(hr, S_OK); + ok(pos2.QuadPart == 2, "got wrong position\n"); + ISAXContentHandler_Release(content); IMXWriter_Release(writer);
1
0
0
0
Aric Stewart : usp10: Add Myanmar script.
by Alexandre Julliard
09 Dec '11
09 Dec '11
Module: wine Branch: master Commit: 486a20c17cb44f11419b56353dc6f73984dc1882 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=486a20c17cb44f11419b56353…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Fri Dec 9 11:02:30 2011 -0600 usp10: Add Myanmar script. --- dlls/usp10/shape.c | 8 ++++++++ dlls/usp10/tests/usp10.c | 10 ++++++++++ dlls/usp10/usp10.c | 15 ++++++++++++++- dlls/usp10/usp10_internal.h | 3 +++ 4 files changed, 35 insertions(+), 1 deletions(-) diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index 7a3df27..675765a 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -452,6 +452,12 @@ static OPENTYPE_FEATURE_RECORD devanagari_features[] = { MS_MAKE_TAG('c','a','l','t'), 1}, }; +static OPENTYPE_FEATURE_RECORD myanmar_features[] = +{ + { MS_MAKE_TAG('l','i','g','a'), 1}, + { MS_MAKE_TAG('c','l','i','g'), 1}, +}; + static const char* required_bengali_features[] = { "nukt", @@ -598,6 +604,8 @@ static const ScriptShapeData ShapingData[] = {{ standard_features, 2}, NULL, "" , "", NULL, NULL}, {{ latin_features, 2}, NULL, "latn" , "", NULL, NULL}, {{ standard_features, 2}, NULL, "" , "", NULL, NULL}, + {{ myanmar_features, 2}, NULL, "mymr", "", NULL, NULL}, + {{ myanmar_features, 2}, NULL, "mymr", "", NULL, NULL}, }; static INT GSUB_is_glyph_covered(LPCVOID table , UINT glyph) diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index dffc6a1..5f47903 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -147,6 +147,7 @@ static inline void _test_items_ok(LPCWSTR string, DWORD cchString, #define telu_tag MS_MAKE_TAG('t','e','l','u') #define knda_tag MS_MAKE_TAG('k','n','d','a') #define mlym_tag MS_MAKE_TAG('m','l','y','m') +#define mymr_tag MS_MAKE_TAG('m','y','m','r') static void test_ScriptItemize( void ) { @@ -296,6 +297,11 @@ static void test_ScriptItemize( void ) static const itemTest t231[3] = {{{0,0,0,0,0},0,0,0,0,0,FALSE},{{0,0,0,0,0},3,0,0,0,0,FALSE},{{0,0,0,0,0},6,0,0,0,-1,FALSE}}; static const itemTest t232[3] = {{{0,0,0,0,0},0,0,1,2,0,FALSE},{{0,0,0,0,0},3,0,1,2,0,FALSE},{{0,0,0,0,0},6,0,0,0,-1,FALSE}}; + /* Myanmar */ + static const WCHAR test24[] = {0x1019,0x103c,0x1014,0x103a,0x1019,0x102c,0x1021,0x1000,0x1039,0x1001,0x101b,0x102c}; + static const itemTest t241[2] = {{{0,0,0,0,0},0,0,0,0,mymr_tag,FALSE},{{0,0,0,0,0},12,0,0,0,-1,FALSE}}; + static const itemTest t242[2] = {{{0,0,0,0,0},0,0,0,2,mymr_tag,TRUE,{-1,1,1,1,-1}},{{0,0,0,0,0},12,0,0,0,-1,FALSE}}; + SCRIPT_ITEM items[15]; SCRIPT_CONTROL Control; @@ -353,6 +359,7 @@ static void test_ScriptItemize( void ) test_items_ok(test21,5,NULL,NULL,1,t211,FALSE,0); test_items_ok(test22,6,NULL,NULL,2,t221,FALSE,0); test_items_ok(test23,6,NULL,NULL,2,t231,FALSE,0); + test_items_ok(test24,12,NULL,NULL,1,t241,FALSE,0); State.uBidiLevel = 0; test_items_ok(test1,4,&Control,&State,1,t11,FALSE,0); @@ -383,6 +390,7 @@ static void test_ScriptItemize( void ) test_items_ok(test21,5,&Control,&State,1,t211,FALSE,0); test_items_ok(test22,6,&Control,&State,2,t221,FALSE,0); test_items_ok(test23,6,&Control,&State,2,t231,FALSE,0); + test_items_ok(test24,12,&Control,&State,1,t241,FALSE,0); State.uBidiLevel = 1; test_items_ok(test1,4,&Control,&State,1,t12,FALSE,0); @@ -413,6 +421,7 @@ static void test_ScriptItemize( void ) test_items_ok(test21,5,&Control,&State,1,t211,FALSE,0); test_items_ok(test22,6,&Control,&State,2,t222,FALSE,1); test_items_ok(test23,6,&Control,&State,2,t232,FALSE,0); + test_items_ok(test24,12,&Control,&State,1,t242,FALSE,0); State.uBidiLevel = 1; Control.fMergeNeutralItems = TRUE; @@ -444,6 +453,7 @@ static void test_ScriptItemize( void ) test_items_ok(test21,5,&Control,&State,1,t211,FALSE,0); test_items_ok(test22,6,&Control,&State,1,t223,FALSE,2); test_items_ok(test23,6,&Control,&State,2,t232,FALSE,0); + test_items_ok(test24,12,&Control,&State,1,t242,FALSE,0); } static inline void _test_shape_ok(int valid, HDC hdc, LPCWSTR string, diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 359d4a3..a358f33 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -107,6 +107,8 @@ static const scriptRange scriptRanges[] = { { Script_Lao, 0xe80, 0xeff, Script_Lao_Numeric, 0}, /* Tibetan: U+0F00–U+0FFF */ { Script_Tibetan, 0xf00, 0xfff, 0, 0}, + /* Myanmar: U+1000–U+109F */ + { Script_Myanmar, 0x1000, 0x109f, Script_Myanmar_Numeric, 0}, /* Georgian: U+10A0–U+10FF */ { Script_Georgian, 0x10a0, 0x10ff, 0, 0}, /* Vedic Extensions: U+1CD0-U+1CFF */ @@ -165,6 +167,8 @@ static const scriptRange scriptRanges[] = { { Script_Phags_pa, 0xa840, 0xa87f, 0, 0}, /* Devanagari Extended: U+A8E0-U+A8FF */ { Script_Devanagari, 0xa8e0, 0xa8ff, Script_Devanagari_Numeric, 0}, + /* Myanmar Extended-A: U+AA60–U+AA7F */ + { Script_Myanmar, 0xaa60, 0xaa7f, Script_Myanmar_Numeric, 0}, /* Latin Ligatures: U+FB00–U+FB06 */ { Script_Latin, 0xfb00, 0xfb06, 0, 0}, /* Armenian ligatures U+FB13..U+FB17 */ @@ -377,6 +381,14 @@ static const scriptData scriptInformation[] = { {LANG_ENGLISH, 1, 0, 0, 0, ANSI_CHARSET, 0, 0, 0, 0, 0, 0, 1, 0, 0}, 0x00000000, {0}}, + {{Script_Myanmar, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}}, + {0x55, 0, 1, 1, 1, DEFAULT_CHARSET, 0, 0, 0, 0, 1, 0, 0, 0, 0}, + MS_MAKE_TAG('m','y','m','r'), + {0}}, + {{Script_Myanmar_Numeric, 0, 0, 0, 0, 0, 0, { 0,0,0,0,0,0,0,0,0,0,0}}, + {0x55, 1, 1, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + MS_MAKE_TAG('m','y','m','r'), + {0}}, }; static const SCRIPT_PROPERTIES *script_props[] = @@ -403,7 +415,8 @@ static const SCRIPT_PROPERTIES *script_props[] = &scriptInformation[38].props, &scriptInformation[39].props, &scriptInformation[40].props, &scriptInformation[41].props, &scriptInformation[42].props, &scriptInformation[43].props, - &scriptInformation[44].props, &scriptInformation[45].props + &scriptInformation[44].props, &scriptInformation[45].props, + &scriptInformation[46].props, &scriptInformation[47].props }; typedef struct { diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h index 6f5d3d1..bade039 100644 --- a/dlls/usp10/usp10_internal.h +++ b/dlls/usp10/usp10_internal.h @@ -75,6 +75,9 @@ #define Script_Diacritical 44 #define Script_Punctuation2 45 #define Script_Numeric2 46 +/* Unicode Chapter 11 continued */ +#define Script_Myanmar 47 +#define Script_Myanmar_Numeric 48 #define GLYPH_BLOCK_SHIFT 8 #define GLYPH_BLOCK_SIZE (1UL << GLYPH_BLOCK_SHIFT)
1
0
0
0
Michael Stefaniuc : cmdlgtst: Remove obsolete and unused application.
by Alexandre Julliard
09 Dec '11
09 Dec '11
Module: wine Branch: master Commit: 6b5dca5bbb06a2f907de8f4d3418d88eca17b9e7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6b5dca5bbb06a2f907de8f4d3…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Thu Dec 8 00:27:37 2011 +0100 cmdlgtst: Remove obsolete and unused application. --- configure | 1 - configure.ac | 1 - programs/cmdlgtst/Cs.rc | 243 --------- programs/cmdlgtst/Da.rc | 298 ----------- programs/cmdlgtst/De.rc | 300 ----------- programs/cmdlgtst/En.rc | 298 ----------- programs/cmdlgtst/Es.rc | 298 ----------- programs/cmdlgtst/Fr.rc | 303 ------------ programs/cmdlgtst/He.rc | 310 ------------ programs/cmdlgtst/It.rc | 307 ------------ programs/cmdlgtst/Ja.rc | 301 ----------- programs/cmdlgtst/Ko.rc | 302 ----------- programs/cmdlgtst/Lt.rc | 301 ----------- programs/cmdlgtst/Makefile.in | 32 -- programs/cmdlgtst/Nl.rc | 299 ----------- programs/cmdlgtst/No.rc | 298 ----------- programs/cmdlgtst/Pl.rc | 299 ----------- programs/cmdlgtst/Pt.rc | 559 --------------------- programs/cmdlgtst/Ro.rc | 301 ----------- programs/cmdlgtst/Ru.rc | 300 ----------- programs/cmdlgtst/Si.rc | 300 ----------- programs/cmdlgtst/Sv.rc | 298 ----------- programs/cmdlgtst/Tr.rc | 272 ---------- programs/cmdlgtst/Uk.rc | 302 ----------- programs/cmdlgtst/about.ico | Bin 766 -> 0 bytes programs/cmdlgtst/cmdlgr.rc | 24 - programs/cmdlgtst/cmdlgtst.c | 1096 ----------------------------------------- programs/cmdlgtst/cmdlgtst.h | 153 ------ tools/make_makefiles | 1 - 29 files changed, 0 insertions(+), 7797 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=6b5dca5bbb06a2f907de8…
1
0
0
0
Alex Henrie : comdlg32: Correct title of "Save As" dialog.
by Alexandre Julliard
09 Dec '11
09 Dec '11
Module: wine Branch: master Commit: b5b739d5f333961690a063e6cf956eaa4e3d011d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b5b739d5f333961690a063e6c…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Thu Dec 8 13:58:33 2011 -0700 comdlg32: Correct title of "Save As" dialog. --- dlls/comdlg32/comdlg32.rc | 2 +- dlls/comdlg32/filedlg.c | 2 +- po/ar.po | 7 +------ po/bg.po | 8 ++------ po/ca.po | 6 +----- po/cs.po | 6 +----- po/da.po | 8 ++------ po/de.po | 6 +----- po/el.po | 6 +----- po/en.po | 6 +----- po/en_US.po | 6 +----- po/eo.po | 6 +----- po/es.po | 6 +----- po/fa.po | 7 +------ po/fi.po | 8 ++------ po/fr.po | 6 +----- po/he.po | 6 +----- po/hi.po | 6 +----- po/hu.po | 6 +----- po/it.po | 6 +----- po/ja.po | 8 ++------ po/ko.po | 6 +----- po/lt.po | 6 +----- po/ml.po | 6 +----- po/nb_NO.po | 6 +----- po/nl.po | 6 +----- po/or.po | 6 +----- po/pa.po | 6 +----- po/pl.po | 6 +----- po/pt_BR.po | 6 +----- po/pt_PT.po | 8 ++------ po/rm.po | 6 +----- po/ro.po | 6 +----- po/ru.po | 6 +----- po/sk.po | 6 +----- po/sl.po | 8 ++------ po/sr_RS(a)cyrillic.po | 6 +----- po/sr_RS(a)latin.po | 6 +----- po/sv.po | 6 +----- po/te.po | 6 +----- po/th.po | 7 +------ po/tr.po | 6 +----- po/uk.po | 6 +----- po/wa.po | 7 +------ po/wine.pot | 6 +----- po/zh_CN.po | 8 ++------ po/zh_TW.po | 7 +------ 47 files changed, 54 insertions(+), 239 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=b5b739d5f333961690a06…
1
0
0
0
Francois Gouget : include: Add the missing inaddr.h and in6addr. h include directives.
by Alexandre Julliard
09 Dec '11
09 Dec '11
Module: wine Branch: master Commit: 653c1d76d063d48decba2592c7187d0c58d343fa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=653c1d76d063d48decba2592c…
Author: Francois Gouget <fgouget(a)free.fr> Date: Fri Dec 9 12:00:39 2011 +0100 include: Add the missing inaddr.h and in6addr.h include directives. --- dlls/iphlpapi/icmp.c | 2 ++ dlls/iphlpapi/ifenum.h | 2 +- include/ipexport.h | 3 +++ include/mprapi.h | 2 +- include/ras.h | 2 ++ include/ws2def.h | 2 +- 6 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/iphlpapi/icmp.c b/dlls/iphlpapi/icmp.c index 78b91c6..fb87fe2 100644 --- a/dlls/iphlpapi/icmp.c +++ b/dlls/iphlpapi/icmp.c @@ -63,6 +63,8 @@ # include <sys/poll.h> #endif +#define USE_WS_PREFIX + #include "windef.h" #include "winbase.h" #include "winerror.h" diff --git a/dlls/iphlpapi/ifenum.h b/dlls/iphlpapi/ifenum.h index 1a55376..228d7ee 100644 --- a/dlls/iphlpapi/ifenum.h +++ b/dlls/iphlpapi/ifenum.h @@ -37,8 +37,8 @@ #include "windef.h" #include "winbase.h" -#include "iprtrmib.h" #define USE_WS_PREFIX +#include "iprtrmib.h" #include "winsock2.h" #define MAX_INTERFACE_PHYSADDR 8 diff --git a/include/ipexport.h b/include/ipexport.h index 71a44ba..a0e30ba 100644 --- a/include/ipexport.h +++ b/include/ipexport.h @@ -21,6 +21,9 @@ #ifndef __WINE_IPEXPORT_H #define __WINE_IPEXPORT_H +#include <in6addr.h> +#include <inaddr.h> + typedef ULONG IPAddr; typedef ULONG IPMask; typedef ULONG IP_STATUS; diff --git a/include/mprapi.h b/include/mprapi.h index 2eec3b9..1860f98 100644 --- a/include/mprapi.h +++ b/include/mprapi.h @@ -21,7 +21,7 @@ #include <lmcons.h> #include <ras.h> -/* FIXME: #include <in6addr.h> */ +#include <in6addr.h> #define MAX_DEVICE_NAME 128 #define MAX_DEVICETYPE_NAME 16 diff --git a/include/ras.h b/include/ras.h index 3a75f41..f9fad2e 100644 --- a/include/ras.h +++ b/include/ras.h @@ -25,6 +25,8 @@ extern "C" { #endif #include <pshpack4.h> +#include <inaddr.h> +#include <in6addr.h> #define RAS_MaxCallbackNumber RAS_MaxPhoneNumber #define RAS_MaxDeviceName 128 diff --git a/include/ws2def.h b/include/ws2def.h index 8c1fc4a..ac68e2b 100644 --- a/include/ws2def.h +++ b/include/ws2def.h @@ -19,7 +19,7 @@ #ifndef _WS2DEF_ #define _WS2DEF_ -/* FIXME: #include <inaddr.h> */ +#include <inaddr.h> #ifdef USE_WS_PREFIX #define WS(x) WS_##x
1
0
0
0
Francois Gouget : iphlpapi: Remove a few redundant include directives.
by Alexandre Julliard
09 Dec '11
09 Dec '11
Module: wine Branch: master Commit: 6fa0bda53591d3ddaf9dfcc78c475dd702000283 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6fa0bda53591d3ddaf9dfcc78…
Author: Francois Gouget <fgouget(a)free.fr> Date: Fri Dec 9 11:59:43 2011 +0100 iphlpapi: Remove a few redundant include directives. --- dlls/iphlpapi/ipstats.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c index 0a74748..7c8e747 100644 --- a/dlls/iphlpapi/ipstats.c +++ b/dlls/iphlpapi/ipstats.c @@ -129,9 +129,6 @@ #define ADVANCE(x, n) (x += ROUNDUP(((struct sockaddr *)n)->sa_len)) #endif -#include "windef.h" -#include "winbase.h" -#include "iprtrmib.h" #include "ifenum.h" #include "ipstats.h"
1
0
0
0
Francois Gouget : include: Eliminate redundancy between winsock. h and inaddr.h.
by Alexandre Julliard
09 Dec '11
09 Dec '11
Module: wine Branch: master Commit: d20c21ddd5558946fdf48e976c2355575966512e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d20c21ddd5558946fdf48e976…
Author: Francois Gouget <fgouget(a)free.fr> Date: Fri Dec 9 11:58:22 2011 +0100 include: Eliminate redundancy between winsock.h and inaddr.h. --- include/inaddr.h | 7 +++++++ include/winsock.h | 30 ++---------------------------- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/include/inaddr.h b/include/inaddr.h index a663b08..72a5028 100644 --- a/include/inaddr.h +++ b/include/inaddr.h @@ -48,6 +48,13 @@ typedef struct WS(in_addr) #define s_lh S_un.S_un_b.s_b3 #define s_impno S_un.S_un_b.s_b4 #define s_imp S_un.S_un_w.s_w2 +#else +#define WS_s_addr S_un.S_addr +#define WS_s_net S_un.S_un_b.s_b1 +#define WS_s_host S_un.S_un_b.s_b2 +#define WS_s_lh S_un.S_un_b.s_b3 +#define WS_s_impno S_un.S_un_b.s_b4 +#define WS_s_imp S_un.S_un_w.s_w2 #endif /* USE_WS_PREFIX */ #endif /* __INADDR_H__ */ diff --git a/include/winsock.h b/include/winsock.h index 0e409ec..a938d59 100644 --- a/include/winsock.h +++ b/include/winsock.h @@ -116,6 +116,8 @@ #ifndef _WINSOCKAPI_ #define _WINSOCKAPI_ +#include <inaddr.h> + #ifdef USE_WS_PREFIX typedef unsigned char WS_u_char; typedef unsigned short WS_u_short; @@ -591,34 +593,6 @@ static inline ULONG __wine_ulong_swap(ULONG l) #define WS_INADDR_NONE 0xffffffff #endif /* USE_WS_PREFIX */ -typedef struct WS(in_addr) -{ - union { - struct { - WS(u_char) s_b1,s_b2,s_b3,s_b4; - } S_un_b; - struct { - WS(u_short) s_w1,s_w2; - } S_un_w; - ULONG S_addr; - } S_un; -#ifndef USE_WS_PREFIX -#define s_addr S_un.S_addr -#define s_host S_un.S_un_b.s_b2 -#define s_net S_un.S_un_b.s_b1 -#define s_imp S_un.S_un_w.s_w2 -#define s_impno S_un.S_un_b.s_b4 -#define s_lh S_un.S_un_b.s_b3 -#else -#define WS_s_addr S_un.S_addr -#define WS_s_host S_un.S_un_b.s_b2 -#define WS_s_net S_un.S_un_b.s_b1 -#define WS_s_imp S_un.S_un_w.s_w2 -#define WS_s_impno S_un.S_un_b.s_b4 -#define WS_s_lh S_un.S_un_b.s_b3 -#endif /* USE_WS_PREFIX */ -} IN_ADDR, *PIN_ADDR, *LPIN_ADDR; - typedef struct WS(sockaddr_in) { short sin_family;
1
0
0
0
Francois Gouget : include: in6addr.h does not depend on winsock' s u_xxx types.
by Alexandre Julliard
09 Dec '11
09 Dec '11
Module: wine Branch: master Commit: c63496ac711ab114a97bcc2c1efb5f10c6034977 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c63496ac711ab114a97bcc2c1…
Author: Francois Gouget <fgouget(a)free.fr> Date: Fri Dec 9 11:57:44 2011 +0100 include: in6addr.h does not depend on winsock's u_xxx types. --- include/in6addr.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/in6addr.h b/include/in6addr.h index 042e8d2..a745bd2 100644 --- a/include/in6addr.h +++ b/include/in6addr.h @@ -27,8 +27,8 @@ typedef struct WS(in6_addr) { union { - WS(u_char) Byte[16]; - WS(u_short) Word[8]; + UCHAR Byte[16]; + USHORT Word[8]; } u; } IN6_ADDR, *PIN6_ADDR, *LPIN6_ADDR;
1
0
0
0
← Newer
1
...
51
52
53
54
55
56
57
...
81
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Results per page:
10
25
50
100
200