4 * Copyright 2005 Mike McCormack
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __MSXML_PRIVATE__
22 #define __MSXML_PRIVATE__
26 #include "wine/unicode.h"
28 #ifndef __WINE_CONFIG_H
29 # error You must include config.h to use this header
34 #ifdef HAVE_LIBXML_PARSER_H
35 #include <libxml/parser.h>
39 extern IUnknown
*create_domdoc( xmlNodePtr document
);
40 extern IUnknown
*create_xmldoc( void );
41 extern IXMLDOMNode
*create_node( xmlNodePtr node
);
42 extern IUnknown
*create_basic_node( xmlNodePtr node
, IUnknown
*pUnkOuter
);
43 extern IUnknown
*create_element( xmlNodePtr element
, IUnknown
*pUnkOuter
);
44 extern IUnknown
*create_attribute( xmlNodePtr attribute
);
45 extern IUnknown
*create_text( xmlNodePtr text
);
46 extern IUnknown
*create_pi( xmlNodePtr pi
);
47 extern IUnknown
*create_comment( xmlNodePtr comment
);
48 extern IUnknown
*create_cdata( xmlNodePtr text
);
49 extern IXMLDOMNodeList
*create_children_nodelist( xmlNodePtr
);
50 extern IXMLDOMNamedNodeMap
*create_nodemap( IXMLDOMNode
*node
);
51 extern IUnknown
*create_doc_Implementation();
52 extern IUnknown
*create_doc_fragment( xmlNodePtr fragment
);
53 extern IUnknown
*create_doc_entity_ref( xmlNodePtr entity
);
55 extern HRESULT
queryresult_create( xmlNodePtr
, LPWSTR
, IXMLDOMNodeList
** );
58 xmlNodePtr
xmlNodePtr_from_domnode( IXMLDOMNode
*iface
, xmlElementType type
);
61 extern xmlChar
*xmlChar_from_wchar( LPWSTR str
);
62 extern BSTR
bstr_from_xmlChar( const xmlChar
*buf
);
64 extern LONG
xmldoc_add_ref( xmlDocPtr doc
);
65 extern LONG
xmldoc_release( xmlDocPtr doc
);
66 extern HRESULT
xmldoc_add_orphan( xmlDocPtr doc
, xmlNodePtr node
);
67 extern HRESULT
xmldoc_remove_orphan( xmlDocPtr doc
, xmlNodePtr node
);
69 extern HRESULT
XMLElement_create( IUnknown
*pUnkOuter
, xmlNodePtr node
, LPVOID
*ppObj
);
71 extern xmlDocPtr
parse_xml(char *ptr
, int len
);
73 /* IXMLDOMNode Internal Structure */
74 typedef struct _xmlnode
76 const struct IXMLDOMNodeVtbl
*lpVtbl
;
77 const struct IUnknownVtbl
*lpInternalUnkVtbl
;
83 static inline xmlnode
*impl_from_IXMLDOMNode( IXMLDOMNode
*iface
)
85 return (xmlnode
*)((char*)iface
- FIELD_OFFSET(xmlnode
, lpVtbl
));
88 extern HRESULT
DOMDocument_create_from_xmldoc(xmlDocPtr xmldoc
, IXMLDOMDocument2
**document
);
94 # ifdef HAVE_LIBXSLT_PATTERN_H
95 # include <libxslt/pattern.h>
97 # ifdef HAVE_LIBXSLT_TRANSFORM_H
98 # include <libxslt/transform.h>
100 # include <libxslt/xsltutils.h>
101 # include <libxslt/xsltInternals.h>
103 # define MAKE_FUNCPTR(f) extern typeof(f) * p##f
104 MAKE_FUNCPTR(xsltApplyStylesheet
);
105 MAKE_FUNCPTR(xsltCleanupGlobals
);
106 MAKE_FUNCPTR(xsltFreeStylesheet
);
107 MAKE_FUNCPTR(xsltParseStylesheetDoc
);
111 extern IXMLDOMParseError
*create_parseError( LONG code
, BSTR url
, BSTR reason
, BSTR srcText
,
112 LONG line
, LONG linepos
, LONG filepos
);
113 extern HRESULT
DOMDocument_create( IUnknown
*pUnkOuter
, LPVOID
*ppObj
);
114 extern HRESULT
SchemaCache_create( IUnknown
*pUnkOuter
, LPVOID
*ppObj
);
115 extern HRESULT
XMLDocument_create( IUnknown
*pUnkOuter
, LPVOID
*ppObj
);
116 extern HRESULT
SAXXMLReader_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
);
117 extern HRESULT
XMLHTTPRequest_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
);
119 typedef struct bsc_t bsc_t
;
121 HRESULT
bind_url(LPCWSTR
, HRESULT (*onDataAvailable
)(void*,char*,DWORD
), void*, bsc_t
**);
122 void detach_bsc(bsc_t
*);
126 IXMLDOMAttribute_tid
,
127 IXMLDOMCDATASection_tid
,
130 IXMLDOMDocument2_tid
,
131 IXMLDOMDocumentFragment_tid
,
133 IXMLDOMEntityReference_tid
,
134 IXMLDOMImplementation_tid
,
135 IXMLDOMNamedNodeMap_tid
,
138 IXMLDOMParseError_tid
,
139 IXMLDOMProcessingInstruction_tid
,
140 IXMLDOMSchemaCollection_tid
,
145 IVBSAXAttributes_tid
,
146 IVBSAXContentHandler_tid
,
147 IVBSAXDeclHandler_tid
,
148 IVBSAXDTDHandler_tid
,
149 IVBSAXEntityResolver_tid
,
150 IVBSAXErrorHandler_tid
,
151 IVBSAXLexicalHandler_tid
,
156 IMXReaderControl_tid
,
161 extern HRESULT
get_typeinfo(tid_t tid
, ITypeInfo
**typeinfo
);
162 extern void release_typelib(void);
164 typedef struct dispex_data_t dispex_data_t
;
165 typedef struct dispex_dynamic_data_t dispex_dynamic_data_t
;
167 #define MSXML_DISPID_CUSTOM_MIN 0x60000000
168 #define MSXML_DISPID_CUSTOM_MAX 0x6fffffff
171 HRESULT (*get_dispid
)(IUnknown
*,BSTR
,DWORD
,DISPID
*);
172 HRESULT (*invoke
)(IUnknown
*,DISPID
,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*);
173 } dispex_static_data_vtbl_t
;
176 const dispex_static_data_vtbl_t
*vtbl
;
177 const tid_t disp_tid
;
179 const tid_t
* const iface_tids
;
180 } dispex_static_data_t
;
183 const IDispatchExVtbl
*lpIDispatchExVtbl
;
187 dispex_static_data_t
*data
;
188 dispex_dynamic_data_t
*dynamic_data
;
191 void init_dispex(DispatchEx
*,IUnknown
*,dispex_static_data_t
*);
192 BOOL
dispex_query_interface(DispatchEx
*,REFIID
,void**);
194 /* memory allocation functions */
196 static inline void *heap_alloc(size_t len
)
198 return HeapAlloc(GetProcessHeap(), 0, len
);
201 static inline void *heap_alloc_zero(size_t len
)
203 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
206 static inline void *heap_realloc(void *mem
, size_t len
)
208 return HeapReAlloc(GetProcessHeap(), 0, mem
, len
);
211 static inline BOOL
heap_free(void *mem
)
213 return HeapFree(GetProcessHeap(), 0, mem
);
216 static inline LPWSTR
heap_strdupW(LPCWSTR str
)
223 size
= (strlenW(str
)+1)*sizeof(WCHAR
);
224 ret
= heap_alloc(size
);
225 memcpy(ret
, str
, size
);
231 #endif /* __MSXML_PRIVATE__ */