ReactOS 0.4.16-dev-338-g34e76ad
mxwriter.c File Reference
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "ole2.h"
#include "msxml6.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "msxml_private.h"
Include dependency graph for mxwriter.c:

Go to the source code of this file.

Classes

struct  xml_encoding_data
 
struct  encoded_buffer
 
struct  output_buffer
 
struct  mxwriter
 
struct  mxattribute
 
struct  mxattributes
 

Macros

#define COBJMACROS
 

Enumerations

enum  xml_encoding {
  XmlEncoding_ISO_8859_1 = 0 , XmlEncoding_ISO_8859_13 , XmlEncoding_ISO_8859_15 , XmlEncoding_ISO_8859_2 ,
  XmlEncoding_ISO_8859_3 , XmlEncoding_ISO_8859_4 , XmlEncoding_ISO_8859_5 , XmlEncoding_ISO_8859_7 ,
  XmlEncoding_ISO_8859_9 , XmlEncoding_UTF16 , XmlEncoding_UTF8 , XmlEncoding_Unknown ,
  XmlEncoding_USASCII , XmlEncoding_UTF16 , XmlEncoding_UTF8 , XmlEncoding_Unknown
}
 
enum  mxwriter_prop {
  MXWriter_BOM = 0 , MXWriter_DisableEscaping , MXWriter_Indent , MXWriter_OmitXmlDecl ,
  MXWriter_Standalone , MXWriter_LastProp
}
 
enum  escape_mode { EscapeValue , EscapeText }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msxml)
 
static mxattributesimpl_from_IMXAttributes (IMXAttributes *iface)
 
static mxattributesimpl_from_ISAXAttributes (ISAXAttributes *iface)
 
static mxattributesimpl_from_IVBSAXAttributes (IVBSAXAttributes *iface)
 
static HRESULT mxattributes_grow (mxattributes *This)
 
static xml_encoding parse_encoding_name (const WCHAR *encoding)
 
static HRESULT init_encoded_buffer (encoded_buffer *buffer)
 
static void free_encoded_buffer (encoded_buffer *buffer)
 
static HRESULT get_code_page (xml_encoding encoding, UINT *cp)
 
static HRESULT init_output_buffer (xml_encoding encoding, output_buffer *buffer)
 
static void free_output_buffer (output_buffer *buffer)
 
static HRESULT write_output_buffer (mxwriter *writer, const WCHAR *data, int len)
 
static HRESULT write_output_buffer_quoted (mxwriter *writer, const WCHAR *data, int len)
 
static void close_output_buffer (mxwriter *writer)
 
static WCHARget_escaped_string (const WCHAR *str, escape_mode mode, int *len)
 
static void write_prolog_buffer (mxwriter *writer)
 
static HRESULT write_data_to_stream (mxwriter *writer)
 
static void close_element_starttag (mxwriter *writer)
 
static void write_node_indent (mxwriter *writer)
 
static void writer_inc_indent (mxwriter *This)
 
static void writer_dec_indent (mxwriter *This)
 
static void set_element_name (mxwriter *This, const WCHAR *name, int len)
 
static HRESULT flush_output_buffer (mxwriter *This)
 
static void reset_output_buffer (mxwriter *This)
 
static HRESULT writer_set_property (mxwriter *writer, mxwriter_prop property, VARIANT_BOOL value)
 
static HRESULT writer_get_property (const mxwriter *writer, mxwriter_prop property, VARIANT_BOOL *value)
 
static mxwriterimpl_from_IMXWriter (IMXWriter *iface)
 
static mxwriterimpl_from_ISAXContentHandler (ISAXContentHandler *iface)
 
static mxwriterimpl_from_IVBSAXContentHandler (IVBSAXContentHandler *iface)
 
static mxwriterimpl_from_ISAXLexicalHandler (ISAXLexicalHandler *iface)
 
static mxwriterimpl_from_IVBSAXLexicalHandler (IVBSAXLexicalHandler *iface)
 
static mxwriterimpl_from_ISAXDeclHandler (ISAXDeclHandler *iface)
 
static mxwriterimpl_from_IVBSAXDeclHandler (IVBSAXDeclHandler *iface)
 
static mxwriterimpl_from_ISAXDTDHandler (ISAXDTDHandler *iface)
 
static mxwriterimpl_from_IVBSAXDTDHandler (IVBSAXDTDHandler *iface)
 
static mxwriterimpl_from_ISAXErrorHandler (ISAXErrorHandler *iface)
 
static mxwriterimpl_from_IVBSAXErrorHandler (IVBSAXErrorHandler *iface)
 
static HRESULT WINAPI mxwriter_QueryInterface (IMXWriter *iface, REFIID riid, void **obj)
 
static ULONG WINAPI mxwriter_AddRef (IMXWriter *iface)
 
static ULONG WINAPI mxwriter_Release (IMXWriter *iface)
 
static HRESULT WINAPI mxwriter_GetTypeInfoCount (IMXWriter *iface, UINT *pctinfo)
 
static HRESULT WINAPI mxwriter_GetTypeInfo (IMXWriter *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI mxwriter_GetIDsOfNames (IMXWriter *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI mxwriter_Invoke (IMXWriter *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI mxwriter_put_output (IMXWriter *iface, VARIANT dest)
 
static HRESULT WINAPI mxwriter_get_output (IMXWriter *iface, VARIANT *dest)
 
static HRESULT WINAPI mxwriter_put_encoding (IMXWriter *iface, BSTR encoding)
 
static HRESULT WINAPI mxwriter_get_encoding (IMXWriter *iface, BSTR *encoding)
 
static HRESULT WINAPI mxwriter_put_byteOrderMark (IMXWriter *iface, VARIANT_BOOL value)
 
static HRESULT WINAPI mxwriter_get_byteOrderMark (IMXWriter *iface, VARIANT_BOOL *value)
 
static HRESULT WINAPI mxwriter_put_indent (IMXWriter *iface, VARIANT_BOOL value)
 
static HRESULT WINAPI mxwriter_get_indent (IMXWriter *iface, VARIANT_BOOL *value)
 
static HRESULT WINAPI mxwriter_put_standalone (IMXWriter *iface, VARIANT_BOOL value)
 
static HRESULT WINAPI mxwriter_get_standalone (IMXWriter *iface, VARIANT_BOOL *value)
 
static HRESULT WINAPI mxwriter_put_omitXMLDeclaration (IMXWriter *iface, VARIANT_BOOL value)
 
static HRESULT WINAPI mxwriter_get_omitXMLDeclaration (IMXWriter *iface, VARIANT_BOOL *value)
 
static HRESULT WINAPI mxwriter_put_version (IMXWriter *iface, BSTR version)
 
static HRESULT WINAPI mxwriter_get_version (IMXWriter *iface, BSTR *version)
 
static HRESULT WINAPI mxwriter_put_disableOutputEscaping (IMXWriter *iface, VARIANT_BOOL value)
 
static HRESULT WINAPI mxwriter_get_disableOutputEscaping (IMXWriter *iface, VARIANT_BOOL *value)
 
static HRESULT WINAPI mxwriter_flush (IMXWriter *iface)
 
static HRESULT WINAPI SAXContentHandler_QueryInterface (ISAXContentHandler *iface, REFIID riid, void **obj)
 
static ULONG WINAPI SAXContentHandler_AddRef (ISAXContentHandler *iface)
 
static ULONG WINAPI SAXContentHandler_Release (ISAXContentHandler *iface)
 
static HRESULT WINAPI SAXContentHandler_putDocumentLocator (ISAXContentHandler *iface, ISAXLocator *locator)
 
static HRESULT WINAPI SAXContentHandler_startDocument (ISAXContentHandler *iface)
 
static HRESULT WINAPI SAXContentHandler_endDocument (ISAXContentHandler *iface)
 
static HRESULT WINAPI SAXContentHandler_startPrefixMapping (ISAXContentHandler *iface, const WCHAR *prefix, int nprefix, const WCHAR *uri, int nuri)
 
static HRESULT WINAPI SAXContentHandler_endPrefixMapping (ISAXContentHandler *iface, const WCHAR *prefix, int nprefix)
 
static void mxwriter_write_attribute (mxwriter *writer, const WCHAR *qname, int qname_len, const WCHAR *value, int value_len, BOOL escape)
 
static void mxwriter_write_starttag (mxwriter *writer, const WCHAR *qname, int len)
 
static HRESULT WINAPI SAXContentHandler_startElement (ISAXContentHandler *iface, const WCHAR *namespaceUri, int nnamespaceUri, const WCHAR *local_name, int nlocal_name, const WCHAR *QName, int nQName, ISAXAttributes *attr)
 
static HRESULT WINAPI SAXContentHandler_endElement (ISAXContentHandler *iface, const WCHAR *namespaceUri, int nnamespaceUri, const WCHAR *local_name, int nlocal_name, const WCHAR *QName, int nQName)
 
static HRESULT WINAPI SAXContentHandler_characters (ISAXContentHandler *iface, const WCHAR *chars, int nchars)
 
static HRESULT WINAPI SAXContentHandler_ignorableWhitespace (ISAXContentHandler *iface, const WCHAR *chars, int nchars)
 
static HRESULT WINAPI SAXContentHandler_processingInstruction (ISAXContentHandler *iface, const WCHAR *target, int ntarget, const WCHAR *data, int ndata)
 
static HRESULT WINAPI SAXContentHandler_skippedEntity (ISAXContentHandler *iface, const WCHAR *name, int nname)
 
static HRESULT WINAPI SAXLexicalHandler_QueryInterface (ISAXLexicalHandler *iface, REFIID riid, void **obj)
 
static ULONG WINAPI SAXLexicalHandler_AddRef (ISAXLexicalHandler *iface)
 
static ULONG WINAPI SAXLexicalHandler_Release (ISAXLexicalHandler *iface)
 
static HRESULT WINAPI SAXLexicalHandler_startDTD (ISAXLexicalHandler *iface, const WCHAR *name, int name_len, const WCHAR *publicId, int publicId_len, const WCHAR *systemId, int systemId_len)
 
static HRESULT WINAPI SAXLexicalHandler_endDTD (ISAXLexicalHandler *iface)
 
static HRESULT WINAPI SAXLexicalHandler_startEntity (ISAXLexicalHandler *iface, const WCHAR *name, int len)
 
static HRESULT WINAPI SAXLexicalHandler_endEntity (ISAXLexicalHandler *iface, const WCHAR *name, int len)
 
static HRESULT WINAPI SAXLexicalHandler_startCDATA (ISAXLexicalHandler *iface)
 
static HRESULT WINAPI SAXLexicalHandler_endCDATA (ISAXLexicalHandler *iface)
 
static HRESULT WINAPI SAXLexicalHandler_comment (ISAXLexicalHandler *iface, const WCHAR *chars, int nchars)
 
static HRESULT WINAPI SAXDeclHandler_QueryInterface (ISAXDeclHandler *iface, REFIID riid, void **obj)
 
static ULONG WINAPI SAXDeclHandler_AddRef (ISAXDeclHandler *iface)
 
static ULONG WINAPI SAXDeclHandler_Release (ISAXDeclHandler *iface)
 
static HRESULT WINAPI SAXDeclHandler_elementDecl (ISAXDeclHandler *iface, const WCHAR *name, int n_name, const WCHAR *model, int n_model)
 
static HRESULT WINAPI SAXDeclHandler_attributeDecl (ISAXDeclHandler *iface, const WCHAR *element, int n_element, const WCHAR *attr, int n_attr, const WCHAR *type, int n_type, const WCHAR *Default, int n_default, const WCHAR *value, int n_value)
 
static HRESULT WINAPI SAXDeclHandler_internalEntityDecl (ISAXDeclHandler *iface, const WCHAR *name, int n_name, const WCHAR *value, int n_value)
 
static HRESULT WINAPI SAXDeclHandler_externalEntityDecl (ISAXDeclHandler *iface, const WCHAR *name, int n_name, const WCHAR *publicId, int n_publicId, const WCHAR *systemId, int n_systemId)
 
static HRESULT WINAPI VBSAXDeclHandler_QueryInterface (IVBSAXDeclHandler *iface, REFIID riid, void **obj)
 
static ULONG WINAPI VBSAXDeclHandler_AddRef (IVBSAXDeclHandler *iface)
 
static ULONG WINAPI VBSAXDeclHandler_Release (IVBSAXDeclHandler *iface)
 
static HRESULT WINAPI VBSAXDeclHandler_GetTypeInfoCount (IVBSAXDeclHandler *iface, UINT *pctinfo)
 
static HRESULT WINAPI VBSAXDeclHandler_GetTypeInfo (IVBSAXDeclHandler *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI VBSAXDeclHandler_GetIDsOfNames (IVBSAXDeclHandler *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI VBSAXDeclHandler_Invoke (IVBSAXDeclHandler *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI VBSAXDeclHandler_elementDecl (IVBSAXDeclHandler *iface, BSTR *name, BSTR *model)
 
static HRESULT WINAPI VBSAXDeclHandler_attributeDecl (IVBSAXDeclHandler *iface, BSTR *element, BSTR *attr, BSTR *type, BSTR *default_value, BSTR *value)
 
static HRESULT WINAPI VBSAXDeclHandler_internalEntityDecl (IVBSAXDeclHandler *iface, BSTR *name, BSTR *value)
 
static HRESULT WINAPI VBSAXDeclHandler_externalEntityDecl (IVBSAXDeclHandler *iface, BSTR *name, BSTR *publicid, BSTR *systemid)
 
static HRESULT WINAPI VBSAXLexicalHandler_QueryInterface (IVBSAXLexicalHandler *iface, REFIID riid, void **obj)
 
static ULONG WINAPI VBSAXLexicalHandler_AddRef (IVBSAXLexicalHandler *iface)
 
static ULONG WINAPI VBSAXLexicalHandler_Release (IVBSAXLexicalHandler *iface)
 
static HRESULT WINAPI VBSAXLexicalHandler_GetTypeInfoCount (IVBSAXLexicalHandler *iface, UINT *pctinfo)
 
static HRESULT WINAPI VBSAXLexicalHandler_GetTypeInfo (IVBSAXLexicalHandler *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI VBSAXLexicalHandler_GetIDsOfNames (IVBSAXLexicalHandler *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI VBSAXLexicalHandler_Invoke (IVBSAXLexicalHandler *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI VBSAXLexicalHandler_startDTD (IVBSAXLexicalHandler *iface, BSTR *name, BSTR *publicId, BSTR *systemId)
 
static HRESULT WINAPI VBSAXLexicalHandler_endDTD (IVBSAXLexicalHandler *iface)
 
static HRESULT WINAPI VBSAXLexicalHandler_startEntity (IVBSAXLexicalHandler *iface, BSTR *name)
 
static HRESULT WINAPI VBSAXLexicalHandler_endEntity (IVBSAXLexicalHandler *iface, BSTR *name)
 
static HRESULT WINAPI VBSAXLexicalHandler_startCDATA (IVBSAXLexicalHandler *iface)
 
static HRESULT WINAPI VBSAXLexicalHandler_endCDATA (IVBSAXLexicalHandler *iface)
 
static HRESULT WINAPI VBSAXLexicalHandler_comment (IVBSAXLexicalHandler *iface, BSTR *chars)
 
static HRESULT WINAPI VBSAXContentHandler_QueryInterface (IVBSAXContentHandler *iface, REFIID riid, void **obj)
 
static ULONG WINAPI VBSAXContentHandler_AddRef (IVBSAXContentHandler *iface)
 
static ULONG WINAPI VBSAXContentHandler_Release (IVBSAXContentHandler *iface)
 
static HRESULT WINAPI VBSAXContentHandler_GetTypeInfoCount (IVBSAXContentHandler *iface, UINT *pctinfo)
 
static HRESULT WINAPI VBSAXContentHandler_GetTypeInfo (IVBSAXContentHandler *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI VBSAXContentHandler_GetIDsOfNames (IVBSAXContentHandler *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI VBSAXContentHandler_Invoke (IVBSAXContentHandler *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI VBSAXContentHandler_putref_documentLocator (IVBSAXContentHandler *iface, IVBSAXLocator *locator)
 
static HRESULT WINAPI VBSAXContentHandler_startDocument (IVBSAXContentHandler *iface)
 
static HRESULT WINAPI VBSAXContentHandler_endDocument (IVBSAXContentHandler *iface)
 
static HRESULT WINAPI VBSAXContentHandler_startPrefixMapping (IVBSAXContentHandler *iface, BSTR *prefix, BSTR *uri)
 
static HRESULT WINAPI VBSAXContentHandler_endPrefixMapping (IVBSAXContentHandler *iface, BSTR *prefix)
 
static HRESULT WINAPI VBSAXContentHandler_startElement (IVBSAXContentHandler *iface, BSTR *namespaceURI, BSTR *localName, BSTR *QName, IVBSAXAttributes *attrs)
 
static HRESULT WINAPI VBSAXContentHandler_endElement (IVBSAXContentHandler *iface, BSTR *namespaceURI, BSTR *localName, BSTR *QName)
 
static HRESULT WINAPI VBSAXContentHandler_characters (IVBSAXContentHandler *iface, BSTR *chars)
 
static HRESULT WINAPI VBSAXContentHandler_ignorableWhitespace (IVBSAXContentHandler *iface, BSTR *chars)
 
static HRESULT WINAPI VBSAXContentHandler_processingInstruction (IVBSAXContentHandler *iface, BSTR *target, BSTR *data)
 
static HRESULT WINAPI VBSAXContentHandler_skippedEntity (IVBSAXContentHandler *iface, BSTR *name)
 
static HRESULT WINAPI SAXDTDHandler_QueryInterface (ISAXDTDHandler *iface, REFIID riid, void **obj)
 
static ULONG WINAPI SAXDTDHandler_AddRef (ISAXDTDHandler *iface)
 
static ULONG WINAPI SAXDTDHandler_Release (ISAXDTDHandler *iface)
 
static HRESULT WINAPI SAXDTDHandler_notationDecl (ISAXDTDHandler *iface, const WCHAR *name, INT n_name, const WCHAR *publicid, INT n_publicid, const WCHAR *systemid, INT n_systemid)
 
static HRESULT WINAPI SAXDTDHandler_unparsedEntityDecl (ISAXDTDHandler *iface, const WCHAR *name, INT nname, const WCHAR *publicid, INT npublicid, const WCHAR *systemid, INT nsystemid, const WCHAR *notation, INT nnotation)
 
static HRESULT WINAPI VBSAXDTDHandler_QueryInterface (IVBSAXDTDHandler *iface, REFIID riid, void **obj)
 
static ULONG WINAPI VBSAXDTDHandler_AddRef (IVBSAXDTDHandler *iface)
 
static ULONG WINAPI VBSAXDTDHandler_Release (IVBSAXDTDHandler *iface)
 
static HRESULT WINAPI VBSAXDTDHandler_GetTypeInfoCount (IVBSAXDTDHandler *iface, UINT *pctinfo)
 
static HRESULT WINAPI VBSAXDTDHandler_GetTypeInfo (IVBSAXDTDHandler *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI VBSAXDTDHandler_GetIDsOfNames (IVBSAXDTDHandler *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI VBSAXDTDHandler_Invoke (IVBSAXDTDHandler *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI VBSAXDTDHandler_notationDecl (IVBSAXDTDHandler *iface, BSTR *name, BSTR *publicId, BSTR *systemId)
 
static HRESULT WINAPI VBSAXDTDHandler_unparsedEntityDecl (IVBSAXDTDHandler *iface, BSTR *name, BSTR *publicId, BSTR *systemId, BSTR *notation)
 
static HRESULT WINAPI SAXErrorHandler_QueryInterface (ISAXErrorHandler *iface, REFIID riid, void **obj)
 
static ULONG WINAPI SAXErrorHandler_AddRef (ISAXErrorHandler *iface)
 
static ULONG WINAPI SAXErrorHandler_Release (ISAXErrorHandler *iface)
 
static HRESULT WINAPI SAXErrorHandler_error (ISAXErrorHandler *iface, ISAXLocator *locator, const WCHAR *message, HRESULT hr)
 
static HRESULT WINAPI SAXErrorHandler_fatalError (ISAXErrorHandler *iface, ISAXLocator *locator, const WCHAR *message, HRESULT hr)
 
static HRESULT WINAPI SAXErrorHandler_ignorableWarning (ISAXErrorHandler *iface, ISAXLocator *locator, const WCHAR *message, HRESULT hr)
 
static HRESULT WINAPI VBSAXErrorHandler_QueryInterface (IVBSAXErrorHandler *iface, REFIID riid, void **obj)
 
static ULONG WINAPI VBSAXErrorHandler_AddRef (IVBSAXErrorHandler *iface)
 
static ULONG WINAPI VBSAXErrorHandler_Release (IVBSAXErrorHandler *iface)
 
static HRESULT WINAPI VBSAXErrorHandler_GetTypeInfoCount (IVBSAXErrorHandler *iface, UINT *pctinfo)
 
static HRESULT WINAPI VBSAXErrorHandler_GetTypeInfo (IVBSAXErrorHandler *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI VBSAXErrorHandler_GetIDsOfNames (IVBSAXErrorHandler *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI VBSAXErrorHandler_Invoke (IVBSAXErrorHandler *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI VBSAXErrorHandler_error (IVBSAXErrorHandler *iface, IVBSAXLocator *locator, BSTR *message, LONG code)
 
static HRESULT WINAPI VBSAXErrorHandler_fatalError (IVBSAXErrorHandler *iface, IVBSAXLocator *locator, BSTR *message, LONG code)
 
static HRESULT WINAPI VBSAXErrorHandler_ignorableWarning (IVBSAXErrorHandler *iface, IVBSAXLocator *locator, BSTR *message, LONG code)
 
HRESULT MXWriter_create (MSXML_VERSION version, void **ppObj)
 
static HRESULT WINAPI MXAttributes_QueryInterface (IMXAttributes *iface, REFIID riid, void **ppObj)
 
static ULONG WINAPI MXAttributes_AddRef (IMXAttributes *iface)
 
static ULONG WINAPI MXAttributes_Release (IMXAttributes *iface)
 
static HRESULT WINAPI MXAttributes_GetTypeInfoCount (IMXAttributes *iface, UINT *pctinfo)
 
static HRESULT WINAPI MXAttributes_GetTypeInfo (IMXAttributes *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI MXAttributes_GetIDsOfNames (IMXAttributes *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI MXAttributes_Invoke (IMXAttributes *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI MXAttributes_addAttribute (IMXAttributes *iface, BSTR uri, BSTR localName, BSTR QName, BSTR type, BSTR value)
 
static HRESULT WINAPI MXAttributes_addAttributeFromIndex (IMXAttributes *iface, VARIANT atts, int index)
 
static HRESULT WINAPI MXAttributes_clear (IMXAttributes *iface)
 
static mxattributeget_attribute_byindex (mxattributes *attrs, int index)
 
static HRESULT WINAPI MXAttributes_removeAttribute (IMXAttributes *iface, int index)
 
static HRESULT WINAPI MXAttributes_setAttribute (IMXAttributes *iface, int index, BSTR uri, BSTR localName, BSTR QName, BSTR type, BSTR value)
 
static HRESULT WINAPI MXAttributes_setAttributes (IMXAttributes *iface, VARIANT atts)
 
static HRESULT WINAPI MXAttributes_setLocalName (IMXAttributes *iface, int index, BSTR localName)
 
static HRESULT WINAPI MXAttributes_setQName (IMXAttributes *iface, int index, BSTR QName)
 
static HRESULT WINAPI MXAttributes_setURI (IMXAttributes *iface, int index, BSTR uri)
 
static HRESULT WINAPI MXAttributes_setValue (IMXAttributes *iface, int index, BSTR value)
 
static HRESULT WINAPI SAXAttributes_QueryInterface (ISAXAttributes *iface, REFIID riid, void **ppObj)
 
static ULONG WINAPI SAXAttributes_AddRef (ISAXAttributes *iface)
 
static ULONG WINAPI SAXAttributes_Release (ISAXAttributes *iface)
 
static HRESULT WINAPI SAXAttributes_getLength (ISAXAttributes *iface, int *length)
 
static HRESULT WINAPI SAXAttributes_getURI (ISAXAttributes *iface, int index, const WCHAR **uri, int *len)
 
static HRESULT WINAPI SAXAttributes_getLocalName (ISAXAttributes *iface, int index, const WCHAR **name, int *len)
 
static HRESULT WINAPI SAXAttributes_getQName (ISAXAttributes *iface, int index, const WCHAR **qname, int *length)
 
static HRESULT WINAPI SAXAttributes_getName (ISAXAttributes *iface, int index, const WCHAR **uri, int *uri_len, const WCHAR **local, int *local_len, const WCHAR **qname, int *qname_len)
 
static HRESULT WINAPI SAXAttributes_getIndexFromName (ISAXAttributes *iface, const WCHAR *uri, int uri_len, const WCHAR *name, int len, int *index)
 
static HRESULT WINAPI SAXAttributes_getIndexFromQName (ISAXAttributes *iface, const WCHAR *qname, int len, int *index)
 
static HRESULT WINAPI SAXAttributes_getType (ISAXAttributes *iface, int index, const WCHAR **type, int *len)
 
static HRESULT WINAPI SAXAttributes_getTypeFromName (ISAXAttributes *iface, const WCHAR *pUri, int nUri, const WCHAR *pLocalName, int nLocalName, const WCHAR **pType, int *nType)
 
static HRESULT WINAPI SAXAttributes_getTypeFromQName (ISAXAttributes *iface, const WCHAR *pQName, int nQName, const WCHAR **pType, int *nType)
 
static HRESULT WINAPI SAXAttributes_getValue (ISAXAttributes *iface, int index, const WCHAR **value, int *len)
 
static HRESULT WINAPI SAXAttributes_getValueFromName (ISAXAttributes *iface, const WCHAR *uri, int uri_len, const WCHAR *name, int name_len, const WCHAR **value, int *value_len)
 
static HRESULT WINAPI SAXAttributes_getValueFromQName (ISAXAttributes *iface, const WCHAR *qname, int qname_len, const WCHAR **value, int *value_len)
 
static HRESULT WINAPI VBSAXAttributes_QueryInterface (IVBSAXAttributes *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI VBSAXAttributes_AddRef (IVBSAXAttributes *iface)
 
static ULONG WINAPI VBSAXAttributes_Release (IVBSAXAttributes *iface)
 
static HRESULT WINAPI VBSAXAttributes_GetTypeInfoCount (IVBSAXAttributes *iface, UINT *pctinfo)
 
static HRESULT WINAPI VBSAXAttributes_GetTypeInfo (IVBSAXAttributes *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI VBSAXAttributes_GetIDsOfNames (IVBSAXAttributes *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI VBSAXAttributes_Invoke (IVBSAXAttributes *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI VBSAXAttributes_get_length (IVBSAXAttributes *iface, int *len)
 
static HRESULT WINAPI VBSAXAttributes_getURI (IVBSAXAttributes *iface, int index, BSTR *uri)
 
static HRESULT WINAPI VBSAXAttributes_getLocalName (IVBSAXAttributes *iface, int index, BSTR *name)
 
static HRESULT WINAPI VBSAXAttributes_getQName (IVBSAXAttributes *iface, int index, BSTR *qname)
 
static HRESULT WINAPI VBSAXAttributes_getIndexFromName (IVBSAXAttributes *iface, BSTR uri, BSTR name, int *index)
 
static HRESULT WINAPI VBSAXAttributes_getIndexFromQName (IVBSAXAttributes *iface, BSTR qname, int *index)
 
static HRESULT WINAPI VBSAXAttributes_getType (IVBSAXAttributes *iface, int index, BSTR *type)
 
static HRESULT WINAPI VBSAXAttributes_getTypeFromName (IVBSAXAttributes *iface, BSTR uri, BSTR name, BSTR *type)
 
static HRESULT WINAPI VBSAXAttributes_getTypeFromQName (IVBSAXAttributes *iface, BSTR qname, BSTR *type)
 
static HRESULT WINAPI VBSAXAttributes_getValue (IVBSAXAttributes *iface, int index, BSTR *value)
 
static HRESULT WINAPI VBSAXAttributes_getValueFromName (IVBSAXAttributes *iface, BSTR uri, BSTR name, BSTR *value)
 
static HRESULT WINAPI VBSAXAttributes_getValueFromQName (IVBSAXAttributes *iface, BSTR qname, BSTR *value)
 
HRESULT SAXAttributes_create (MSXML_VERSION version, void **ppObj)
 

Variables

static const WCHAR emptyW [] = {0}
 
static const WCHAR spaceW [] = {' '}
 
static const WCHAR quotW [] = {'\"'}
 
static const WCHAR closetagW [] = {'>','\r','\n'}
 
static const WCHAR crlfW [] = {'\r','\n'}
 
static const WCHAR entityW [] = {'<','!','E','N','T','I','T','Y',' '}
 
static const WCHAR publicW [] = {'P','U','B','L','I','C',' '}
 
static const WCHAR systemW [] = {'S','Y','S','T','E','M',' '}
 
static const WCHAR iso_8859_1W [] = {'i','s','o','-','8','8','5','9','-','1',0}
 
static const WCHAR iso_8859_2W [] = {'i','s','o','-','8','8','5','9','-','2',0}
 
static const WCHAR iso_8859_3W [] = {'i','s','o','-','8','8','5','9','-','3',0}
 
static const WCHAR iso_8859_4W [] = {'i','s','o','-','8','8','5','9','-','4',0}
 
static const WCHAR iso_8859_5W [] = {'i','s','o','-','8','8','5','9','-','5',0}
 
static const WCHAR iso_8859_7W [] = {'i','s','o','-','8','8','5','9','-','7',0}
 
static const WCHAR iso_8859_9W [] = {'i','s','o','-','8','8','5','9','-','9',0}
 
static const WCHAR iso_8859_13W [] = {'i','s','o','-','8','8','5','9','-','1','3',0}
 
static const WCHAR iso_8859_15W [] = {'i','s','o','-','8','8','5','9','-','1','5',0}
 
static const WCHAR utf16W [] = {'U','T','F','-','1','6',0}
 
static const WCHAR utf8W [] = {'U','T','F','-','8',0}
 
static const struct xml_encoding_data xml_encoding_map []
 
static const struct IMXWriterVtbl MXWriterVtbl
 
static const struct ISAXContentHandlerVtbl SAXContentHandlerVtbl
 
static const struct ISAXLexicalHandlerVtbl SAXLexicalHandlerVtbl
 
static const ISAXDeclHandlerVtbl SAXDeclHandlerVtbl
 
static const IVBSAXDeclHandlerVtbl VBSAXDeclHandlerVtbl
 
static const IVBSAXLexicalHandlerVtbl VBSAXLexicalHandlerVtbl
 
static const IVBSAXContentHandlerVtbl VBSAXContentHandlerVtbl
 
static const ISAXDTDHandlerVtbl SAXDTDHandlerVtbl
 
static const IVBSAXDTDHandlerVtbl VBSAXDTDHandlerVtbl
 
static const ISAXErrorHandlerVtbl SAXErrorHandlerVtbl
 
static const IVBSAXErrorHandlerVtbl VBSAXErrorHandlerVtbl
 
static const tid_t mxwriter_iface_tids []
 
static dispex_static_data_t mxwriter_dispex
 
static const IMXAttributesVtbl MXAttributesVtbl
 
static const ISAXAttributesVtbl SAXAttributesVtbl
 
static const struct IVBSAXAttributesVtbl VBSAXAttributesVtbl
 
static const tid_t mxattrs_iface_tids []
 
static dispex_static_data_t mxattrs_dispex
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file mxwriter.c.

Enumeration Type Documentation

◆ escape_mode

Enumerator
EscapeValue 
EscapeText 

Definition at line 112 of file mxwriter.c.

113{
escape_mode
Definition: mxwriter.c:113
@ EscapeText
Definition: mxwriter.c:115
@ EscapeValue
Definition: mxwriter.c:114

◆ mxwriter_prop

Enumerator
MXWriter_BOM 
MXWriter_DisableEscaping 
MXWriter_Indent 
MXWriter_OmitXmlDecl 
MXWriter_Standalone 
MXWriter_LastProp 

Definition at line 102 of file mxwriter.c.

103{
104 MXWriter_BOM = 0,
mxwriter_prop
Definition: mxwriter.c:103
@ MXWriter_Standalone
Definition: mxwriter.c:108
@ MXWriter_DisableEscaping
Definition: mxwriter.c:105
@ MXWriter_LastProp
Definition: mxwriter.c:109
@ MXWriter_OmitXmlDecl
Definition: mxwriter.c:107
@ MXWriter_BOM
Definition: mxwriter.c:104
@ MXWriter_Indent
Definition: mxwriter.c:106

◆ xml_encoding

Enumerator
XmlEncoding_ISO_8859_1 
XmlEncoding_ISO_8859_13 
XmlEncoding_ISO_8859_15 
XmlEncoding_ISO_8859_2 
XmlEncoding_ISO_8859_3 
XmlEncoding_ISO_8859_4 
XmlEncoding_ISO_8859_5 
XmlEncoding_ISO_8859_7 
XmlEncoding_ISO_8859_9 
XmlEncoding_UTF16 
XmlEncoding_UTF8 
XmlEncoding_Unknown 
XmlEncoding_USASCII 
XmlEncoding_UTF16 
XmlEncoding_UTF8 
XmlEncoding_Unknown 

Definition at line 53 of file mxwriter.c.

54{
xml_encoding
Definition: mxwriter.c:54
@ XmlEncoding_UTF8
Definition: mxwriter.c:65
@ XmlEncoding_ISO_8859_5
Definition: mxwriter.c:61
@ XmlEncoding_ISO_8859_7
Definition: mxwriter.c:62
@ XmlEncoding_ISO_8859_9
Definition: mxwriter.c:63
@ XmlEncoding_ISO_8859_1
Definition: mxwriter.c:55
@ XmlEncoding_Unknown
Definition: mxwriter.c:66
@ XmlEncoding_ISO_8859_13
Definition: mxwriter.c:56
@ XmlEncoding_ISO_8859_3
Definition: mxwriter.c:59
@ XmlEncoding_UTF16
Definition: mxwriter.c:64
@ XmlEncoding_ISO_8859_2
Definition: mxwriter.c:58
@ XmlEncoding_ISO_8859_15
Definition: mxwriter.c:57
@ XmlEncoding_ISO_8859_4
Definition: mxwriter.c:60

Function Documentation

◆ close_element_starttag()

static void close_element_starttag ( mxwriter writer)
static

Definition at line 610 of file mxwriter.c.

611{
612 static const WCHAR gtW[] = {'>'};
613 if (!writer->element) return;
614 write_output_buffer(writer, gtW, 1);
615}
static const WCHAR gtW[]
Definition: reader.c:96
static HRESULT write_output_buffer(mxwriter *writer, const WCHAR *data, int len)
Definition: mxwriter.c:313
BSTR element
Definition: mxwriter.c:167
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by flush_output_buffer(), mxwriter_write_starttag(), SAXContentHandler_characters(), and SAXLexicalHandler_comment().

◆ close_output_buffer()

static void close_output_buffer ( mxwriter writer)
static

Definition at line 460 of file mxwriter.c.

461{
462 encoded_buffer *cur, *cur2;
463
464 heap_free(writer->buffer.encoded.data);
465
467 {
468 list_remove(&cur->entry);
470 heap_free(cur);
471 }
472
474 get_code_page(writer->xml_enc, &writer->buffer.code_page);
475 writer->buffer.utf16_total = 0;
476 list_init(&writer->buffer.blocks);
477}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void list_init(struct list_entry *head)
Definition: list.h:51
FxCollectionEntry * cur
uint32_t entry
Definition: isohybrid.c:63
static void free_encoded_buffer(encoded_buffer *buffer)
Definition: mxwriter.c:260
static HRESULT get_code_page(xml_encoding encoding, UINT *cp)
Definition: mxwriter.c:265
static HRESULT init_encoded_buffer(encoded_buffer *buffer)
Definition: mxwriter.c:247
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
char * data
Definition: mxwriter.c:121
output_buffer buffer
Definition: mxwriter.c:171
xml_encoding xml_enc
Definition: mxwriter.c:163
UINT utf16_total
Definition: mxwriter.c:130
UINT code_page
Definition: mxwriter.c:129
struct list blocks
Definition: mxwriter.c:131
encoded_buffer encoded
Definition: mxwriter.c:128

Referenced by reset_output_buffer().

◆ flush_output_buffer()

static HRESULT flush_output_buffer ( mxwriter This)
inlinestatic

Definition at line 661 of file mxwriter.c.

662{
665 This->cdata = FALSE;
667}
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
static HRESULT write_data_to_stream(mxwriter *writer)
Definition: mxwriter.c:586
static void set_element_name(mxwriter *This, const WCHAR *name, int len)
Definition: mxwriter.c:652
static void close_element_starttag(mxwriter *writer)
Definition: mxwriter.c:610

Referenced by mxwriter_flush(), mxwriter_get_output(), mxwriter_put_encoding(), mxwriter_put_output(), mxwriter_Release(), save_all_changes(), and SAXContentHandler_endDocument().

◆ free_encoded_buffer()

static void free_encoded_buffer ( encoded_buffer buffer)
static

Definition at line 260 of file mxwriter.c.

261{
262 heap_free(buffer->data);
263}
GLuint buffer
Definition: glext.h:5915

Referenced by close_output_buffer(), and free_output_buffer().

◆ free_output_buffer()

static void free_output_buffer ( output_buffer buffer)
static

Definition at line 299 of file mxwriter.c.

300{
301 encoded_buffer *cur, *cur2;
302
303 free_encoded_buffer(&buffer->encoded);
304
306 {
307 list_remove(&cur->entry);
309 heap_free(cur);
310 }
311}

Referenced by mxwriter_Release().

◆ get_attribute_byindex()

static mxattribute * get_attribute_byindex ( mxattributes attrs,
int  index 
)
static

Definition at line 2818 of file mxwriter.c.

2819{
2820 if (index < 0 || index >= attrs->length) return NULL;
2821 return &attrs->attr[index];
2822}
#define index(s, c)
Definition: various.h:29
mxattribute * attr
Definition: mxwriter.c:193

Referenced by MXAttributes_removeAttribute(), MXAttributes_setLocalName(), MXAttributes_setQName(), MXAttributes_setURI(), and MXAttributes_setValue().

◆ get_code_page()

static HRESULT get_code_page ( xml_encoding  encoding,
UINT cp 
)
static

Definition at line 265 of file mxwriter.c.

266{
267 const struct xml_encoding_data *data;
268
270 {
271 FIXME("unsupported encoding %d\n", encoding);
272 return E_NOTIMPL;
273 }
274
276 *cp = data->cp;
277
278 return S_OK;
279}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define S_OK
Definition: intsafe.h:52
POINT cp
Definition: magnifier.c:59
static const struct xml_encoding_data xml_encoding_map[]
Definition: mxwriter.c:88
static char * encoding
Definition: xmllint.c:155

Referenced by close_output_buffer(), and init_output_buffer().

◆ get_escaped_string()

static WCHAR * get_escaped_string ( const WCHAR str,
escape_mode  mode,
int len 
)
static

Definition at line 488 of file mxwriter.c.

489{
490 static const WCHAR ltW[] = {'&','l','t',';'};
491 static const WCHAR ampW[] = {'&','a','m','p',';'};
492 static const WCHAR equotW[] = {'&','q','u','o','t',';'};
493 static const WCHAR gtW[] = {'&','g','t',';'};
494
495 const int default_alloc = 100;
496 const int grow_thresh = 10;
497 int p = *len, conv_len;
498 WCHAR *ptr, *ret;
499
500 /* default buffer size to something if length is unknown */
501 conv_len = max(2**len, default_alloc);
502 ptr = ret = heap_alloc(conv_len*sizeof(WCHAR));
503
504 while (p)
505 {
506 if (ptr - ret > conv_len - grow_thresh)
507 {
508 int written = ptr - ret;
509 conv_len *= 2;
510 ptr = ret = heap_realloc(ret, conv_len*sizeof(WCHAR));
511 ptr += written;
512 }
513
514 switch (*str)
515 {
516 case '<':
517 memcpy(ptr, ltW, sizeof(ltW));
518 ptr += ARRAY_SIZE(ltW);
519 break;
520 case '&':
521 memcpy(ptr, ampW, sizeof(ampW));
522 ptr += ARRAY_SIZE(ampW);
523 break;
524 case '>':
525 memcpy(ptr, gtW, sizeof(gtW));
526 ptr += ARRAY_SIZE(gtW);
527 break;
528 case '"':
529 if (mode == EscapeValue)
530 {
531 memcpy(ptr, equotW, sizeof(equotW));
532 ptr += ARRAY_SIZE(equotW);
533 break;
534 }
535 /* fallthrough for text mode */
536 default:
537 *ptr++ = *str;
538 break;
539 }
540
541 str++;
542 p--;
543 }
544
545 *len = ptr-ret;
546 *++ptr = 0;
547
548 return ret;
549}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:71
#define ARRAY_SIZE(A)
Definition: main.h:20
static const WCHAR ltW[]
Definition: reader.c:95
GLenum mode
Definition: glext.h:6217
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static PVOID ptr
Definition: dispmode.c:27
const WCHAR * str
#define max(a, b)
Definition: svc.c:63
int ret

Referenced by mxwriter_write_attribute(), and SAXContentHandler_characters().

◆ impl_from_IMXAttributes()

◆ impl_from_IMXWriter()

◆ impl_from_ISAXAttributes()

◆ impl_from_ISAXContentHandler()

◆ impl_from_ISAXDeclHandler()

static mxwriter * impl_from_ISAXDeclHandler ( ISAXDeclHandler *  iface)
inlinestatic

◆ impl_from_ISAXDTDHandler()

static mxwriter * impl_from_ISAXDTDHandler ( ISAXDTDHandler *  iface)
inlinestatic

◆ impl_from_ISAXErrorHandler()

static mxwriter * impl_from_ISAXErrorHandler ( ISAXErrorHandler *  iface)
inlinestatic

◆ impl_from_ISAXLexicalHandler()

◆ impl_from_IVBSAXAttributes()

◆ impl_from_IVBSAXContentHandler()

◆ impl_from_IVBSAXDeclHandler()

◆ impl_from_IVBSAXDTDHandler()

◆ impl_from_IVBSAXErrorHandler()

◆ impl_from_IVBSAXLexicalHandler()

◆ init_encoded_buffer()

static HRESULT init_encoded_buffer ( encoded_buffer buffer)
static

Definition at line 247 of file mxwriter.c.

248{
249 const int initial_len = 0x1000;
250 buffer->data = heap_alloc(initial_len);
251 if (!buffer->data) return E_OUTOFMEMORY;
252
253 memset(buffer->data, 0, 4);
254 buffer->allocated = initial_len;
255 buffer->written = 0;
256
257 return S_OK;
258}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define memset(x, y, z)
Definition: compat.h:39

Referenced by close_output_buffer(), init_output_buffer(), and write_output_buffer().

◆ init_output_buffer()

static HRESULT init_output_buffer ( xml_encoding  encoding,
output_buffer buffer 
)
static

Definition at line 281 of file mxwriter.c.

282{
283 HRESULT hr;
284
285 hr = get_code_page(encoding, &buffer->code_page);
286 if (hr != S_OK)
287 return hr;
288
289 hr = init_encoded_buffer(&buffer->encoded);
290 if (hr != S_OK)
291 return hr;
292
293 list_init(&buffer->blocks);
294 buffer->utf16_total = 0;
295
296 return S_OK;
297}
HRESULT hr
Definition: shlfolder.c:183

◆ MXAttributes_addAttribute()

static HRESULT WINAPI MXAttributes_addAttribute ( IMXAttributes *  iface,
BSTR  uri,
BSTR  localName,
BSTR  QName,
BSTR  type,
BSTR  value 
)
static

Definition at line 2759 of file mxwriter.c.

2761{
2764 HRESULT hr;
2765
2766 TRACE("(%p)->(%s %s %s %s %s)\n", This, debugstr_w(uri), debugstr_w(localName),
2768
2769 if ((!uri || !localName || !QName || !type || !value) && This->class_version != MSXML6)
2770 return E_INVALIDARG;
2771
2772 /* ensure array is large enough */
2774 if (hr != S_OK) return hr;
2775
2776 attr = &This->attr[This->length];
2777
2778 attr->qname = SysAllocString(QName);
2779 attr->local = SysAllocString(localName);
2780 attr->uri = SysAllocString(uri);
2781 attr->type = SysAllocString(type ? type : emptyW);
2783 This->length++;
2784
2785 return S_OK;
2786}
#define E_INVALIDARG
Definition: ddrawi.h:101
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define debugstr_w
Definition: kernel32.h:32
const char * uri
Definition: sec_mgr.c:1588
@ MSXML6
Definition: msxml_private.h:40
static const WCHAR emptyW[]
Definition: mxwriter.c:43
static mxattributes * impl_from_IMXAttributes(IMXAttributes *iface)
Definition: mxwriter.c:198
static HRESULT mxattributes_grow(mxattributes *This)
Definition: mxwriter.c:213
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
#define TRACE(s)
Definition: solgame.cpp:4
Definition: cookie.c:202
WCHAR * value
Definition: cookie.c:204
Definition: pdh_main.c:94

◆ MXAttributes_addAttributeFromIndex()

static HRESULT WINAPI MXAttributes_addAttributeFromIndex ( IMXAttributes *  iface,
VARIANT  atts,
int  index 
)
static

Definition at line 2788 of file mxwriter.c.

2790{
2792 FIXME("(%p)->(%s %d): stub\n", This, debugstr_variant(&atts), index);
2793 return E_NOTIMPL;
2794}
_In_ uint16_t _Out_ ULONG * atts
Definition: btrfs_drv.h:1107
GLuint index
Definition: glext.h:6031
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46

◆ MXAttributes_AddRef()

static ULONG WINAPI MXAttributes_AddRef ( IMXAttributes *  iface)
static

Definition at line 2683 of file mxwriter.c.

2684{
2687 TRACE("(%p)->(%d)\n", This, ref );
2688 return ref;
2689}
#define InterlockedIncrement
Definition: armddk.h:53
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ MXAttributes_clear()

static HRESULT WINAPI MXAttributes_clear ( IMXAttributes *  iface)
static

Definition at line 2796 of file mxwriter.c.

2797{
2799 int i;
2800
2801 TRACE("(%p)\n", This);
2802
2803 for (i = 0; i < This->length; i++)
2804 {
2805 SysFreeString(This->attr[i].qname);
2806 SysFreeString(This->attr[i].local);
2807 SysFreeString(This->attr[i].uri);
2808 SysFreeString(This->attr[i].type);
2809 SysFreeString(This->attr[i].value);
2810 memset(&This->attr[i], 0, sizeof(mxattribute));
2811 }
2812
2813 This->length = 0;
2814
2815 return S_OK;
2816}
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
Definition: glfuncs.h:248
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271

◆ MXAttributes_GetIDsOfNames()

static HRESULT WINAPI MXAttributes_GetIDsOfNames ( IMXAttributes *  iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 2730 of file mxwriter.c.

2737{
2739 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface,
2740 riid, rgszNames, cNames, lcid, rgDispId);
2741}
REFIID riid
Definition: atlbase.h:39

◆ MXAttributes_GetTypeInfo()

static HRESULT WINAPI MXAttributes_GetTypeInfo ( IMXAttributes *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 2724 of file mxwriter.c.

2725{
2727 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
2728}

◆ MXAttributes_GetTypeInfoCount()

static HRESULT WINAPI MXAttributes_GetTypeInfoCount ( IMXAttributes *  iface,
UINT pctinfo 
)
static

Definition at line 2718 of file mxwriter.c.

2719{
2721 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
2722}

◆ mxattributes_grow()

static HRESULT mxattributes_grow ( mxattributes This)
static

Definition at line 213 of file mxwriter.c.

214{
215 if (This->length < This->allocated) return S_OK;
216
217 This->allocated *= 2;
218 This->attr = heap_realloc(This->attr, This->allocated*sizeof(mxattribute));
219
220 return This->attr ? S_OK : E_OUTOFMEMORY;
221}

Referenced by MXAttributes_addAttribute().

◆ MXAttributes_Invoke()

static HRESULT WINAPI MXAttributes_Invoke ( IMXAttributes *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 2743 of file mxwriter.c.

2753{
2755 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface,
2756 dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
2757}
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531

◆ MXAttributes_QueryInterface()

static HRESULT WINAPI MXAttributes_QueryInterface ( IMXAttributes *  iface,
REFIID  riid,
void **  ppObj 
)
static

Definition at line 2646 of file mxwriter.c.

2647{
2649
2650 TRACE("(%p)->(%s %p)\n", This, debugstr_guid( riid ), ppObj);
2651
2652 *ppObj = NULL;
2653
2654 if ( IsEqualGUID( riid, &IID_IUnknown ) ||
2656 IsEqualGUID( riid, &IID_IMXAttributes ))
2657 {
2658 *ppObj = iface;
2659 }
2660 else if ( IsEqualGUID( riid, &IID_ISAXAttributes ))
2661 {
2662 *ppObj = &This->ISAXAttributes_iface;
2663 }
2664 else if ( IsEqualGUID( riid, &IID_IVBSAXAttributes ))
2665 {
2666 *ppObj = &This->IVBSAXAttributes_iface;
2667 }
2668 else if (dispex_query_interface(&This->dispex, riid, ppObj))
2669 {
2670 return *ppObj ? S_OK : E_NOINTERFACE;
2671 }
2672 else
2673 {
2674 FIXME("interface %s not implemented\n", debugstr_guid(riid));
2675 return E_NOINTERFACE;
2676 }
2677
2678 IMXAttributes_AddRef( iface );
2679
2680 return S_OK;
2681}
const GUID IID_IUnknown
#define debugstr_guid
Definition: kernel32.h:35
BOOL dispex_query_interface(DispatchEx *This, REFIID riid, void **ppv)
Definition: dispex.c:1656
const GUID IID_IDispatch
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ MXAttributes_Release()

static ULONG WINAPI MXAttributes_Release ( IMXAttributes *  iface)
static

Definition at line 2691 of file mxwriter.c.

2692{
2694 LONG ref = InterlockedDecrement( &This->ref );
2695
2696 TRACE("(%p)->(%d)\n", This, ref);
2697
2698 if (ref == 0)
2699 {
2700 int i;
2701
2702 for (i = 0; i < This->length; i++)
2703 {
2704 SysFreeString(This->attr[i].qname);
2705 SysFreeString(This->attr[i].local);
2706 SysFreeString(This->attr[i].uri);
2707 SysFreeString(This->attr[i].type);
2708 SysFreeString(This->attr[i].value);
2709 }
2710
2711 heap_free(This->attr);
2712 heap_free(This);
2713 }
2714
2715 return ref;
2716}
#define InterlockedDecrement
Definition: armddk.h:52
long LONG
Definition: pedump.c:60

◆ MXAttributes_removeAttribute()

static HRESULT WINAPI MXAttributes_removeAttribute ( IMXAttributes *  iface,
int  index 
)
static

Definition at line 2824 of file mxwriter.c.

2825{
2828
2829 TRACE("(%p)->(%d)\n", This, index);
2830
2831 if (!(dst = get_attribute_byindex(This, index))) return E_INVALIDARG;
2832
2833 /* no need to remove last attribute, just make it inaccessible */
2834 if (index + 1 == This->length)
2835 {
2836 This->length--;
2837 return S_OK;
2838 }
2839
2840 memmove(dst, dst + 1, (This->length-index-1)*sizeof(*dst));
2841 This->length--;
2842
2843 return S_OK;
2844}
GLenum GLenum dst
Definition: glext.h:6340
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
static mxattribute * get_attribute_byindex(mxattributes *attrs, int index)
Definition: mxwriter.c:2818

◆ MXAttributes_setAttribute()

static HRESULT WINAPI MXAttributes_setAttribute ( IMXAttributes *  iface,
int  index,
BSTR  uri,
BSTR  localName,
BSTR  QName,
BSTR  type,
BSTR  value 
)
static

Definition at line 2846 of file mxwriter.c.

2848{
2850 FIXME("(%p)->(%d %s %s %s %s %s): stub\n", This, index, debugstr_w(uri),
2851 debugstr_w(localName), debugstr_w(QName), debugstr_w(type), debugstr_w(value));
2852 return E_NOTIMPL;
2853}

◆ MXAttributes_setAttributes()

static HRESULT WINAPI MXAttributes_setAttributes ( IMXAttributes *  iface,
VARIANT  atts 
)
static

Definition at line 2855 of file mxwriter.c.

2856{
2858 FIXME("(%p)->(%s): stub\n", This, debugstr_variant(&atts));
2859 return E_NOTIMPL;
2860}

◆ MXAttributes_setLocalName()

static HRESULT WINAPI MXAttributes_setLocalName ( IMXAttributes *  iface,
int  index,
BSTR  localName 
)
static

Definition at line 2862 of file mxwriter.c.

2864{
2867
2868 TRACE("(%p)->(%d %s)\n", This, index, debugstr_w(localName));
2869
2871
2872 SysFreeString(attr->local);
2873 attr->local = SysAllocString(localName);
2874
2875 return S_OK;
2876}

◆ MXAttributes_setQName()

static HRESULT WINAPI MXAttributes_setQName ( IMXAttributes *  iface,
int  index,
BSTR  QName 
)
static

Definition at line 2878 of file mxwriter.c.

2879{
2882
2883 TRACE("(%p)->(%d %s)\n", This, index, debugstr_w(QName));
2884
2886
2887 SysFreeString(attr->qname);
2888 attr->qname = SysAllocString(QName);
2889
2890 return S_OK;
2891}

◆ MXAttributes_setURI()

static HRESULT WINAPI MXAttributes_setURI ( IMXAttributes *  iface,
int  index,
BSTR  uri 
)
static

Definition at line 2893 of file mxwriter.c.

2894{
2897
2898 TRACE("(%p)->(%d %s)\n", This, index, debugstr_w(uri));
2899
2901
2902 SysFreeString(attr->uri);
2903 attr->uri = SysAllocString(uri);
2904
2905 return S_OK;
2906}

◆ MXAttributes_setValue()

static HRESULT WINAPI MXAttributes_setValue ( IMXAttributes *  iface,
int  index,
BSTR  value 
)
static

Definition at line 2908 of file mxwriter.c.

2909{
2912
2913 TRACE("(%p)->(%d %s)\n", This, index, debugstr_w(value));
2914
2916
2919
2920 return S_OK;
2921}

◆ mxwriter_AddRef()

static ULONG WINAPI mxwriter_AddRef ( IMXWriter *  iface)
static

Definition at line 815 of file mxwriter.c.

816{
819
820 TRACE("(%p)->(%d)\n", This, ref);
821
822 return ref;
823}
static mxwriter * impl_from_IMXWriter(IMXWriter *iface)
Definition: mxwriter.c:691

◆ MXWriter_create()

HRESULT MXWriter_create ( MSXML_VERSION  version,
void **  ppObj 
)

Definition at line 2585 of file mxwriter.c.

2586{
2587 static const WCHAR version10W[] = {'1','.','0',0};
2588 mxwriter *This;
2589 HRESULT hr;
2590
2591 TRACE("(%p)\n", ppObj);
2592
2593 This = heap_alloc( sizeof (*This) );
2594 if(!This)
2595 return E_OUTOFMEMORY;
2596
2597 This->IMXWriter_iface.lpVtbl = &MXWriterVtbl;
2598 This->ISAXContentHandler_iface.lpVtbl = &SAXContentHandlerVtbl;
2599 This->ISAXLexicalHandler_iface.lpVtbl = &SAXLexicalHandlerVtbl;
2600 This->ISAXDeclHandler_iface.lpVtbl = &SAXDeclHandlerVtbl;
2601 This->ISAXDTDHandler_iface.lpVtbl = &SAXDTDHandlerVtbl;
2602 This->ISAXErrorHandler_iface.lpVtbl = &SAXErrorHandlerVtbl;
2603 This->IVBSAXDeclHandler_iface.lpVtbl = &VBSAXDeclHandlerVtbl;
2604 This->IVBSAXLexicalHandler_iface.lpVtbl = &VBSAXLexicalHandlerVtbl;
2605 This->IVBSAXContentHandler_iface.lpVtbl = &VBSAXContentHandlerVtbl;
2606 This->IVBSAXDTDHandler_iface.lpVtbl = &VBSAXDTDHandlerVtbl;
2607 This->IVBSAXErrorHandler_iface.lpVtbl = &VBSAXErrorHandlerVtbl;
2608 This->ref = 1;
2609 This->class_version = version;
2610
2611 This->props[MXWriter_BOM] = VARIANT_TRUE;
2612 This->props[MXWriter_DisableEscaping] = VARIANT_FALSE;
2613 This->props[MXWriter_Indent] = VARIANT_FALSE;
2614 This->props[MXWriter_OmitXmlDecl] = VARIANT_FALSE;
2615 This->props[MXWriter_Standalone] = VARIANT_FALSE;
2616 This->prop_changed = FALSE;
2617 This->encoding = SysAllocString(utf16W);
2618 This->version = SysAllocString(version10W);
2619 This->xml_enc = XmlEncoding_UTF16;
2620
2621 This->element = NULL;
2622 This->cdata = FALSE;
2623 This->indent = 0;
2624 This->text = FALSE;
2625 This->newline = FALSE;
2626
2627 This->dest = NULL;
2628
2629 hr = init_output_buffer(This->xml_enc, &This->buffer);
2630 if (hr != S_OK) {
2631 SysFreeString(This->encoding);
2632 SysFreeString(This->version);
2633 heap_free(This);
2634 return hr;
2635 }
2636
2637 init_dispex(&This->dispex, (IUnknown*)&This->IMXWriter_iface, &mxwriter_dispex);
2638
2639 *ppObj = &This->IMXWriter_iface;
2640
2641 TRACE("returning iface %p\n", *ppObj);
2642
2643 return S_OK;
2644}
static const WCHAR version[]
Definition: asmname.c:66
HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype)
Definition: dispex.c:919
static const IVBSAXErrorHandlerVtbl VBSAXErrorHandlerVtbl
Definition: mxwriter.c:2560
static const IVBSAXDeclHandlerVtbl VBSAXDeclHandlerVtbl
Definition: mxwriter.c:1903
static const IVBSAXDTDHandlerVtbl VBSAXDTDHandlerVtbl
Definition: mxwriter.c:2423
static dispex_static_data_t mxwriter_dispex
Definition: mxwriter.c:2578
static const struct ISAXContentHandlerVtbl SAXContentHandlerVtbl
Definition: mxwriter.c:1475
static const IVBSAXLexicalHandlerVtbl VBSAXLexicalHandlerVtbl
Definition: mxwriter.c:2030
static const ISAXDTDHandlerVtbl SAXDTDHandlerVtbl
Definition: mxwriter.c:2343
static const struct ISAXLexicalHandlerVtbl SAXLexicalHandlerVtbl
Definition: mxwriter.c:1637
static const ISAXErrorHandlerVtbl SAXErrorHandlerVtbl
Definition: mxwriter.c:2484
static const WCHAR utf16W[]
Definition: mxwriter.c:85
static const struct IMXWriterVtbl MXWriterVtbl
Definition: mxwriter.c:1134
static const IVBSAXContentHandlerVtbl VBSAXContentHandlerVtbl
Definition: mxwriter.c:2249
static const ISAXDeclHandlerVtbl SAXDeclHandlerVtbl
Definition: mxwriter.c:1795
void init_output_buffer(void)
Definition: utils.c:272

Referenced by DllGetClassObject().

◆ mxwriter_flush()

static HRESULT WINAPI mxwriter_flush ( IMXWriter *  iface)
static

Definition at line 1127 of file mxwriter.c.

1128{
1129 mxwriter *This = impl_from_IMXWriter( iface );
1130 TRACE("(%p)\n", This);
1131 return flush_output_buffer(This);
1132}
static HRESULT flush_output_buffer(mxwriter *This)
Definition: mxwriter.c:661

◆ mxwriter_get_byteOrderMark()

static HRESULT WINAPI mxwriter_get_byteOrderMark ( IMXWriter *  iface,
VARIANT_BOOL value 
)
static

Definition at line 1030 of file mxwriter.c.

1031{
1032 mxwriter *This = impl_from_IMXWriter( iface );
1033
1034 TRACE("(%p)->(%p)\n", This, value);
1036}
static HRESULT writer_get_property(const mxwriter *writer, mxwriter_prop property, VARIANT_BOOL *value)
Definition: mxwriter.c:684

◆ mxwriter_get_disableOutputEscaping()

static HRESULT WINAPI mxwriter_get_disableOutputEscaping ( IMXWriter *  iface,
VARIANT_BOOL value 
)
static

Definition at line 1119 of file mxwriter.c.

1120{
1121 mxwriter *This = impl_from_IMXWriter( iface );
1122
1123 TRACE("(%p)->(%p)\n", This, value);
1125}

◆ mxwriter_get_encoding()

static HRESULT WINAPI mxwriter_get_encoding ( IMXWriter *  iface,
BSTR encoding 
)
static

Definition at line 1008 of file mxwriter.c.

1009{
1010 mxwriter *This = impl_from_IMXWriter( iface );
1011
1012 TRACE("(%p)->(%p)\n", This, encoding);
1013
1014 if (!encoding) return E_POINTER;
1015
1016 *encoding = SysAllocString(This->encoding);
1017 if (!*encoding) return E_OUTOFMEMORY;
1018
1019 return S_OK;
1020}
#define E_POINTER
Definition: winerror.h:2365

◆ mxwriter_get_indent()

static HRESULT WINAPI mxwriter_get_indent ( IMXWriter *  iface,
VARIANT_BOOL value 
)
static

Definition at line 1046 of file mxwriter.c.

1047{
1048 mxwriter *This = impl_from_IMXWriter( iface );
1049
1050 TRACE("(%p)->(%p)\n", This, value);
1052}

◆ mxwriter_get_omitXMLDeclaration()

static HRESULT WINAPI mxwriter_get_omitXMLDeclaration ( IMXWriter *  iface,
VARIANT_BOOL value 
)
static

Definition at line 1078 of file mxwriter.c.

1079{
1080 mxwriter *This = impl_from_IMXWriter( iface );
1081
1082 TRACE("(%p)->(%p)\n", This, value);
1084}

◆ mxwriter_get_output()

static HRESULT WINAPI mxwriter_get_output ( IMXWriter *  iface,
VARIANT dest 
)
static

Definition at line 932 of file mxwriter.c.

933{
935
936 TRACE("(%p)->(%p)\n", This, dest);
937
938 if (!dest) return E_POINTER;
939
940 if (This->dest)
941 {
942 /* we only support IStream output so far */
944 V_UNKNOWN(dest) = (IUnknown*)This->dest;
945 IStream_AddRef(This->dest);
946 }
947 else
948 {
950 char *dest_ptr;
951 HRESULT hr;
952
954 if (FAILED(hr))
955 return hr;
956
957 V_VT(dest) = VT_BSTR;
958 V_BSTR(dest) = SysAllocStringLen(NULL, This->buffer.utf16_total / sizeof(WCHAR));
959 if (!V_BSTR(dest))
960 return E_OUTOFMEMORY;
961
962 dest_ptr = (char*)V_BSTR(dest);
963 buff = &This->buffer.encoded;
964
965 if (buff->written)
966 {
967 memcpy(dest_ptr, buff->data, buff->written);
968 dest_ptr += buff->written;
969 }
970
972 {
973 memcpy(dest_ptr, buff->data, buff->written);
974 dest_ptr += buff->written;
975 }
976 }
977
978 return S_OK;
979}
@ VT_BSTR
Definition: compat.h:2303
@ VT_UNKNOWN
Definition: compat.h:2308
static unsigned char buff[32768]
Definition: fatten.c:17
#define FAILED(hr)
Definition: intsafe.h:51
static char * dest
Definition: rtl.c:135
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
#define V_UNKNOWN(A)
Definition: oleauto.h:281
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198

◆ mxwriter_get_standalone()

static HRESULT WINAPI mxwriter_get_standalone ( IMXWriter *  iface,
VARIANT_BOOL value 
)
static

Definition at line 1062 of file mxwriter.c.

1063{
1064 mxwriter *This = impl_from_IMXWriter( iface );
1065
1066 TRACE("(%p)->(%p)\n", This, value);
1068}

◆ mxwriter_get_version()

static HRESULT WINAPI mxwriter_get_version ( IMXWriter *  iface,
BSTR version 
)
static

Definition at line 1100 of file mxwriter.c.

1101{
1102 mxwriter *This = impl_from_IMXWriter( iface );
1103
1104 TRACE("(%p)->(%p)\n", This, version);
1105
1106 if (!version) return E_POINTER;
1107
1108 return return_bstr(This->version, version);
1109}
static HRESULT return_bstr(const WCHAR *value, BSTR *p)

◆ mxwriter_GetIDsOfNames()

static HRESULT WINAPI mxwriter_GetIDsOfNames ( IMXWriter *  iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 865 of file mxwriter.c.

869{
871 return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface,
872 riid, rgszNames, cNames, lcid, rgDispId);
873}

◆ mxwriter_GetTypeInfo()

static HRESULT WINAPI mxwriter_GetTypeInfo ( IMXWriter *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 855 of file mxwriter.c.

859{
861 return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface,
862 iTInfo, lcid, ppTInfo);
863}

◆ mxwriter_GetTypeInfoCount()

static HRESULT WINAPI mxwriter_GetTypeInfoCount ( IMXWriter *  iface,
UINT pctinfo 
)
static

Definition at line 849 of file mxwriter.c.

850{
852 return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
853}

◆ mxwriter_Invoke()

static HRESULT WINAPI mxwriter_Invoke ( IMXWriter *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 875 of file mxwriter.c.

880{
882 return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface,
883 dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
884}

◆ mxwriter_put_byteOrderMark()

static HRESULT WINAPI mxwriter_put_byteOrderMark ( IMXWriter *  iface,
VARIANT_BOOL  value 
)
static

Definition at line 1022 of file mxwriter.c.

1023{
1024 mxwriter *This = impl_from_IMXWriter( iface );
1025
1026 TRACE("(%p)->(%d)\n", This, value);
1028}
static HRESULT writer_set_property(mxwriter *writer, mxwriter_prop property, VARIANT_BOOL value)
Definition: mxwriter.c:677

◆ mxwriter_put_disableOutputEscaping()

static HRESULT WINAPI mxwriter_put_disableOutputEscaping ( IMXWriter *  iface,
VARIANT_BOOL  value 
)
static

Definition at line 1111 of file mxwriter.c.

1112{
1113 mxwriter *This = impl_from_IMXWriter( iface );
1114
1115 TRACE("(%p)->(%d)\n", This, value);
1117}

◆ mxwriter_put_encoding()

static HRESULT WINAPI mxwriter_put_encoding ( IMXWriter *  iface,
BSTR  encoding 
)
static

Definition at line 981 of file mxwriter.c.

982{
984 xml_encoding enc;
985 HRESULT hr;
986
987 TRACE("(%p)->(%s)\n", This, debugstr_w(encoding));
988
990 if (enc == XmlEncoding_Unknown)
991 {
992 FIXME("unsupported encoding %s\n", debugstr_w(encoding));
993 return E_INVALIDARG;
994 }
995
997 if (FAILED(hr))
998 return hr;
999
1000 SysReAllocString(&This->encoding, encoding);
1001 This->xml_enc = enc;
1002
1003 TRACE("got encoding %d\n", This->xml_enc);
1005 return S_OK;
1006}
static void reset_output_buffer(mxwriter *This)
Definition: mxwriter.c:672
static xml_encoding parse_encoding_name(const WCHAR *encoding)
Definition: mxwriter.c:223
INT WINAPI SysReAllocString(LPBSTR old, LPCOLESTR str)
Definition: oleaut.c:467

◆ mxwriter_put_indent()

static HRESULT WINAPI mxwriter_put_indent ( IMXWriter *  iface,
VARIANT_BOOL  value 
)
static

Definition at line 1038 of file mxwriter.c.

1039{
1040 mxwriter *This = impl_from_IMXWriter( iface );
1041
1042 TRACE("(%p)->(%d)\n", This, value);
1044}

◆ mxwriter_put_omitXMLDeclaration()

static HRESULT WINAPI mxwriter_put_omitXMLDeclaration ( IMXWriter *  iface,
VARIANT_BOOL  value 
)
static

Definition at line 1070 of file mxwriter.c.

1071{
1072 mxwriter *This = impl_from_IMXWriter( iface );
1073
1074 TRACE("(%p)->(%d)\n", This, value);
1076}

◆ mxwriter_put_output()

static HRESULT WINAPI mxwriter_put_output ( IMXWriter *  iface,
VARIANT  dest 
)
static

Definition at line 886 of file mxwriter.c.

887{
889 HRESULT hr;
890
891 TRACE("(%p)->(%s)\n", This, debugstr_variant(&dest));
892
894 if (FAILED(hr))
895 return hr;
896
897 switch (V_VT(&dest))
898 {
899 case VT_EMPTY:
900 {
901 if (This->dest) IStream_Release(This->dest);
902 This->dest = NULL;
904 break;
905 }
906 case VT_UNKNOWN:
907 {
909
910 hr = IUnknown_QueryInterface(V_UNKNOWN(&dest), &IID_IStream, (void**)&stream);
911 if (hr == S_OK)
912 {
913 /* Recreate the output buffer to make sure it's using the correct encoding. */
915
916 if (This->dest) IStream_Release(This->dest);
917 This->dest = stream;
918 break;
919 }
920
921 FIXME("unhandled interface type for VT_UNKNOWN destination\n");
922 return E_NOTIMPL;
923 }
924 default:
925 FIXME("unhandled destination type %s\n", debugstr_variant(&dest));
926 return E_NOTIMPL;
927 }
928
929 return S_OK;
930}
@ VT_EMPTY
Definition: compat.h:2295
Definition: parse.h:23

◆ mxwriter_put_standalone()

static HRESULT WINAPI mxwriter_put_standalone ( IMXWriter *  iface,
VARIANT_BOOL  value 
)
static

Definition at line 1054 of file mxwriter.c.

1055{
1056 mxwriter *This = impl_from_IMXWriter( iface );
1057
1058 TRACE("(%p)->(%d)\n", This, value);
1060}

◆ mxwriter_put_version()

static HRESULT WINAPI mxwriter_put_version ( IMXWriter *  iface,
BSTR  version 
)
static

Definition at line 1086 of file mxwriter.c.

1087{
1088 mxwriter *This = impl_from_IMXWriter( iface );
1089
1090 TRACE("(%p)->(%s)\n", This, debugstr_w(version));
1091
1092 if (!version) return E_INVALIDARG;
1093
1094 SysFreeString(This->version);
1095 This->version = SysAllocString(version);
1096
1097 return S_OK;
1098}

◆ mxwriter_QueryInterface()

static HRESULT WINAPI mxwriter_QueryInterface ( IMXWriter *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 746 of file mxwriter.c.

747{
749
750 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
751
752 *obj = NULL;
753
754 if ( IsEqualGUID( riid, &IID_IMXWriter ) ||
757 {
758 *obj = &This->IMXWriter_iface;
759 }
760 else if ( IsEqualGUID( riid, &IID_ISAXContentHandler ) )
761 {
762 *obj = &This->ISAXContentHandler_iface;
763 }
764 else if ( IsEqualGUID( riid, &IID_ISAXLexicalHandler ) )
765 {
766 *obj = &This->ISAXLexicalHandler_iface;
767 }
768 else if ( IsEqualGUID( riid, &IID_ISAXDeclHandler ) )
769 {
770 *obj = &This->ISAXDeclHandler_iface;
771 }
772 else if ( IsEqualGUID( riid, &IID_ISAXDTDHandler ) )
773 {
774 *obj = &This->ISAXDTDHandler_iface;
775 }
776 else if ( IsEqualGUID( riid, &IID_ISAXErrorHandler ) )
777 {
778 *obj = &This->ISAXErrorHandler_iface;
779 }
780 else if ( IsEqualGUID( riid, &IID_IVBSAXDeclHandler ) )
781 {
782 *obj = &This->IVBSAXDeclHandler_iface;
783 }
784 else if ( IsEqualGUID( riid, &IID_IVBSAXLexicalHandler ) )
785 {
786 *obj = &This->IVBSAXLexicalHandler_iface;
787 }
788 else if ( IsEqualGUID( riid, &IID_IVBSAXContentHandler ) )
789 {
790 *obj = &This->IVBSAXContentHandler_iface;
791 }
792 else if ( IsEqualGUID( riid, &IID_IVBSAXDTDHandler ) )
793 {
794 *obj = &This->IVBSAXDTDHandler_iface;
795 }
796 else if ( IsEqualGUID( riid, &IID_IVBSAXErrorHandler ) )
797 {
798 *obj = &This->IVBSAXErrorHandler_iface;
799 }
800 else if (dispex_query_interface(&This->dispex, riid, obj))
801 {
802 return *obj ? S_OK : E_NOINTERFACE;
803 }
804 else
805 {
806 ERR("interface %s not implemented\n", debugstr_guid(riid));
807 *obj = NULL;
808 return E_NOINTERFACE;
809 }
810
811 IMXWriter_AddRef(iface);
812 return S_OK;
813}
#define ERR(fmt,...)
Definition: precomp.h:57

◆ mxwriter_Release()

static ULONG WINAPI mxwriter_Release ( IMXWriter *  iface)
static

Definition at line 825 of file mxwriter.c.

826{
829
830 TRACE("(%p)->(%d)\n", This, ref);
831
832 if(!ref)
833 {
834 /* Windows flushes the buffer when the interface is destroyed. */
836 free_output_buffer(&This->buffer);
837
838 if (This->dest) IStream_Release(This->dest);
839 SysFreeString(This->version);
840 SysFreeString(This->encoding);
841
842 SysFreeString(This->element);
844 }
845
846 return ref;
847}
static void free_output_buffer(output_buffer *buffer)
Definition: mxwriter.c:299

◆ mxwriter_write_attribute()

static void mxwriter_write_attribute ( mxwriter writer,
const WCHAR qname,
int  qname_len,
const WCHAR value,
int  value_len,
BOOL  escape 
)
static

Definition at line 1256 of file mxwriter.c.

1258{
1259 static const WCHAR eqW[] = {'='};
1260
1261 /* space separator in front of every attribute */
1262 write_output_buffer(writer, spaceW, 1);
1263 write_output_buffer(writer, qname, qname_len);
1264 write_output_buffer(writer, eqW, 1);
1265
1266 if (escape)
1267 {
1268 WCHAR *escaped = get_escaped_string(value, EscapeValue, &value_len);
1269 write_output_buffer_quoted(writer, escaped, value_len);
1270 heap_free(escaped);
1271 }
1272 else
1273 write_output_buffer_quoted(writer, value, value_len);
1274}
static WCHAR escape[]
Definition: url.c:36
static WCHAR * get_escaped_string(const WCHAR *str, escape_mode mode, int *len)
Definition: mxwriter.c:488
static const WCHAR spaceW[]
Definition: mxwriter.c:44
static HRESULT write_output_buffer_quoted(mxwriter *writer, const WCHAR *data, int len)
Definition: mxwriter.c:450

Referenced by SAXContentHandler_startElement(), and VBSAXContentHandler_startElement().

◆ mxwriter_write_starttag()

static void mxwriter_write_starttag ( mxwriter writer,
const WCHAR qname,
int  len 
)
static

Definition at line 1276 of file mxwriter.c.

1277{
1278 static const WCHAR ltW[] = {'<'};
1279
1280 close_element_starttag(writer);
1281 set_element_name(writer, qname ? qname : emptyW, qname ? len : 0);
1282
1283 write_node_indent(writer);
1284
1285 write_output_buffer(writer, ltW, 1);
1286 write_output_buffer(writer, qname ? qname : emptyW, qname ? len : 0);
1287 writer_inc_indent(writer);
1288}
static void write_node_indent(mxwriter *writer)
Definition: mxwriter.c:617
static void writer_inc_indent(mxwriter *This)
Definition: mxwriter.c:639

Referenced by SAXContentHandler_startElement(), and VBSAXContentHandler_startElement().

◆ parse_encoding_name()

static xml_encoding parse_encoding_name ( const WCHAR encoding)
static

Definition at line 223 of file mxwriter.c.

224{
225 int min, max, n, c;
226
227 min = 0;
229
230 while (min <= max)
231 {
232 n = (min+max)/2;
233
235 if (!c)
236 return xml_encoding_map[n].enc;
237
238 if (c > 0)
239 max = n-1;
240 else
241 min = n+1;
242 }
243
244 return XmlEncoding_Unknown;
245}
GLdouble n
Definition: glext.h:7729
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80
#define min(a, b)
Definition: monoChain.cc:55
#define strcmpiW(s1, s2)
Definition: unicode.h:45

Referenced by CreateXmlWriterOutputWithEncodingName(), and mxwriter_put_encoding().

◆ reset_output_buffer()

static void reset_output_buffer ( mxwriter This)
inlinestatic

Definition at line 672 of file mxwriter.c.

673{
675}
static void close_output_buffer(mxwriter *writer)
Definition: mxwriter.c:460

Referenced by mxwriter_put_encoding(), mxwriter_put_output(), and SAXContentHandler_startDocument().

◆ SAXAttributes_AddRef()

static ULONG WINAPI SAXAttributes_AddRef ( ISAXAttributes *  iface)
static

Definition at line 2949 of file mxwriter.c.

2950{
2952 return IMXAttributes_AddRef(&This->IMXAttributes_iface);
2953}
static mxattributes * impl_from_ISAXAttributes(ISAXAttributes *iface)
Definition: mxwriter.c:203

◆ SAXAttributes_create()

HRESULT SAXAttributes_create ( MSXML_VERSION  version,
void **  ppObj 
)

Definition at line 3553 of file mxwriter.c.

3554{
3555 static const int default_count = 10;
3557
3558 TRACE("(%p)\n", ppObj);
3559
3560 This = heap_alloc( sizeof (*This) );
3561 if( !This )
3562 return E_OUTOFMEMORY;
3563
3564 This->IMXAttributes_iface.lpVtbl = &MXAttributesVtbl;
3565 This->ISAXAttributes_iface.lpVtbl = &SAXAttributesVtbl;
3566 This->IVBSAXAttributes_iface.lpVtbl = &VBSAXAttributesVtbl;
3567 This->ref = 1;
3568
3569 This->class_version = version;
3570
3571 This->attr = heap_alloc(default_count*sizeof(mxattribute));
3572 This->length = 0;
3573 This->allocated = default_count;
3574
3575 *ppObj = &This->IMXAttributes_iface;
3576
3577 init_dispex(&This->dispex, (IUnknown*)&This->IMXAttributes_iface, &mxattrs_dispex);
3578
3579 TRACE("returning iface %p\n", *ppObj);
3580
3581 return S_OK;
3582}
static const struct IVBSAXAttributesVtbl VBSAXAttributesVtbl
Definition: mxwriter.c:3518
static dispex_static_data_t mxattrs_dispex
Definition: mxwriter.c:3546
static const ISAXAttributesVtbl SAXAttributesVtbl
Definition: mxwriter.c:3194
static const IMXAttributesVtbl MXAttributesVtbl
Definition: mxwriter.c:2923

Referenced by DllGetClassObject().

◆ SAXAttributes_getIndexFromName()

static HRESULT WINAPI SAXAttributes_getIndexFromName ( ISAXAttributes *  iface,
const WCHAR uri,
int  uri_len,
const WCHAR name,
int  len,
int index 
)
static

Definition at line 3048 of file mxwriter.c.

3050{
3052 int i;
3053
3054 TRACE("(%p)->(%s:%d %s:%d %p)\n", This, debugstr_wn(uri, uri_len), uri_len,
3056
3057 if (!index && (This->class_version == MSXML_DEFAULT || This->class_version == MSXML3))
3058 return E_POINTER;
3059
3060 if (!uri || !name || !index) return E_INVALIDARG;
3061
3062 for (i = 0; i < This->length; i++)
3063 {
3064 if (uri_len != SysStringLen(This->attr[i].uri)) continue;
3065 if (strncmpW(uri, This->attr[i].uri, uri_len)) continue;
3066
3067 if (len != SysStringLen(This->attr[i].local)) continue;
3068 if (strncmpW(name, This->attr[i].local, len)) continue;
3069
3070 *index = i;
3071 return S_OK;
3072 }
3073
3074 return E_INVALIDARG;
3075}
#define debugstr_wn
Definition: kernel32.h:33
@ MSXML_DEFAULT
Definition: msxml_private.h:35
@ MSXML3
Definition: msxml_private.h:38
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:196
#define strncmpW(s1, s2, n)
Definition: unicode.h:42
Definition: name.c:39

◆ SAXAttributes_getIndexFromQName()

static HRESULT WINAPI SAXAttributes_getIndexFromQName ( ISAXAttributes *  iface,
const WCHAR qname,
int  len,
int index 
)
static

Definition at line 3077 of file mxwriter.c.

3079{
3081 int i;
3082
3083 TRACE("(%p)->(%s:%d %p)\n", This, debugstr_wn(qname, len), len, index);
3084
3085 if (!index && (This->class_version == MSXML_DEFAULT || This->class_version == MSXML3))
3086 return E_POINTER;
3087
3088 if (!qname || !index || !len) return E_INVALIDARG;
3089
3090 for (i = 0; i < This->length; i++)
3091 {
3092 if (len != SysStringLen(This->attr[i].qname)) continue;
3093 if (strncmpW(qname, This->attr[i].qname, len)) continue;
3094
3095 *index = i;
3096 return S_OK;
3097 }
3098
3099 return E_INVALIDARG;
3100}

◆ SAXAttributes_getLength()

static HRESULT WINAPI SAXAttributes_getLength ( ISAXAttributes *  iface,
int length 
)
static

Definition at line 2961 of file mxwriter.c.

2962{
2964 TRACE("(%p)->(%p)\n", This, length);
2965
2966 if (!length && (This->class_version == MSXML_DEFAULT || This->class_version == MSXML3))
2967 return E_POINTER;
2968
2969 *length = This->length;
2970
2971 return S_OK;
2972}
GLuint GLsizei GLsizei * length
Definition: glext.h:6040

◆ SAXAttributes_getLocalName()

static HRESULT WINAPI SAXAttributes_getLocalName ( ISAXAttributes *  iface,
int  index,
const WCHAR **  name,
int len 
)
static

Definition at line 2990 of file mxwriter.c.

2992{
2994
2995 TRACE("(%p)->(%d %p %p)\n", This, index, name, len);
2996
2997 if (index >= This->length || index < 0) return E_INVALIDARG;
2998 if (!name || !len) return E_POINTER;
2999
3000 *len = SysStringLen(This->attr[index].local);
3001 *name = This->attr[index].local;
3002
3003 return S_OK;
3004}

◆ SAXAttributes_getName()

static HRESULT WINAPI SAXAttributes_getName ( ISAXAttributes *  iface,
int  index,
const WCHAR **  uri,
int uri_len,
const WCHAR **  local,
int local_len,
const WCHAR **  qname,
int qname_len 
)
static

Definition at line 3021 of file mxwriter.c.

3023{
3025
3026 TRACE("(%p)->(%d %p %p %p %p %p %p)\n", This, index, uri, uri_len, local, local_len, qname, qname_len);
3027
3028 if (index >= This->length || index < 0)
3029 return E_INVALIDARG;
3030
3031 if (!uri || !uri_len || !local || !local_len || !qname || !qname_len)
3032 return E_POINTER;
3033
3034 *uri_len = SysStringLen(This->attr[index].uri);
3035 *uri = This->attr[index].uri;
3036
3037 *local_len = SysStringLen(This->attr[index].local);
3038 *local = This->attr[index].local;
3039
3040 *qname_len = SysStringLen(This->attr[index].qname);
3041 *qname = This->attr[index].qname;
3042
3043 TRACE("(%s, %s, %s)\n", debugstr_w(*uri), debugstr_w(*local), debugstr_w(*qname));
3044
3045 return S_OK;
3046}
#define local
Definition: zutil.h:30

◆ SAXAttributes_getQName()

static HRESULT WINAPI SAXAttributes_getQName ( ISAXAttributes *  iface,
int  index,
const WCHAR **  qname,
int length 
)
static

Definition at line 3006 of file mxwriter.c.

3007{
3009
3010 TRACE("(%p)->(%d %p %p)\n", This, index, qname, length);
3011
3012 if (index >= This->length) return E_INVALIDARG;
3013 if (!qname || !length) return E_POINTER;
3014
3015 *qname = This->attr[index].qname;
3016 *length = SysStringLen(This->attr[index].qname);
3017
3018 return S_OK;
3019}

◆ SAXAttributes_getType()

static HRESULT WINAPI SAXAttributes_getType ( ISAXAttributes *  iface,
int  index,
const WCHAR **  type,
int len 
)
static

Definition at line 3102 of file mxwriter.c.

3104{
3106
3107 TRACE("(%p)->(%d %p %p)\n", This, index, type, len);
3108
3109 if (index >= This->length) return E_INVALIDARG;
3110
3111 if ((!type || !len) && (This->class_version == MSXML_DEFAULT || This->class_version == MSXML3))
3112 return E_POINTER;
3113
3114 *type = This->attr[index].type;
3115 *len = SysStringLen(This->attr[index].type);
3116
3117 return S_OK;
3118}

◆ SAXAttributes_getTypeFromName()

static HRESULT WINAPI SAXAttributes_getTypeFromName ( ISAXAttributes *  iface,
const WCHAR pUri,
int  nUri,
const WCHAR pLocalName,
int  nLocalName,
const WCHAR **  pType,
int nType 
)
static

Definition at line 3120 of file mxwriter.c.

3122{
3124 FIXME("(%p)->(%s:%d %s:%d %p %p): stub\n", This, debugstr_wn(pUri, nUri), nUri,
3125 debugstr_wn(pLocalName, nLocalName), nLocalName, pType, nType);
3126 return E_NOTIMPL;
3127}

◆ SAXAttributes_getTypeFromQName()

static HRESULT WINAPI SAXAttributes_getTypeFromQName ( ISAXAttributes *  iface,
const WCHAR pQName,
int  nQName,
const WCHAR **  pType,
int nType 
)
static

Definition at line 3129 of file mxwriter.c.

3131{
3133 FIXME("(%p)->(%s:%d %p %p): stub\n", This, debugstr_wn(pQName, nQName), nQName, pType, nType);
3134 return E_NOTIMPL;
3135}

◆ SAXAttributes_getURI()

static HRESULT WINAPI SAXAttributes_getURI ( ISAXAttributes *  iface,
int  index,
const WCHAR **  uri,
int len 
)
static

Definition at line 2974 of file mxwriter.c.

2976{
2978
2979 TRACE("(%p)->(%d %p %p)\n", This, index, uri, len);
2980
2981 if (index >= This->length || index < 0) return E_INVALIDARG;
2982 if (!uri || !len) return E_POINTER;
2983
2984 *len = SysStringLen(This->attr[index].uri);
2985 *uri = This->attr[index].uri;
2986
2987 return S_OK;
2988}

◆ SAXAttributes_getValue()

static HRESULT WINAPI SAXAttributes_getValue ( ISAXAttributes *  iface,
int  index,
const WCHAR **  value,
int len 
)
static

Definition at line 3137 of file mxwriter.c.

3139{
3141
3142 TRACE("(%p)->(%d %p %p)\n", This, index, value, len);
3143
3144 if (index >= This->length) return E_INVALIDARG;
3145
3146 if ((!value || !len) && (This->class_version == MSXML_DEFAULT || This->class_version == MSXML3))
3147 return E_POINTER;
3148
3149 *value = This->attr[index].value;
3150 *len = SysStringLen(This->attr[index].value);
3151
3152 return S_OK;
3153}

◆ SAXAttributes_getValueFromName()

static HRESULT WINAPI SAXAttributes_getValueFromName ( ISAXAttributes *  iface,
const WCHAR uri,
int  uri_len,
const WCHAR name,
int  name_len,
const WCHAR **  value,
int value_len 
)
static

Definition at line 3155 of file mxwriter.c.

3157{
3159 HRESULT hr;
3160 int index;
3161
3162 TRACE("(%p)->(%s:%d %s:%d %p %p)\n", This, debugstr_wn(uri, uri_len), uri_len,
3163 debugstr_wn(name, name_len), name_len, value, value_len);
3164
3165 if (!uri || !name || !value || !value_len)
3166 return (This->class_version == MSXML_DEFAULT || This->class_version == MSXML3) ? E_POINTER : E_INVALIDARG;
3167
3168 hr = ISAXAttributes_getIndexFromName(iface, uri, uri_len, name, name_len, &index);
3169 if (hr == S_OK)
3170 hr = ISAXAttributes_getValue(iface, index, value, value_len);
3171
3172 return hr;
3173}

◆ SAXAttributes_getValueFromQName()

static HRESULT WINAPI SAXAttributes_getValueFromQName ( ISAXAttributes *  iface,
const WCHAR qname,
int  qname_len,
const WCHAR **  value,
int value_len 
)
static

Definition at line 3175 of file mxwriter.c.

3177{
3179 HRESULT hr;
3180 int index;
3181
3182 TRACE("(%p)->(%s:%d %p %p)\n", This, debugstr_wn(qname, qname_len), qname_len, value, value_len);
3183
3184 if (!qname || !value || !value_len)
3185 return (This->class_version == MSXML_DEFAULT || This->class_version == MSXML3) ? E_POINTER : E_INVALIDARG;
3186
3187 hr = ISAXAttributes_getIndexFromQName(iface, qname, qname_len, &index);
3188 if (hr == S_OK)
3189 hr = ISAXAttributes_getValue(iface, index, value, value_len);
3190
3191 return hr;
3192}

◆ SAXAttributes_QueryInterface()

static HRESULT WINAPI SAXAttributes_QueryInterface ( ISAXAttributes *  iface,
REFIID  riid,
void **  ppObj 
)
static

Definition at line 2943 of file mxwriter.c.

2944{
2946 return IMXAttributes_QueryInterface(&This->IMXAttributes_iface, riid, ppObj);
2947}

◆ SAXAttributes_Release()

static ULONG WINAPI SAXAttributes_Release ( ISAXAttributes *  iface)
static

Definition at line 2955 of file mxwriter.c.

2956{
2958 return IMXAttributes_Release(&This->IMXAttributes_iface);
2959}

◆ SAXContentHandler_AddRef()

static ULONG WINAPI SAXContentHandler_AddRef ( ISAXContentHandler *  iface)
static

Definition at line 1172 of file mxwriter.c.

1173{
1175 return IMXWriter_AddRef(&This->IMXWriter_iface);
1176}
static mxwriter * impl_from_ISAXContentHandler(ISAXContentHandler *iface)
Definition: mxwriter.c:696

◆ SAXContentHandler_characters()

static HRESULT WINAPI SAXContentHandler_characters ( ISAXContentHandler *  iface,
const WCHAR chars,
int  nchars 
)
static

Definition at line 1381 of file mxwriter.c.

1385{
1387
1388 TRACE("(%p)->(%s:%d)\n", This, debugstr_wn(chars, nchars), nchars);
1389
1390 if (!chars) return E_INVALIDARG;
1391
1394
1395 if (!This->cdata)
1396 This->text = TRUE;
1397
1398 if (nchars)
1399 {
1400 if (This->cdata || This->props[MXWriter_DisableEscaping] == VARIANT_TRUE)
1401 write_output_buffer(This, chars, nchars);
1402 else
1403 {
1404 int len = nchars;
1405 WCHAR *escaped;
1406
1407 escaped = get_escaped_string(chars, EscapeText, &len);
1408 write_output_buffer(This, escaped, len);
1409 heap_free(escaped);
1410 }
1411 }
1412
1413 return S_OK;
1414}
#define TRUE
Definition: types.h:120

◆ SAXContentHandler_endDocument()

static HRESULT WINAPI SAXContentHandler_endDocument ( ISAXContentHandler *  iface)
static

Definition at line 1226 of file mxwriter.c.

1227{
1229 TRACE("(%p)\n", This);
1230 This->prop_changed = FALSE;
1231 return flush_output_buffer(This);
1232}

◆ SAXContentHandler_endElement()

static HRESULT WINAPI SAXContentHandler_endElement ( ISAXContentHandler *  iface,
const WCHAR namespaceUri,
int  nnamespaceUri,
const WCHAR local_name,
int  nlocal_name,
const WCHAR QName,
int  nQName 
)
static

Definition at line 1340 of file mxwriter.c.

1348{
1350
1351 TRACE("(%p)->(%s:%d %s:%d %s:%d)\n", This, debugstr_wn(namespaceUri, nnamespaceUri), nnamespaceUri,
1352 debugstr_wn(local_name, nlocal_name), nlocal_name, debugstr_wn(QName, nQName), nQName);
1353
1354 if (((!namespaceUri || !local_name || !QName) && This->class_version != MSXML6) ||
1355 (nQName == -1 && This->class_version == MSXML6))
1356 return E_INVALIDARG;
1357
1359
1360 if (This->element)
1361 {
1362 static const WCHAR closeW[] = {'/','>'};
1363 write_output_buffer(This, closeW, 2);
1364 }
1365 else
1366 {
1367 static const WCHAR closetagW[] = {'<','/'};
1368 static const WCHAR gtW[] = {'>'};
1369
1372 write_output_buffer(This, QName, nQName);
1374 }
1375
1377
1378 return S_OK;
1379}
static BSTR local_name(call_frame_t *frame, int ref)
Definition: engine.c:187
static void writer_dec_indent(mxwriter *This)
Definition: mxwriter.c:644
static const WCHAR closetagW[]
Definition: mxwriter.c:46

◆ SAXContentHandler_endPrefixMapping()

static HRESULT WINAPI SAXContentHandler_endPrefixMapping ( ISAXContentHandler *  iface,
const WCHAR prefix,
int  nprefix 
)
static

Definition at line 1246 of file mxwriter.c.

1250{
1252 TRACE("(%p)->(%s)\n", This, debugstr_wn(prefix, nprefix));
1253 return S_OK;
1254}

◆ SAXContentHandler_ignorableWhitespace()

static HRESULT WINAPI SAXContentHandler_ignorableWhitespace ( ISAXContentHandler *  iface,
const WCHAR chars,
int  nchars 
)
static

Definition at line 1416 of file mxwriter.c.

1420{
1422
1423 TRACE("(%p)->(%s)\n", This, debugstr_wn(chars, nchars));
1424
1425 if (!chars) return E_INVALIDARG;
1426
1427 write_output_buffer(This, chars, nchars);
1428
1429 return S_OK;
1430}

◆ SAXContentHandler_processingInstruction()

static HRESULT WINAPI SAXContentHandler_processingInstruction ( ISAXContentHandler *  iface,
const WCHAR target,
int  ntarget,
const WCHAR data,
int  ndata 
)
static

Definition at line 1432 of file mxwriter.c.

1438{
1440 static const WCHAR openpiW[] = {'<','?'};
1441 static const WCHAR closepiW[] = {'?','>','\r','\n'};
1442
1443 TRACE("(%p)->(%s %s)\n", This, debugstr_wn(target, ntarget), debugstr_wn(data, ndata));
1444
1445 if (!target) return E_INVALIDARG;
1446
1448 write_output_buffer(This, openpiW, ARRAY_SIZE(openpiW));
1449
1450 if (*target)
1451 write_output_buffer(This, target, ntarget);
1452
1453 if (data && *data && ndata)
1454 {
1456 write_output_buffer(This, data, ndata);
1457 }
1458
1460 This->newline = TRUE;
1461
1462 return S_OK;
1463}
static const WCHAR closepiW[]
Definition: writer.c:47
GLenum target
Definition: glext.h:7315

◆ SAXContentHandler_putDocumentLocator()

static HRESULT WINAPI SAXContentHandler_putDocumentLocator ( ISAXContentHandler *  iface,
ISAXLocator *  locator 
)
static

Definition at line 1184 of file mxwriter.c.

1187{
1189 FIXME("(%p)->(%p)\n", This, locator);
1190 return E_NOTIMPL;
1191}

◆ SAXContentHandler_QueryInterface()

static HRESULT WINAPI SAXContentHandler_QueryInterface ( ISAXContentHandler *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 1163 of file mxwriter.c.

1167{
1169 return IMXWriter_QueryInterface(&This->IMXWriter_iface, riid, obj);
1170}

◆ SAXContentHandler_Release()

static ULONG WINAPI SAXContentHandler_Release ( ISAXContentHandler *  iface)
static

Definition at line 1178 of file mxwriter.c.

1179{
1181 return IMXWriter_Release(&This->IMXWriter_iface);
1182}

◆ SAXContentHandler_skippedEntity()

static HRESULT WINAPI SAXContentHandler_skippedEntity ( ISAXContentHandler *  iface,
const WCHAR name,
int  nname 
)
static

Definition at line 1465 of file mxwriter.c.

1469{
1471 FIXME("(%p)->(%s)\n", This, debugstr_wn(name, nname));
1472 return E_NOTIMPL;
1473}

◆ SAXContentHandler_startDocument()

static HRESULT WINAPI SAXContentHandler_startDocument ( ISAXContentHandler *  iface)
static

Definition at line 1193 of file mxwriter.c.

1194{
1196
1197 TRACE("(%p)\n", This);
1198
1199 /* If properties have been changed since the last "endDocument" call
1200 * we need to reset the output buffer. If we don't the output buffer
1201 * could end up with multiple XML documents in it, plus this seems to
1202 * be how Windows works.
1203 */
1204 if (This->prop_changed) {
1206 This->prop_changed = FALSE;
1207 }
1208
1209 if (This->props[MXWriter_OmitXmlDecl] == VARIANT_TRUE) return S_OK;
1210
1212
1213 if (This->dest && This->xml_enc == XmlEncoding_UTF16) {
1214 static const char utf16BOM[] = {0xff,0xfe};
1215
1216 if (This->props[MXWriter_BOM] == VARIANT_TRUE)
1217 /* Windows passes a NULL pointer as the pcbWritten parameter and
1218 * ignores any error codes returned from this Write call.
1219 */
1220 IStream_Write(This->dest, utf16BOM, sizeof(utf16BOM), NULL);
1221 }
1222
1223 return S_OK;
1224}
static void write_prolog_buffer(mxwriter *writer)
Definition: mxwriter.c:551

◆ SAXContentHandler_startElement()

static HRESULT WINAPI SAXContentHandler_startElement ( ISAXContentHandler *  iface,
const WCHAR namespaceUri,
int  nnamespaceUri,
const WCHAR local_name,
int  nlocal_name,
const WCHAR QName,
int  nQName,
ISAXAttributes *  attr 
)
static

Definition at line 1290 of file mxwriter.c.

1299{
1301
1302 TRACE("(%p)->(%s %s %s %p)\n", This, debugstr_wn(namespaceUri, nnamespaceUri),
1303 debugstr_wn(local_name, nlocal_name), debugstr_wn(QName, nQName), attr);
1304
1305 if (((!namespaceUri || !local_name || !QName) && This->class_version != MSXML6) ||
1306 (nQName == -1 && This->class_version == MSXML6))
1307 return E_INVALIDARG;
1308
1309 mxwriter_write_starttag(This, QName, nQName);
1310
1311 if (attr)
1312 {
1313 int length, i, escape;
1314 HRESULT hr;
1315
1316 hr = ISAXAttributes_getLength(attr, &length);
1317 if (FAILED(hr)) return hr;
1318
1319 escape = This->props[MXWriter_DisableEscaping] == VARIANT_FALSE ||
1320 (This->class_version == MSXML4 || This->class_version == MSXML6);
1321
1322 for (i = 0; i < length; i++)
1323 {
1324 int qname_len = 0, value_len = 0;
1325 const WCHAR *qname, *value;
1326
1327 hr = ISAXAttributes_getQName(attr, i, &qname, &qname_len);
1328 if (FAILED(hr)) return hr;
1329
1330 hr = ISAXAttributes_getValue(attr, i, &value, &value_len);
1331 if (FAILED(hr)) return hr;
1332
1333 mxwriter_write_attribute(This, qname, qname_len, value, value_len, escape);
1334 }
1335 }
1336
1337 return S_OK;
1338}
@ MSXML4
Definition: msxml_private.h:39
static void mxwriter_write_attribute(mxwriter *writer, const WCHAR *qname, int qname_len, const WCHAR *value, int value_len, BOOL escape)
Definition: mxwriter.c:1256
static void mxwriter_write_starttag(mxwriter *writer, const WCHAR *qname, int len)
Definition: mxwriter.c:1276

◆ SAXContentHandler_startPrefixMapping()

static HRESULT WINAPI SAXContentHandler_startPrefixMapping ( ISAXContentHandler *  iface,
const WCHAR prefix,
int  nprefix,
const WCHAR uri,
int  nuri 
)
static

Definition at line 1234 of file mxwriter.c.

1240{
1242 TRACE("(%p)->(%s %s)\n", This, debugstr_wn(prefix, nprefix), debugstr_wn(uri, nuri));
1243 return S_OK;
1244}

◆ SAXDeclHandler_AddRef()

static ULONG WINAPI SAXDeclHandler_AddRef ( ISAXDeclHandler *  iface)
static

Definition at line 1659 of file mxwriter.c.

1660{
1662 return IMXWriter_AddRef(&This->IMXWriter_iface);
1663}
static mxwriter * impl_from_ISAXDeclHandler(ISAXDeclHandler *iface)
Definition: mxwriter.c:716

◆ SAXDeclHandler_attributeDecl()

static HRESULT WINAPI SAXDeclHandler_attributeDecl ( ISAXDeclHandler *  iface,
const WCHAR element,
int  n_element,
const WCHAR attr,
int  n_attr,
const WCHAR type,
int  n_type,
const WCHAR Default,
int  n_default,
const WCHAR value,
int  n_value 
)
static

Definition at line 1694 of file mxwriter.c.

1698{
1700 static const WCHAR attlistW[] = {'<','!','A','T','T','L','I','S','T',' '};
1701 static const WCHAR closetagW[] = {'>','\r','\n'};
1702
1703 TRACE("(%p)->(%s:%d %s:%d %s:%d %s:%d %s:%d)\n", This, debugstr_wn(element, n_element), n_element,
1704 debugstr_wn(attr, n_attr), n_attr, debugstr_wn(type, n_type), n_type, debugstr_wn(Default, n_default), n_default,
1705 debugstr_wn(value, n_value), n_value);
1706
1707 write_output_buffer(This, attlistW, ARRAY_SIZE(attlistW));
1708 if (n_element) {
1709 write_output_buffer(This, element, n_element);
1711 }
1712
1713 if (n_attr) {
1714 write_output_buffer(This, attr, n_attr);
1716 }
1717
1718 if (n_type) {
1719 write_output_buffer(This, type, n_type);
1721 }
1722
1723 if (n_default) {
1724 write_output_buffer(This, Default, n_default);
1726 }
1727
1728 if (n_value)
1730
1732
1733 return S_OK;
1734}

◆ SAXDeclHandler_elementDecl()

static HRESULT WINAPI SAXDeclHandler_elementDecl ( ISAXDeclHandler *  iface,
const WCHAR name,
int  n_name,
const WCHAR model,
int  n_model 
)
static

Definition at line 1671 of file mxwriter.c.

1673{
1674 static const WCHAR elementW[] = {'<','!','E','L','E','M','E','N','T',' '};
1676
1677 TRACE("(%p)->(%s:%d %s:%d)\n", This, debugstr_wn(name, n_name), n_name,
1678 debugstr_wn(model, n_model), n_model);
1679
1680 if (!name || !model) return E_INVALIDARG;
1681
1682 write_output_buffer(This, elementW, ARRAY_SIZE(elementW));
1683 if (n_name) {
1684 write_output_buffer(This, name, n_name);
1686 }
1687 if (n_model)
1688 write_output_buffer(This, model, n_model);
1690
1691 return S_OK;
1692}

◆ SAXDeclHandler_externalEntityDecl()

static HRESULT WINAPI SAXDeclHandler_externalEntityDecl ( ISAXDeclHandler *  iface,
const WCHAR name,
int  n_name,
const WCHAR publicId,
int  n_publicId,
const WCHAR systemId,
int  n_systemId 
)
static

Definition at line 1760 of file mxwriter.c.

1763{
1765
1766 TRACE("(%p)->(%s:%d %s:%d %s:%d)\n", This, debugstr_wn(name, n_name), n_name,
1767 debugstr_wn(publicId, n_publicId), n_publicId, debugstr_wn(systemId, n_systemId), n_systemId);
1768
1769 if (!name || !systemId) return E_INVALIDARG;
1770
1772 if (n_name) {
1773 write_output_buffer(This, name, n_name);
1775 }
1776
1777 if (publicId)
1778 {
1780 write_output_buffer_quoted(This, publicId, n_publicId);
1782 write_output_buffer_quoted(This, systemId, n_systemId);
1783 }
1784 else
1785 {
1787 write_output_buffer_quoted(This, systemId, n_systemId);
1788 }
1789
1791
1792 return S_OK;
1793}
static const WCHAR entityW[]
Definition: mxwriter.c:48
static const WCHAR publicW[]
Definition: mxwriter.c:49
static const WCHAR systemW[]
Definition: mxwriter.c:50

◆ SAXDeclHandler_internalEntityDecl()

static HRESULT WINAPI SAXDeclHandler_internalEntityDecl ( ISAXDeclHandler *  iface,
const WCHAR name,
int  n_name,
const WCHAR value,
int  n_value 
)
static

Definition at line 1736 of file mxwriter.c.

1738{
1740
1741 TRACE("(%p)->(%s:%d %s:%d)\n", This, debugstr_wn(name, n_name), n_name,
1742 debugstr_wn(value, n_value), n_value);
1743
1744 if (!name || !value) return E_INVALIDARG;
1745
1747 if (n_name) {
1748 write_output_buffer(This, name, n_name);
1750 }
1751
1752 if (n_value)
1754
1756
1757 return S_OK;
1758}

◆ SAXDeclHandler_QueryInterface()

static HRESULT WINAPI SAXDeclHandler_QueryInterface ( ISAXDeclHandler *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 1652 of file mxwriter.c.

1654{
1656 return IMXWriter_QueryInterface(&This->IMXWriter_iface, riid, obj);
1657}

◆ SAXDeclHandler_Release()

static ULONG WINAPI SAXDeclHandler_Release ( ISAXDeclHandler *  iface)
static

Definition at line 1665 of file mxwriter.c.

1666{
1668 return IMXWriter_Release(&This->IMXWriter_iface);
1669}

◆ SAXDTDHandler_AddRef()

static ULONG WINAPI SAXDTDHandler_AddRef ( ISAXDTDHandler *  iface)
static

Definition at line 2276 of file mxwriter.c.

2277{
2279 return IMXWriter_AddRef(&This->IMXWriter_iface);
2280}
static mxwriter * impl_from_ISAXDTDHandler(ISAXDTDHandler *iface)
Definition: mxwriter.c:726

◆ SAXDTDHandler_notationDecl()

static HRESULT WINAPI SAXDTDHandler_notationDecl ( ISAXDTDHandler *  iface,
const WCHAR name,
INT  n_name,
const WCHAR publicid,
INT  n_publicid,
const WCHAR systemid,
INT  n_systemid 
)
static

Definition at line 2288 of file mxwriter.c.

2292{
2293 static const WCHAR notationW[] = {'<','!','N','O','T','A','T','I','O','N',' '};
2295
2296 TRACE("(%p)->(%s:%d, %s:%d, %s:%d)\n", This, debugstr_wn(name, n_name), n_name,
2297 debugstr_wn(publicid, n_publicid), n_publicid, debugstr_wn(systemid, n_systemid), n_systemid);
2298
2299 if (!name || !n_name)
2300 return E_INVALIDARG;
2301
2302 write_output_buffer(This, notationW, ARRAY_SIZE(notationW));
2303 write_output_buffer(This, name, n_name);
2304
2305 if (!publicid && !systemid)
2306 return E_INVALIDARG;
2307
2309 if (publicid)
2310 {
2312 write_output_buffer_quoted(This, publicid, n_publicid);
2313 if (systemid)
2314 {
2316 write_output_buffer_quoted(This, systemid, n_systemid);
2317 }
2318 }
2319 else
2320 {
2322 write_output_buffer_quoted(This, systemid, n_systemid);
2323 }
2324
2326
2327 return S_OK;
2328}

◆ SAXDTDHandler_QueryInterface()

static HRESULT WINAPI SAXDTDHandler_QueryInterface ( ISAXDTDHandler *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 2270 of file mxwriter.c.

2271{
2273 return IMXWriter_QueryInterface(&This->IMXWriter_iface, riid, obj);
2274}

◆ SAXDTDHandler_Release()

static ULONG WINAPI SAXDTDHandler_Release ( ISAXDTDHandler *  iface)
static

Definition at line 2282 of file mxwriter.c.

2283{
2285 return IMXWriter_Release(&This->IMXWriter_iface);
2286}

◆ SAXDTDHandler_unparsedEntityDecl()

static HRESULT WINAPI SAXDTDHandler_unparsedEntityDecl ( ISAXDTDHandler *  iface,
const WCHAR name,
INT  nname,
const WCHAR publicid,
INT  npublicid,
const WCHAR systemid,
INT  nsystemid,
const WCHAR notation,
INT  nnotation 
)
static

Definition at line 2330 of file mxwriter.c.

2335{
2337 FIXME("(%p)->(%s:%d, %s:%d, %s:%d, %s:%d): stub\n", This, debugstr_wn(name, nname), nname,
2338 debugstr_wn(publicid, npublicid), npublicid, debugstr_wn(systemid, nsystemid), nsystemid,
2339 debugstr_wn(notation, nnotation), nnotation);
2340 return E_NOTIMPL;
2341}

◆ SAXErrorHandler_AddRef()

static ULONG WINAPI SAXErrorHandler_AddRef ( ISAXErrorHandler *  iface)
static

Definition at line 2442 of file mxwriter.c.

2443{
2445 return IMXWriter_AddRef(&This->IMXWriter_iface);
2446}
static mxwriter * impl_from_ISAXErrorHandler(ISAXErrorHandler *iface)
Definition: mxwriter.c:736

◆ SAXErrorHandler_error()

static HRESULT WINAPI SAXErrorHandler_error ( ISAXErrorHandler *  iface,
ISAXLocator *  locator,
const WCHAR message,
HRESULT  hr 
)
static

Definition at line 2454 of file mxwriter.c.

2456{
2458
2459 FIXME("(%p)->(%p %s 0x%08x)\n", This, locator, debugstr_w(message), hr);
2460
2461 return E_NOTIMPL;
2462}
Definition: tftpd.h:60

◆ SAXErrorHandler_fatalError()

static HRESULT WINAPI SAXErrorHandler_fatalError ( ISAXErrorHandler *  iface,
ISAXLocator *  locator,
const WCHAR message,
HRESULT  hr 
)
static

Definition at line 2464 of file mxwriter.c.

2466{
2468
2469 FIXME("(%p)->(%p %s 0x%08x)\n", This, locator, debugstr_w(message), hr);
2470
2471 return E_NOTIMPL;
2472}

◆ SAXErrorHandler_ignorableWarning()

static HRESULT WINAPI SAXErrorHandler_ignorableWarning ( ISAXErrorHandler *  iface,
ISAXLocator *  locator,
const WCHAR message,
HRESULT  hr 
)
static

Definition at line 2474 of file mxwriter.c.

2476{
2478
2479 FIXME("(%p)->(%p %s 0x%08x)\n", This, locator, debugstr_w(message), hr);
2480
2481 return E_NOTIMPL;
2482}

◆ SAXErrorHandler_QueryInterface()

static HRESULT WINAPI SAXErrorHandler_QueryInterface ( ISAXErrorHandler *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 2436 of file mxwriter.c.

2437{
2439 return IMXWriter_QueryInterface(&This->IMXWriter_iface, riid, obj);
2440}

◆ SAXErrorHandler_Release()

static ULONG WINAPI SAXErrorHandler_Release ( ISAXErrorHandler *  iface)
static

Definition at line 2448 of file mxwriter.c.

2449{
2451 return IMXWriter_Release(&This->IMXWriter_iface);
2452}

◆ SAXLexicalHandler_AddRef()

static ULONG WINAPI SAXLexicalHandler_AddRef ( ISAXLexicalHandler *  iface)
static

Definition at line 1501 of file mxwriter.c.

1502{
1504 return IMXWriter_AddRef(&This->IMXWriter_iface);
1505}
static mxwriter * impl_from_ISAXLexicalHandler(ISAXLexicalHandler *iface)
Definition: mxwriter.c:706

◆ SAXLexicalHandler_comment()

static HRESULT WINAPI SAXLexicalHandler_comment ( ISAXLexicalHandler *  iface,
const WCHAR chars,
int  nchars 
)
static

Definition at line 1616 of file mxwriter.c.

1617{
1619 static const WCHAR copenW[] = {'<','!','-','-'};
1620 static const WCHAR ccloseW[] = {'-','-','>','\r','\n'};
1621
1622 TRACE("(%p)->(%s:%d)\n", This, debugstr_wn(chars, nchars), nchars);
1623
1624 if (!chars) return E_INVALIDARG;
1625
1628
1629 write_output_buffer(This, copenW, ARRAY_SIZE(copenW));
1630 if (nchars)
1631 write_output_buffer(This, chars, nchars);
1632 write_output_buffer(This, ccloseW, ARRAY_SIZE(ccloseW));
1633
1634 return S_OK;
1635}

◆ SAXLexicalHandler_endCDATA()

static HRESULT WINAPI SAXLexicalHandler_endCDATA ( ISAXLexicalHandler *  iface)
static

Definition at line 1603 of file mxwriter.c.

1604{
1606 static const WCHAR ecdataW[] = {']',']','>'};
1607
1608 TRACE("(%p)\n", This);
1609
1610 write_output_buffer(This, ecdataW, ARRAY_SIZE(ecdataW));
1611 This->cdata = FALSE;
1612
1613 return S_OK;
1614}

◆ SAXLexicalHandler_endDTD()

static HRESULT WINAPI SAXLexicalHandler_endDTD ( ISAXLexicalHandler *  iface)
static

Definition at line 1563 of file mxwriter.c.

1564{
1566 static const WCHAR closedtdW[] = {']','>','\r','\n'};
1567
1568 TRACE("(%p)\n", This);
1569
1570 write_output_buffer(This, closedtdW, ARRAY_SIZE(closedtdW));
1571
1572 return S_OK;
1573}

◆ SAXLexicalHandler_endEntity()

static HRESULT WINAPI SAXLexicalHandler_endEntity ( ISAXLexicalHandler *  iface,
const WCHAR name,
int  len 
)
static

Definition at line 1582 of file mxwriter.c.

1583{
1585 FIXME("(%p)->(%s): stub\n", This, debugstr_wn(name, len));
1586 return E_NOTIMPL;
1587}

◆ SAXLexicalHandler_QueryInterface()

static HRESULT WINAPI SAXLexicalHandler_QueryInterface ( ISAXLexicalHandler *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 1494 of file mxwriter.c.

1496{
1498 return IMXWriter_QueryInterface(&This->IMXWriter_iface, riid, obj);
1499}

◆ SAXLexicalHandler_Release()

static ULONG WINAPI SAXLexicalHandler_Release ( ISAXLexicalHandler *  iface)
static

Definition at line 1507 of file mxwriter.c.

1508{
1510 return IMXWriter_Release(&This->IMXWriter_iface);
1511}

◆ SAXLexicalHandler_startCDATA()

static HRESULT WINAPI SAXLexicalHandler_startCDATA ( ISAXLexicalHandler *  iface)
static

Definition at line 1589 of file mxwriter.c.

1590{
1591 static const WCHAR scdataW[] = {'<','!','[','C','D','A','T','A','['};
1593
1594 TRACE("(%p)\n", This);
1595
1597 write_output_buffer(This, scdataW, ARRAY_SIZE(scdataW));
1598 This->cdata = TRUE;
1599
1600 return S_OK;
1601}

◆ SAXLexicalHandler_startDTD()

static HRESULT WINAPI SAXLexicalHandler_startDTD ( ISAXLexicalHandler *  iface,
const WCHAR name,
int  name_len,
const WCHAR publicId,
int  publicId_len,
const WCHAR systemId,
int  systemId_len 
)
static

Definition at line 1513 of file mxwriter.c.

1516{
1517 static const WCHAR doctypeW[] = {'<','!','D','O','C','T','Y','P','E',' '};
1518 static const WCHAR openintW[] = {'[','\r','\n'};
1519
1521
1522 TRACE("(%p)->(%s %s %s)\n", This, debugstr_wn(name, name_len), debugstr_wn(publicId, publicId_len),
1523 debugstr_wn(systemId, systemId_len));
1524
1525 if (!name) return E_INVALIDARG;
1526
1527 write_output_buffer(This, doctypeW, ARRAY_SIZE(doctypeW));
1528
1529 if (*name)
1530 {
1531 write_output_buffer(This, name, name_len);
1533 }
1534
1535 if (publicId)
1536 {
1538 write_output_buffer_quoted(This, publicId, publicId_len);
1539
1540 if (!systemId) return E_INVALIDARG;
1541
1542 if (*publicId)
1544
1545 write_output_buffer_quoted(This, systemId, systemId_len);
1546
1547 if (*systemId)
1549 }
1550 else if (systemId)
1551 {
1553 write_output_buffer_quoted(This, systemId, systemId_len);
1554 if (*systemId)
1556 }
1557
1558 write_output_buffer(This, openintW, ARRAY_SIZE(openintW));
1559
1560 return S_OK;
1561}

◆ SAXLexicalHandler_startEntity()

static HRESULT WINAPI SAXLexicalHandler_startEntity ( ISAXLexicalHandler *  iface,
const WCHAR name,
int  len 
)
static

Definition at line 1575 of file mxwriter.c.

1576{
1578 FIXME("(%p)->(%s): stub\n", This, debugstr_wn(name, len));
1579 return E_NOTIMPL;
1580}

◆ set_element_name()

static void set_element_name ( mxwriter This,
const WCHAR name,
int  len 
)
static

Definition at line 652 of file mxwriter.c.

653{
654 SysFreeString(This->element);
655 if (name)
656 This->element = len != -1 ? SysAllocStringLen(name, len) : SysAllocString(name);
657 else
658 This->element = NULL;
659}

Referenced by flush_output_buffer(), mxwriter_write_starttag(), SAXContentHandler_characters(), and SAXContentHandler_endElement().

◆ VBSAXAttributes_AddRef()

static ULONG WINAPI VBSAXAttributes_AddRef ( IVBSAXAttributes *  iface)
static

Definition at line 3223 of file mxwriter.c.

3224{
3226 return ISAXAttributes_AddRef(&This->ISAXAttributes_iface);
3227}
static mxattributes * impl_from_IVBSAXAttributes(IVBSAXAttributes *iface)
Definition: mxwriter.c:208

◆ VBSAXAttributes_get_length()

static HRESULT WINAPI VBSAXAttributes_get_length ( IVBSAXAttributes *  iface,
int len 
)
static

Definition at line 3312 of file mxwriter.c.

3313{
3315 return ISAXAttributes_getLength(&This->ISAXAttributes_iface, len);
3316}

◆ VBSAXAttributes_GetIDsOfNames()

static HRESULT WINAPI VBSAXAttributes_GetIDsOfNames ( IVBSAXAttributes *  iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 3255 of file mxwriter.c.

3262{
3265 HRESULT hr;
3266
3267 TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
3268 lcid, rgDispId);
3269
3270 if(!rgszNames || cNames == 0 || !rgDispId)
3271 return E_INVALIDARG;
3272
3274 if(SUCCEEDED(hr))
3275 {
3276 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
3277 ITypeInfo_Release(typeinfo);
3278 }
3279
3280 return hr;
3281}
HRESULT get_typeinfo(enum type_id tid, ITypeInfo **ret)
Definition: apps.c:124
#define SUCCEEDED(hr)
Definition: intsafe.h:50
@ IVBSAXAttributes_tid
Definition: msxml_private.h:71

◆ VBSAXAttributes_getIndexFromName()

static HRESULT WINAPI VBSAXAttributes_getIndexFromName ( IVBSAXAttributes *  iface,
BSTR  uri,
BSTR  name,
int index 
)
static

Definition at line 3378 of file mxwriter.c.

3379{
3381 return ISAXAttributes_getIndexFromName(&This->ISAXAttributes_iface, uri, SysStringLen(uri),
3383}

◆ VBSAXAttributes_getIndexFromQName()

static HRESULT WINAPI VBSAXAttributes_getIndexFromQName ( IVBSAXAttributes *  iface,
BSTR  qname,
int index 
)
static

Definition at line 3385 of file mxwriter.c.

3386{
3388 return ISAXAttributes_getIndexFromQName(&This->ISAXAttributes_iface, qname,
3389 SysStringLen(qname), index);
3390}

◆ VBSAXAttributes_getLocalName()

static HRESULT WINAPI VBSAXAttributes_getLocalName ( IVBSAXAttributes *  iface,
int  index,
BSTR name 
)
static

Definition at line 3338 of file mxwriter.c.

3339{
3341 const WCHAR *nameW;
3342 HRESULT hr;
3343 int len;
3344
3345 TRACE("(%p)->(%d %p)\n", This, index, name);
3346
3347 if (!name)
3348 return E_POINTER;
3349
3350 *name = NULL;
3351 hr = ISAXAttributes_getLocalName(&This->ISAXAttributes_iface, index, &nameW, &len);
3352 if (FAILED(hr))
3353 return hr;
3354
3355 return return_bstrn(nameW, len, name);
3356}
static const WCHAR nameW[]
Definition: main.c:49
static HRESULT return_bstrn(const WCHAR *value, int len, BSTR *p)

◆ VBSAXAttributes_getQName()

static HRESULT WINAPI VBSAXAttributes_getQName ( IVBSAXAttributes *  iface,
int  index,
BSTR qname 
)
static

Definition at line 3358 of file mxwriter.c.

3359{
3361 const WCHAR *qnameW;
3362 HRESULT hr;
3363 int len;
3364
3365 TRACE("(%p)->(%d %p)\n", This, index, qname);
3366
3367 if (!qname)
3368 return E_POINTER;
3369
3370 *qname = NULL;
3371 hr = ISAXAttributes_getQName(&This->ISAXAttributes_iface, index, &qnameW, &len);
3372 if (FAILED(hr))
3373 return hr;
3374
3375 return return_bstrn(qnameW, len, qname);
3376}

◆ VBSAXAttributes_getType()

static HRESULT WINAPI VBSAXAttributes_getType ( IVBSAXAttributes *  iface,
int  index,
BSTR type 
)
static

Definition at line 3392 of file mxwriter.c.

3393{
3395 const WCHAR *typeW;
3396 HRESULT hr;
3397 int len;
3398
3399 TRACE("(%p)->(%d %p)\n", This, index, type);
3400
3401 if (!type)
3402 return E_POINTER;
3403
3404 *type = NULL;
3405 hr = ISAXAttributes_getType(&This->ISAXAttributes_iface, index, &typeW, &len);
3406 if (FAILED(hr))
3407 return hr;
3408
3409 return return_bstrn(typeW, len, type);
3410}
static const WCHAR typeW[]
Definition: name.c:51

◆ VBSAXAttributes_getTypeFromName()

static HRESULT WINAPI VBSAXAttributes_getTypeFromName ( IVBSAXAttributes *  iface,
BSTR  uri,
BSTR  name,
BSTR type 
)
static

Definition at line 3412 of file mxwriter.c.

3414{
3416 const WCHAR *typeW;
3417 HRESULT hr;
3418 int len;
3419
3420 TRACE("(%p)->(%s %s %p)\n", This, debugstr_w(uri), debugstr_w(name), type);
3421
3422 if (!type)
3423 return E_POINTER;
3424
3425 *type = NULL;
3426 hr = ISAXAttributes_getTypeFromName(&This->ISAXAttributes_iface, uri, SysStringLen(uri),
3428 if (FAILED(hr))
3429 return hr;
3430
3431 return return_bstrn(typeW, len, type);
3432}

◆ VBSAXAttributes_getTypeFromQName()

static HRESULT WINAPI VBSAXAttributes_getTypeFromQName ( IVBSAXAttributes *  iface,
BSTR  qname,
BSTR type 
)
static

Definition at line 3434 of file mxwriter.c.

3435{
3437 const WCHAR *typeW;
3438 HRESULT hr;
3439 int len;
3440
3441 TRACE("(%p)->(%s %p)\n", This, debugstr_w(qname), type);
3442
3443 if (!type)
3444 return E_POINTER;
3445
3446 *type = NULL;
3447 hr = ISAXAttributes_getTypeFromQName(&This->ISAXAttributes_iface, qname, SysStringLen(qname),
3448 &typeW, &len);
3449 if (FAILED(hr))
3450 return hr;
3451
3452 return return_bstrn(typeW, len, type);
3453}

◆ VBSAXAttributes_GetTypeInfo()

static HRESULT WINAPI VBSAXAttributes_GetTypeInfo ( IVBSAXAttributes *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 3246 of file mxwriter.c.

3249{
3251 TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
3252 return get_typeinfo(IVBSAXAttributes_tid, ppTInfo);
3253}

◆ VBSAXAttributes_GetTypeInfoCount()

static HRESULT WINAPI VBSAXAttributes_GetTypeInfoCount ( IVBSAXAttributes *  iface,
UINT pctinfo 
)
static

Definition at line 3235 of file mxwriter.c.

3236{
3238
3239 TRACE("(%p)->(%p)\n", This, pctinfo);
3240
3241 *pctinfo = 1;
3242
3243 return S_OK;
3244}

◆ VBSAXAttributes_getURI()

static HRESULT WINAPI VBSAXAttributes_getURI ( IVBSAXAttributes *  iface,
int  index,
BSTR uri 
)
static

Definition at line 3318 of file mxwriter.c.

3319{
3321 const WCHAR *uriW;
3322 HRESULT hr;
3323 int len;
3324
3325 TRACE("(%p)->(%d %p)\n", This, index, uri);
3326
3327 if (!uri)
3328 return E_POINTER;
3329
3330 *uri = NULL;
3331 hr = ISAXAttributes_getURI(&This->ISAXAttributes_iface, index, &uriW, &len);
3332 if (FAILED(hr))
3333 return hr;
3334
3335 return return_bstrn(uriW, len, uri);
3336}

◆ VBSAXAttributes_getValue()

static HRESULT WINAPI VBSAXAttributes_getValue ( IVBSAXAttributes *  iface,
int  index,
BSTR value 
)
static

Definition at line 3455 of file mxwriter.c.

3456{
3458 const WCHAR *valueW;
3459 HRESULT hr;
3460 int len;
3461
3462 TRACE("(%p)->(%d %p)\n", This, index, value);
3463
3464 if (!value)
3465 return E_POINTER;
3466
3467 *value = NULL;
3468 hr = ISAXAttributes_getValue(&This->ISAXAttributes_iface, index, &valueW, &len);
3469 if (FAILED(hr))
3470 return hr;
3471
3472 return return_bstrn(valueW, len, value);
3473}