2005-08-02 13:29:04 +02:00
|
|
|
/*
|
2010-02-12 04:44:59 +01:00
|
|
|
* Common definitions
|
2005-08-02 13:29:04 +02:00
|
|
|
*
|
|
|
|
* Copyright 2005 Mike McCormack
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-08-02 13:29:04 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MSXML_PRIVATE__
|
|
|
|
#define __MSXML_PRIVATE__
|
|
|
|
|
2008-08-21 23:37:48 +02:00
|
|
|
#include "dispex.h"
|
|
|
|
|
|
|
|
#include "wine/unicode.h"
|
|
|
|
|
2007-01-20 09:19:55 +01:00
|
|
|
#ifndef __WINE_CONFIG_H
|
|
|
|
# error You must include config.h to use this header
|
|
|
|
#endif
|
|
|
|
|
2010-11-24 20:53:47 +01:00
|
|
|
typedef enum {
|
|
|
|
MSXML_DEFAULT = 0,
|
2011-12-17 23:21:09 +01:00
|
|
|
MSXML2 = 20,
|
|
|
|
MSXML26 = 26,
|
|
|
|
MSXML3 = 30,
|
|
|
|
MSXML4 = 40,
|
|
|
|
MSXML6 = 60
|
2010-11-24 20:53:47 +01:00
|
|
|
} MSXML_VERSION;
|
|
|
|
|
2009-08-29 15:01:37 +02:00
|
|
|
/* typelibs */
|
|
|
|
typedef enum tid_t {
|
2011-11-02 21:13:24 +01:00
|
|
|
NULL_tid,
|
2009-08-29 15:01:37 +02:00
|
|
|
IXMLDOMAttribute_tid,
|
|
|
|
IXMLDOMCDATASection_tid,
|
|
|
|
IXMLDOMComment_tid,
|
|
|
|
IXMLDOMDocument_tid,
|
|
|
|
IXMLDOMDocument2_tid,
|
2011-11-19 15:00:24 +01:00
|
|
|
IXMLDOMDocument3_tid,
|
2009-08-29 15:01:37 +02:00
|
|
|
IXMLDOMDocumentFragment_tid,
|
2010-11-04 23:34:01 +01:00
|
|
|
IXMLDOMDocumentType_tid,
|
2009-08-29 15:01:37 +02:00
|
|
|
IXMLDOMElement_tid,
|
|
|
|
IXMLDOMEntityReference_tid,
|
|
|
|
IXMLDOMImplementation_tid,
|
|
|
|
IXMLDOMNamedNodeMap_tid,
|
|
|
|
IXMLDOMNode_tid,
|
|
|
|
IXMLDOMNodeList_tid,
|
2011-12-14 13:42:23 +01:00
|
|
|
IXMLDOMParseError2_tid,
|
2009-08-29 15:01:37 +02:00
|
|
|
IXMLDOMProcessingInstruction_tid,
|
|
|
|
IXMLDOMSchemaCollection_tid,
|
2011-12-11 11:58:24 +01:00
|
|
|
IXMLDOMSchemaCollection2_tid,
|
2009-08-29 15:02:19 +02:00
|
|
|
IXMLDOMSelection_tid,
|
2009-08-29 15:01:37 +02:00
|
|
|
IXMLDOMText_tid,
|
|
|
|
IXMLElement_tid,
|
|
|
|
IXMLDocument_tid,
|
|
|
|
IXMLHTTPRequest_tid,
|
2011-02-12 14:40:36 +01:00
|
|
|
IXSLProcessor_tid,
|
2011-02-10 22:08:11 +01:00
|
|
|
IXSLTemplate_tid,
|
2009-08-29 15:01:37 +02:00
|
|
|
IVBSAXAttributes_tid,
|
|
|
|
IVBSAXContentHandler_tid,
|
|
|
|
IVBSAXDeclHandler_tid,
|
|
|
|
IVBSAXDTDHandler_tid,
|
|
|
|
IVBSAXEntityResolver_tid,
|
|
|
|
IVBSAXErrorHandler_tid,
|
|
|
|
IVBSAXLexicalHandler_tid,
|
|
|
|
IVBSAXLocator_tid,
|
|
|
|
IVBSAXXMLFilter_tid,
|
|
|
|
IVBSAXXMLReader_tid,
|
|
|
|
IMXAttributes_tid,
|
|
|
|
IMXReaderControl_tid,
|
|
|
|
IMXWriter_tid,
|
2011-08-21 19:44:28 +02:00
|
|
|
IVBMXNamespaceManager_tid,
|
2009-08-29 15:01:37 +02:00
|
|
|
LAST_tid
|
|
|
|
} tid_t;
|
|
|
|
|
2010-11-16 01:16:10 +01:00
|
|
|
/* The XDR datatypes (urn:schemas-microsoft-com:datatypes)
|
|
|
|
* These are actually valid for XSD schemas as well
|
|
|
|
* See datatypes.xsd
|
|
|
|
*/
|
|
|
|
typedef enum _XDR_DT {
|
|
|
|
DT_INVALID = -1,
|
|
|
|
DT_BIN_BASE64,
|
|
|
|
DT_BIN_HEX,
|
|
|
|
DT_BOOLEAN,
|
|
|
|
DT_CHAR,
|
|
|
|
DT_DATE,
|
|
|
|
DT_DATE_TZ,
|
|
|
|
DT_DATETIME,
|
|
|
|
DT_DATETIME_TZ,
|
|
|
|
DT_ENTITY,
|
|
|
|
DT_ENTITIES,
|
|
|
|
DT_ENUMERATION,
|
|
|
|
DT_FIXED_14_4,
|
|
|
|
DT_FLOAT,
|
|
|
|
DT_I1,
|
|
|
|
DT_I2,
|
|
|
|
DT_I4,
|
|
|
|
DT_I8,
|
|
|
|
DT_ID,
|
|
|
|
DT_IDREF,
|
|
|
|
DT_IDREFS,
|
|
|
|
DT_INT,
|
|
|
|
DT_NMTOKEN,
|
|
|
|
DT_NMTOKENS,
|
|
|
|
DT_NOTATION,
|
|
|
|
DT_NUMBER,
|
|
|
|
DT_R4,
|
|
|
|
DT_R8,
|
|
|
|
DT_STRING,
|
|
|
|
DT_TIME,
|
|
|
|
DT_TIME_TZ,
|
|
|
|
DT_UI1,
|
|
|
|
DT_UI2,
|
|
|
|
DT_UI4,
|
|
|
|
DT_UI8,
|
|
|
|
DT_URI,
|
2012-01-23 05:28:21 +01:00
|
|
|
DT_UUID,
|
|
|
|
LAST_DT
|
2010-11-16 01:16:10 +01:00
|
|
|
} XDR_DT;
|
|
|
|
|
2011-04-26 18:41:22 +02:00
|
|
|
extern HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo) DECLSPEC_HIDDEN;
|
|
|
|
extern void release_typelib(void) DECLSPEC_HIDDEN;
|
2009-08-29 15:01:37 +02:00
|
|
|
|
|
|
|
typedef struct dispex_data_t dispex_data_t;
|
|
|
|
typedef struct dispex_dynamic_data_t dispex_dynamic_data_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
HRESULT (*get_dispid)(IUnknown*,BSTR,DWORD,DISPID*);
|
|
|
|
HRESULT (*invoke)(IUnknown*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*);
|
|
|
|
} dispex_static_data_vtbl_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
const dispex_static_data_vtbl_t *vtbl;
|
|
|
|
const tid_t disp_tid;
|
|
|
|
dispex_data_t *data;
|
|
|
|
const tid_t* const iface_tids;
|
|
|
|
} dispex_static_data_t;
|
|
|
|
|
|
|
|
typedef struct {
|
2011-02-23 23:15:47 +01:00
|
|
|
IDispatchEx IDispatchEx_iface;
|
2009-08-29 15:01:37 +02:00
|
|
|
|
|
|
|
IUnknown *outer;
|
|
|
|
|
|
|
|
dispex_static_data_t *data;
|
|
|
|
dispex_dynamic_data_t *dynamic_data;
|
|
|
|
} DispatchEx;
|
|
|
|
|
2011-04-26 18:41:22 +02:00
|
|
|
extern HINSTANCE MSXML_hInstance DECLSPEC_HIDDEN;
|
2010-11-10 04:40:34 +01:00
|
|
|
|
2011-04-26 18:41:22 +02:00
|
|
|
void init_dispex(DispatchEx*,IUnknown*,dispex_static_data_t*) DECLSPEC_HIDDEN;
|
2011-10-29 23:27:50 +02:00
|
|
|
void release_dispex(DispatchEx*) DECLSPEC_HIDDEN;
|
2011-04-26 18:41:22 +02:00
|
|
|
BOOL dispex_query_interface(DispatchEx*,REFIID,void**) DECLSPEC_HIDDEN;
|
2011-11-22 18:19:31 +01:00
|
|
|
const IID *get_riid_from_tid(enum tid_t tid) DECLSPEC_HIDDEN;
|
2009-08-29 15:01:37 +02:00
|
|
|
|
2011-03-10 20:15:09 +01:00
|
|
|
/* memory allocation functions */
|
|
|
|
|
|
|
|
static inline void *heap_alloc(size_t len)
|
|
|
|
{
|
|
|
|
return HeapAlloc(GetProcessHeap(), 0, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void *heap_alloc_zero(size_t len)
|
|
|
|
{
|
|
|
|
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void *heap_realloc(void *mem, size_t len)
|
|
|
|
{
|
|
|
|
return HeapReAlloc(GetProcessHeap(), 0, mem, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline BOOL heap_free(void *mem)
|
|
|
|
{
|
|
|
|
return HeapFree(GetProcessHeap(), 0, mem);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline LPWSTR heap_strdupW(LPCWSTR str)
|
|
|
|
{
|
|
|
|
LPWSTR ret = NULL;
|
|
|
|
|
|
|
|
if(str) {
|
|
|
|
DWORD size;
|
|
|
|
|
|
|
|
size = (strlenW(str)+1)*sizeof(WCHAR);
|
|
|
|
ret = heap_alloc(size);
|
|
|
|
memcpy(ret, str, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2011-08-13 01:11:08 +02:00
|
|
|
static inline LPSTR heap_strdupWtoA(LPCWSTR str)
|
|
|
|
{
|
|
|
|
LPSTR ret = NULL;
|
|
|
|
|
|
|
|
if(str) {
|
|
|
|
DWORD len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
|
|
|
|
ret = heap_alloc(len+1);
|
|
|
|
if(!ret)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
WideCharToMultiByte(CP_ACP, 0, str, -1, ret, len+1, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2009-09-01 14:05:02 +02:00
|
|
|
#ifdef HAVE_LIBXML2
|
|
|
|
|
2011-04-26 18:41:22 +02:00
|
|
|
extern void schemasInit(void) DECLSPEC_HIDDEN;
|
|
|
|
extern void schemasCleanup(void) DECLSPEC_HIDDEN;
|
2010-11-12 15:33:17 +01:00
|
|
|
|
2010-11-11 22:16:24 +01:00
|
|
|
#ifndef HAVE_XMLFIRSTELEMENTCHILD
|
2010-11-27 00:35:20 +01:00
|
|
|
static inline xmlNodePtr wine_xmlFirstElementChild(xmlNodePtr parent)
|
|
|
|
{
|
2010-11-11 22:16:24 +01:00
|
|
|
xmlNodePtr child;
|
|
|
|
for (child = parent->children; child != NULL; child = child->next)
|
|
|
|
if (child->type == XML_ELEMENT_NODE)
|
|
|
|
break;
|
|
|
|
|
|
|
|
return child;
|
|
|
|
}
|
2010-11-27 00:35:20 +01:00
|
|
|
#define xmlFirstElementChild wine_xmlFirstElementChild
|
2010-11-11 22:16:24 +01:00
|
|
|
#endif
|
|
|
|
|
2011-11-12 22:45:10 +01:00
|
|
|
/* IXMLDOMNode Internal Structure */
|
|
|
|
typedef struct _xmlnode
|
|
|
|
{
|
|
|
|
DispatchEx dispex;
|
|
|
|
IXMLDOMNode *iface;
|
|
|
|
IXMLDOMNode *parent;
|
|
|
|
xmlNodePtr node;
|
|
|
|
} xmlnode;
|
|
|
|
|
|
|
|
/* IXMLDOMNamedNodeMap custom function table */
|
|
|
|
struct nodemap_funcs
|
|
|
|
{
|
|
|
|
HRESULT (*get_named_item)(const xmlNodePtr,BSTR,IXMLDOMNode**);
|
|
|
|
HRESULT (*set_named_item)(xmlNodePtr,IXMLDOMNode*,IXMLDOMNode**);
|
|
|
|
HRESULT (*remove_named_item)(xmlNodePtr,BSTR,IXMLDOMNode**);
|
|
|
|
HRESULT (*get_item)(xmlNodePtr,LONG,IXMLDOMNode**);
|
|
|
|
HRESULT (*get_length)(xmlNodePtr,LONG*);
|
|
|
|
HRESULT (*get_qualified_item)(const xmlNodePtr,BSTR,BSTR,IXMLDOMNode**);
|
|
|
|
HRESULT (*remove_qualified_item)(xmlNodePtr,BSTR,BSTR,IXMLDOMNode**);
|
|
|
|
HRESULT (*next_node)(const xmlNodePtr,LONG*,IXMLDOMNode**);
|
|
|
|
};
|
|
|
|
|
2009-09-01 14:05:02 +02:00
|
|
|
/* constructors */
|
2011-04-26 18:41:22 +02:00
|
|
|
extern IUnknown *create_domdoc( xmlNodePtr ) DECLSPEC_HIDDEN;
|
|
|
|
extern IUnknown *create_xmldoc( void ) DECLSPEC_HIDDEN;
|
|
|
|
extern IXMLDOMNode *create_node( xmlNodePtr ) DECLSPEC_HIDDEN;
|
|
|
|
extern IUnknown *create_element( xmlNodePtr ) DECLSPEC_HIDDEN;
|
|
|
|
extern IUnknown *create_attribute( xmlNodePtr ) DECLSPEC_HIDDEN;
|
|
|
|
extern IUnknown *create_text( xmlNodePtr ) DECLSPEC_HIDDEN;
|
|
|
|
extern IUnknown *create_pi( xmlNodePtr ) DECLSPEC_HIDDEN;
|
|
|
|
extern IUnknown *create_comment( xmlNodePtr ) DECLSPEC_HIDDEN;
|
|
|
|
extern IUnknown *create_cdata( xmlNodePtr ) DECLSPEC_HIDDEN;
|
|
|
|
extern IXMLDOMNodeList *create_children_nodelist( xmlNodePtr ) DECLSPEC_HIDDEN;
|
2011-11-12 22:45:10 +01:00
|
|
|
extern IXMLDOMNamedNodeMap *create_nodemap( xmlNodePtr, const struct nodemap_funcs* ) DECLSPEC_HIDDEN;
|
2011-04-26 18:41:22 +02:00
|
|
|
extern IUnknown *create_doc_Implementation(void) DECLSPEC_HIDDEN;
|
|
|
|
extern IUnknown *create_doc_fragment( xmlNodePtr ) DECLSPEC_HIDDEN;
|
|
|
|
extern IUnknown *create_doc_entity_ref( xmlNodePtr ) DECLSPEC_HIDDEN;
|
|
|
|
extern IUnknown *create_doc_type( xmlNodePtr ) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT create_selection( xmlNodePtr, xmlChar*, IXMLDOMNodeList** ) DECLSPEC_HIDDEN;
|
2009-09-01 14:05:02 +02:00
|
|
|
|
|
|
|
/* data accessors */
|
2011-04-26 18:41:22 +02:00
|
|
|
xmlNodePtr xmlNodePtr_from_domnode( IXMLDOMNode *iface, xmlElementType type ) DECLSPEC_HIDDEN;
|
2009-09-01 14:05:02 +02:00
|
|
|
|
|
|
|
/* helpers */
|
2011-04-26 18:41:22 +02:00
|
|
|
extern xmlChar *xmlChar_from_wchar( LPCWSTR str ) DECLSPEC_HIDDEN;
|
2009-09-01 14:05:02 +02:00
|
|
|
|
2011-08-24 14:00:16 +02:00
|
|
|
extern void xmldoc_init( xmlDocPtr doc, MSXML_VERSION version ) DECLSPEC_HIDDEN;
|
2011-04-26 18:41:22 +02:00
|
|
|
extern LONG xmldoc_add_ref( xmlDocPtr doc ) DECLSPEC_HIDDEN;
|
|
|
|
extern LONG xmldoc_release( xmlDocPtr doc ) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT xmldoc_add_orphan( xmlDocPtr doc, xmlNodePtr node ) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT xmldoc_remove_orphan( xmlDocPtr doc, xmlNodePtr node ) DECLSPEC_HIDDEN;
|
|
|
|
extern void xmldoc_link_xmldecl(xmlDocPtr doc, xmlNodePtr node) DECLSPEC_HIDDEN;
|
|
|
|
extern xmlNodePtr xmldoc_unlink_xmldecl(xmlDocPtr doc) DECLSPEC_HIDDEN;
|
2009-09-01 14:05:02 +02:00
|
|
|
|
2011-04-26 18:41:22 +02:00
|
|
|
extern HRESULT XMLElement_create( IUnknown *pUnkOuter, xmlNodePtr node, LPVOID *ppObj, BOOL own ) DECLSPEC_HIDDEN;
|
2009-09-01 14:05:02 +02:00
|
|
|
|
2011-04-26 18:41:22 +02:00
|
|
|
extern void wineXmlCallbackLog(char const* caller, xmlErrorLevel lvl, char const* msg, va_list ap) DECLSPEC_HIDDEN;
|
|
|
|
extern void wineXmlCallbackError(char const* caller, xmlErrorPtr err) DECLSPEC_HIDDEN;
|
2010-10-27 16:35:56 +02:00
|
|
|
|
|
|
|
#define LIBXML2_LOG_CALLBACK __WINE_PRINTF_ATTR(2,3)
|
|
|
|
|
|
|
|
#define LIBXML2_CALLBACK_TRACE(caller, msg, ap) \
|
|
|
|
wineXmlCallbackLog(#caller, XML_ERR_NONE, msg, ap)
|
|
|
|
|
|
|
|
#define LIBXML2_CALLBACK_WARN(caller, msg, ap) \
|
|
|
|
wineXmlCallbackLog(#caller, XML_ERR_WARNING, msg, ap)
|
|
|
|
|
|
|
|
#define LIBXML2_CALLBACK_ERR(caller, msg, ap) \
|
|
|
|
wineXmlCallbackLog(#caller, XML_ERR_ERROR, msg, ap)
|
|
|
|
|
2010-11-17 14:21:09 +01:00
|
|
|
#define LIBXML2_CALLBACK_SERROR(caller, err) wineXmlCallbackError(#caller, err)
|
2009-09-01 14:05:02 +02:00
|
|
|
|
2011-04-26 18:41:22 +02:00
|
|
|
extern BOOL is_preserving_whitespace(xmlNodePtr node) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL is_xpathmode(const xmlDocPtr doc) DECLSPEC_HIDDEN;
|
|
|
|
extern void set_xpathmode(xmlDocPtr doc, BOOL xpath) DECLSPEC_HIDDEN;
|
2010-11-03 22:13:58 +01:00
|
|
|
|
2011-04-26 18:41:22 +02:00
|
|
|
extern void init_xmlnode(xmlnode*,xmlNodePtr,IXMLDOMNode*,dispex_static_data_t*) DECLSPEC_HIDDEN;
|
|
|
|
extern void destroy_xmlnode(xmlnode*) DECLSPEC_HIDDEN;
|
|
|
|
extern BOOL node_query_interface(xmlnode*,REFIID,void**) DECLSPEC_HIDDEN;
|
|
|
|
extern xmlnode *get_node_obj(IXMLDOMNode*) DECLSPEC_HIDDEN;
|
|
|
|
|
|
|
|
extern HRESULT node_append_child(xmlnode*,IXMLDOMNode*,IXMLDOMNode**) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_get_nodeName(xmlnode*,BSTR*) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_get_content(xmlnode*,VARIANT*) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_set_content(xmlnode*,LPCWSTR) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_put_value(xmlnode*,VARIANT*) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_put_value_escaped(xmlnode*,VARIANT*) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_get_parent(xmlnode*,IXMLDOMNode**) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_get_child_nodes(xmlnode*,IXMLDOMNodeList**) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_get_first_child(xmlnode*,IXMLDOMNode**) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_get_last_child(xmlnode*,IXMLDOMNode**) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_get_previous_sibling(xmlnode*,IXMLDOMNode**) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_get_next_sibling(xmlnode*,IXMLDOMNode**) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_insert_before(xmlnode*,IXMLDOMNode*,const VARIANT*,IXMLDOMNode**) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_replace_child(xmlnode*,IXMLDOMNode*,IXMLDOMNode*,IXMLDOMNode**) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_put_text(xmlnode*,BSTR) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_get_xml(xmlnode*,BOOL,BOOL,BSTR*) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_clone(xmlnode*,VARIANT_BOOL,IXMLDOMNode**) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_get_prefix(xmlnode*,BSTR*) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_get_base_name(xmlnode*,BSTR*) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_get_namespaceURI(xmlnode*,BSTR*) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_remove_child(xmlnode*,IXMLDOMNode*,IXMLDOMNode**) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_has_childnodes(const xmlnode*,VARIANT_BOOL*) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_get_owner_doc(const xmlnode*,IXMLDOMDocument**) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_get_text(const xmlnode*,BSTR*) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_select_nodes(const xmlnode*,BSTR,IXMLDOMNodeList**) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_select_singlenode(const xmlnode*,BSTR,IXMLDOMNode**) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT node_transform_node(const xmlnode*,IXMLDOMNode*,BSTR*) DECLSPEC_HIDDEN;
|
2011-11-19 14:33:10 +01:00
|
|
|
extern HRESULT node_create_supporterrorinfo(const tid_t*,void**) DECLSPEC_HIDDEN;
|
2011-04-26 18:41:22 +02:00
|
|
|
|
|
|
|
extern HRESULT get_domdoc_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **document) DECLSPEC_HIDDEN;
|
|
|
|
|
2012-01-24 08:40:56 +01:00
|
|
|
extern HRESULT SchemaCache_validate_tree(IXMLDOMSchemaCollection2*, xmlNodePtr) DECLSPEC_HIDDEN;
|
|
|
|
extern XDR_DT SchemaCache_get_node_dt(IXMLDOMSchemaCollection2*, xmlNodePtr) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT cache_from_doc_ns(IXMLDOMSchemaCollection2*, xmlnode*) DECLSPEC_HIDDEN;
|
2011-04-26 18:41:22 +02:00
|
|
|
|
|
|
|
extern XDR_DT str_to_dt(xmlChar const* str, int len /* calculated if -1 */) DECLSPEC_HIDDEN;
|
|
|
|
extern XDR_DT bstr_to_dt(OLECHAR const* bstr, int len /* calculated if -1 */) DECLSPEC_HIDDEN;
|
|
|
|
extern xmlChar const* dt_to_str(XDR_DT dt) DECLSPEC_HIDDEN;
|
2011-09-21 16:45:11 +02:00
|
|
|
extern const char* debugstr_dt(XDR_DT dt) DECLSPEC_HIDDEN;
|
2011-04-26 18:41:22 +02:00
|
|
|
extern OLECHAR const* dt_to_bstr(XDR_DT dt) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT dt_validate(XDR_DT dt, xmlChar const* content) DECLSPEC_HIDDEN;
|
|
|
|
|
|
|
|
extern BSTR EnsureCorrectEOL(BSTR) DECLSPEC_HIDDEN;
|
|
|
|
|
|
|
|
extern xmlChar* tagName_to_XPath(const BSTR tagName) DECLSPEC_HIDDEN;
|
2010-11-23 03:59:20 +01:00
|
|
|
|
2009-08-14 12:23:05 +02:00
|
|
|
static inline BSTR bstr_from_xmlChar(const xmlChar *str)
|
|
|
|
{
|
|
|
|
BSTR ret = NULL;
|
|
|
|
|
|
|
|
if(str) {
|
|
|
|
DWORD len = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)str, -1, NULL, 0);
|
|
|
|
ret = SysAllocStringLen(NULL, len-1);
|
|
|
|
if(ret)
|
|
|
|
MultiByteToWideChar( CP_UTF8, 0, (LPCSTR)str, -1, ret, len);
|
|
|
|
}
|
2010-02-12 19:26:50 +01:00
|
|
|
else
|
|
|
|
ret = SysAllocStringLen(NULL, 0);
|
2009-08-14 12:23:05 +02:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2011-12-18 19:12:19 +01:00
|
|
|
static inline xmlChar *xmlchar_from_wcharn(const WCHAR *str, int nchars)
|
|
|
|
{
|
|
|
|
xmlChar *xmlstr;
|
|
|
|
DWORD len = WideCharToMultiByte( CP_UTF8, 0, str, nchars, NULL, 0, NULL, NULL );
|
|
|
|
|
|
|
|
xmlstr = heap_alloc( len+1 );
|
|
|
|
if ( xmlstr )
|
|
|
|
{
|
|
|
|
WideCharToMultiByte( CP_UTF8, 0, str, nchars, (LPSTR) xmlstr, len+1, NULL, NULL );
|
|
|
|
xmlstr[len] = 0;
|
|
|
|
}
|
|
|
|
return xmlstr;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline xmlChar *xmlchar_from_wchar( const WCHAR *str )
|
|
|
|
{
|
|
|
|
return xmlchar_from_wcharn(str, -1);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-09-04 17:56:25 +02:00
|
|
|
static inline HRESULT return_bstr(const WCHAR *value, BSTR *p)
|
|
|
|
{
|
|
|
|
if(!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
if(value) {
|
|
|
|
*p = SysAllocString(value);
|
|
|
|
if(!*p)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}else {
|
|
|
|
*p = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2010-09-08 15:12:14 +02:00
|
|
|
static inline HRESULT return_null_node(IXMLDOMNode **p)
|
|
|
|
{
|
|
|
|
if(!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
*p = NULL;
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
|
2010-09-10 16:54:06 +02:00
|
|
|
static inline HRESULT return_null_ptr(void **p)
|
|
|
|
{
|
|
|
|
if(!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
*p = NULL;
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
|
2010-10-19 01:13:30 +02:00
|
|
|
static inline HRESULT return_null_var(VARIANT *p)
|
|
|
|
{
|
|
|
|
if(!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
V_VT(p) = VT_NULL;
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
|
2010-10-31 10:22:53 +01:00
|
|
|
static inline HRESULT return_null_bstr(BSTR *p)
|
|
|
|
{
|
|
|
|
if(!p)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*p = NULL;
|
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
|
2008-01-07 20:04:50 +01:00
|
|
|
extern IXMLDOMParseError *create_parseError( LONG code, BSTR url, BSTR reason, BSTR srcText,
|
2011-04-26 18:41:22 +02:00
|
|
|
LONG line, LONG linepos, LONG filepos ) DECLSPEC_HIDDEN;
|
2011-08-24 14:00:16 +02:00
|
|
|
extern HRESULT DOMDocument_create(MSXML_VERSION, IUnknown*, void**) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT SchemaCache_create(MSXML_VERSION, IUnknown*, void**) DECLSPEC_HIDDEN;
|
2011-04-26 18:41:22 +02:00
|
|
|
extern HRESULT XMLDocument_create(IUnknown*, void**) DECLSPEC_HIDDEN;
|
2011-10-24 20:08:46 +02:00
|
|
|
extern HRESULT SAXXMLReader_create(MSXML_VERSION, IUnknown*, void**) DECLSPEC_HIDDEN;
|
2011-04-26 18:41:22 +02:00
|
|
|
extern HRESULT XMLHTTPRequest_create(IUnknown*, void **) DECLSPEC_HIDDEN;
|
|
|
|
extern HRESULT XSLTemplate_create(IUnknown*, void**) DECLSPEC_HIDDEN;
|
2011-08-24 14:06:58 +02:00
|
|
|
extern HRESULT MXWriter_create(MSXML_VERSION, IUnknown*, void**) DECLSPEC_HIDDEN;
|
2011-08-21 19:30:58 +02:00
|
|
|
extern HRESULT MXNamespaceManager_create(IUnknown*,void**) DECLSPEC_HIDDEN;
|
2011-08-30 12:13:11 +02:00
|
|
|
extern HRESULT XMLParser_create(IUnknown*,void**) DECLSPEC_HIDDEN;
|
2008-01-07 20:04:50 +01:00
|
|
|
|
2010-12-01 19:45:34 +01:00
|
|
|
static inline const CLSID* DOMDocument_version(MSXML_VERSION v)
|
2010-11-24 20:53:47 +01:00
|
|
|
{
|
|
|
|
switch (v)
|
|
|
|
{
|
2010-12-01 19:45:34 +01:00
|
|
|
default:
|
|
|
|
case MSXML_DEFAULT: return &CLSID_DOMDocument;
|
|
|
|
case MSXML3: return &CLSID_DOMDocument30;
|
|
|
|
case MSXML4: return &CLSID_DOMDocument40;
|
|
|
|
case MSXML6: return &CLSID_DOMDocument60;
|
2010-11-24 20:53:47 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-01 19:45:34 +01:00
|
|
|
static inline const CLSID* SchemaCache_version(MSXML_VERSION v)
|
2010-11-24 20:53:47 +01:00
|
|
|
{
|
|
|
|
switch (v)
|
|
|
|
{
|
2010-12-01 19:45:34 +01:00
|
|
|
default:
|
|
|
|
case MSXML_DEFAULT: return &CLSID_XMLSchemaCache;
|
|
|
|
case MSXML3: return &CLSID_XMLSchemaCache30;
|
|
|
|
case MSXML4: return &CLSID_XMLSchemaCache40;
|
|
|
|
case MSXML6: return &CLSID_XMLSchemaCache60;
|
2010-11-24 20:53:47 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-27 19:54:38 +02:00
|
|
|
typedef struct bsc_t bsc_t;
|
|
|
|
|
2011-04-26 18:41:22 +02:00
|
|
|
HRESULT bind_url(LPCWSTR, HRESULT (*onDataAvailable)(void*,char*,DWORD), void*, bsc_t**) DECLSPEC_HIDDEN;
|
2011-10-24 12:55:00 +02:00
|
|
|
HRESULT detach_bsc(bsc_t*) DECLSPEC_HIDDEN;
|
2008-07-27 19:54:38 +02:00
|
|
|
|
2011-04-26 18:41:22 +02:00
|
|
|
const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN;
|
2010-12-30 13:07:50 +01:00
|
|
|
|
2010-11-01 20:12:04 +01:00
|
|
|
/* Error Codes - not defined anywhere in the public headers */
|
|
|
|
#define E_XML_ELEMENT_UNDECLARED 0xC00CE00D
|
|
|
|
#define E_XML_ELEMENT_ID_NOT_FOUND 0xC00CE00E
|
|
|
|
/* ... */
|
|
|
|
#define E_XML_EMPTY_NOT_ALLOWED 0xC00CE011
|
|
|
|
#define E_XML_ELEMENT_NOT_COMPLETE 0xC00CE012
|
|
|
|
#define E_XML_ROOT_NAME_MISMATCH 0xC00CE013
|
|
|
|
#define E_XML_INVALID_CONTENT 0xC00CE014
|
|
|
|
#define E_XML_ATTRIBUTE_NOT_DEFINED 0xC00CE015
|
|
|
|
#define E_XML_ATTRIBUTE_FIXED 0xC00CE016
|
|
|
|
#define E_XML_ATTRIBUTE_VALUE 0xC00CE017
|
|
|
|
#define E_XML_ILLEGAL_TEXT 0xC00CE018
|
|
|
|
/* ... */
|
|
|
|
#define E_XML_REQUIRED_ATTRIBUTE_MISSING 0xC00CE020
|
|
|
|
|
2005-08-02 13:29:04 +02:00
|
|
|
#endif /* __MSXML_PRIVATE__ */
|