summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-20 13:55:58 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-20 13:55:58 +0000
commit04f4e2acfbc82946ca3def654214c08071a87359 (patch)
tree871e1f476ed5086e8ebbd7e182ea2a89707cc249
parent24cbc87262dc8856741db8e9f8388c18b16583ad (diff)
xml api became a set of functions
git-svn-id: http://svn.miranda-ng.org/main/trunk@14288 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--bin10/lib/mir_app.libbin43614 -> 55682 bytes
-rw-r--r--bin10/lib/mir_app64.libbin43576 -> 54494 bytes
-rw-r--r--bin12/lib/mir_app.libbin43614 -> 55682 bytes
-rw-r--r--bin12/lib/mir_app64.libbin43576 -> 54494 bytes
-rw-r--r--include/delphi/m_xml.inc308
-rw-r--r--include/m_xml.h175
-rw-r--r--make_core_def.cmd12
-rw-r--r--plugins/Actman/iac_chain.pas27
-rw-r--r--plugins/Actman/iac_contact.pas29
-rw-r--r--plugins/Actman/iac_dbrw.pas89
-rw-r--r--plugins/Actman/iac_global.pas71
-rw-r--r--plugins/Actman/iac_inout.pas50
-rw-r--r--plugins/Actman/iac_jump.pas122
-rw-r--r--plugins/Actman/iac_messagebox.pas23
-rw-r--r--plugins/Actman/iac_program.pas37
-rw-r--r--plugins/Actman/iac_service.pas109
-rw-r--r--plugins/Actman/iac_storage.pas9
-rw-r--r--plugins/Actman/iac_text.pas18
-rw-r--r--plugins/Actman/inoutxml.pas134
-rw-r--r--plugins/Actman/ua/i_inoutjson.inc2
-rw-r--r--plugins/Actman/ua/i_inoutxm.inc389
-rw-r--r--plugins/ImportTXT/BICQ5IP.inc47
-rw-r--r--plugins/New_GPG/src/init.cpp3
-rwxr-xr-xplugins/New_GPG/src/utilities.cpp46
-rw-r--r--plugins/NewsAggregator/Src/CheckFeed.cpp234
-rw-r--r--plugins/NewsAggregator/Src/Common.h105
-rw-r--r--plugins/NewsAggregator/Src/ExportImport.cpp138
-rw-r--r--plugins/NewsAggregator/Src/NewsAggregator.cpp2
-rw-r--r--plugins/NewsAggregator/Src/Options.cpp7
-rw-r--r--plugins/PasteIt/src/PasteIt.cpp2
-rw-r--r--plugins/PasteIt/src/PasteToWeb2.cpp32
-rw-r--r--plugins/Quotes/src/ModuleInfo.cpp3
-rw-r--r--plugins/Quotes/src/XMLEngineMI.cpp26
-rw-r--r--plugins/Watrack/lastfm/i_last_api.inc343
-rw-r--r--protocols/GTalkExt/src/GTalkExt.cpp1
-rw-r--r--protocols/GTalkExt/src/handlers.cpp186
-rw-r--r--protocols/Gadu-Gadu/src/avatar.cpp18
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp12
-rw-r--r--protocols/Gadu-Gadu/src/gg.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/oauth.cpp24
-rw-r--r--protocols/JabberG/src/jabber.cpp3
-rw-r--r--protocols/JabberG/src/jabber_adhoc.cpp86
-rw-r--r--protocols/JabberG/src/jabber_agent.cpp50
-rw-r--r--protocols/JabberG/src/jabber_archive.cpp34
-rw-r--r--protocols/JabberG/src/jabber_byte.cpp44
-rw-r--r--protocols/JabberG/src/jabber_caps.cpp6
-rw-r--r--protocols/JabberG/src/jabber_captcha.cpp30
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp4
-rw-r--r--protocols/JabberG/src/jabber_console.cpp52
-rw-r--r--protocols/JabberG/src/jabber_disco.cpp64
-rw-r--r--protocols/JabberG/src/jabber_form.cpp112
-rw-r--r--protocols/JabberG/src/jabber_ft.cpp72
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp80
-rw-r--r--protocols/JabberG/src/jabber_ibb.cpp8
-rw-r--r--protocols/JabberG/src/jabber_iq.cpp30
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp46
-rw-r--r--protocols/JabberG/src/jabber_iqid.cpp448
-rw-r--r--protocols/JabberG/src/jabber_iqid_muc.cpp42
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp4
-rw-r--r--protocols/JabberG/src/jabber_message_handlers.cpp14
-rw-r--r--protocols/JabberG/src/jabber_message_manager.cpp16
-rw-r--r--protocols/JabberG/src/jabber_misc.cpp8
-rw-r--r--protocols/JabberG/src/jabber_notes.cpp4
-rw-r--r--protocols/JabberG/src/jabber_opt.cpp82
-rw-r--r--protocols/JabberG/src/jabber_privacy.cpp46
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp10
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp80
-rw-r--r--protocols/JabberG/src/jabber_search.cpp80
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp324
-rw-r--r--protocols/JabberG/src/jabber_util.cpp24
-rw-r--r--protocols/JabberG/src/jabber_xml.cpp114
-rw-r--r--protocols/JabberG/src/jabber_xml.h76
-rw-r--r--protocols/JabberG/src/jabber_xstatus.cpp24
-rw-r--r--protocols/JabberG/src/jabber_xstatus.h2
-rw-r--r--protocols/SkypeWeb/src/main.cpp2
-rw-r--r--protocols/SkypeWeb/src/skype_chatrooms.cpp52
-rw-r--r--protocols/SkypeWeb/src/skype_history_sync.cpp26
-rw-r--r--protocols/SkypeWeb/src/skype_messages.cpp26
-rw-r--r--src/mir_app/src/mir_app.def55
-rw-r--r--src/mir_app/src/mir_app64.def55
-rw-r--r--src/mir_app/src/utils.cpp1
-rw-r--r--src/mir_app/src/xmlApi.cpp261
82 files changed, 2526 insertions, 2906 deletions
diff --git a/bin10/lib/mir_app.lib b/bin10/lib/mir_app.lib
index d0dc6f57df..65962b0bfb 100644
--- a/bin10/lib/mir_app.lib
+++ b/bin10/lib/mir_app.lib
Binary files differ
diff --git a/bin10/lib/mir_app64.lib b/bin10/lib/mir_app64.lib
index e227eed9c2..ac19364d97 100644
--- a/bin10/lib/mir_app64.lib
+++ b/bin10/lib/mir_app64.lib
Binary files differ
diff --git a/bin12/lib/mir_app.lib b/bin12/lib/mir_app.lib
index d0dc6f57df..65962b0bfb 100644
--- a/bin12/lib/mir_app.lib
+++ b/bin12/lib/mir_app.lib
Binary files differ
diff --git a/bin12/lib/mir_app64.lib b/bin12/lib/mir_app64.lib
index e227eed9c2..ac19364d97 100644
--- a/bin12/lib/mir_app64.lib
+++ b/bin12/lib/mir_app64.lib
Binary files differ
diff --git a/include/delphi/m_xml.inc b/include/delphi/m_xml.inc
index f58efbf78a..966cf736f1 100644
--- a/include/delphi/m_xml.inc
+++ b/include/delphi/m_xml.inc
@@ -60,193 +60,125 @@ type
eXMLErrorBase64DecodeTruncatedData,
eXMLErrorBase64DecodeBufferTooSmall);
-const
- XML_API_SIZEOF_V1 = SizeOf(size_t)+26*sizeof(dword);
+function xmlCreateNode(const name, text:PWideChar; IsDeclaration:boolean):HXML; stdcall;
+ external AppDll name 'xmlCreateNode';
+procedure xmlDestroyNode(node:HXML); stdcall;
+ external AppDll name 'xmlDestroyNode';
+
+function xmlParseString(const str:PWideChar; datalen:pint; const tag:PWideChar):HXML; stdcall;
+ external AppDll name 'xmlParseString';
+function xmlToString(node:HXML;datalen:pint):PWideChar; stdcall;
+ external AppDll name 'xmlToString';
+
+function xmlAddChild(parent:HXML; const name,text:PWideChar):HXML; stdcall;
+ external AppDll name 'xmlAddChild';
+procedure xmlAddChild2(child,parent:HXML); stdcall;
+ external AppDll name 'xmlAddChild2';
+function xmlCopyNode(parent:HXML):HXML; stdcall;
+ external AppDll name 'xmlCopyNode';
+function xmlGetChild(parent:HXML;number:int):HXML; stdcall;
+ external AppDll name 'xmlGetChild';
+function xmlGetChildCount(h:HXML):int; stdcall;
+ external AppDll name 'xmlGetChildCount';
+function xmlGetChildByAttrValue(parent:HXML; const name,attrName,attrValue:PWideChar):HXML; stdcall;
+ external AppDll name 'xmlGetChildByAttrValue';
+function xmlGetFirstChild(parent:HXML):HXML; stdcall;
+ external AppDll name 'xmlGetFirstChild';
+function xmlGetNthChild(parent:HXML; const name:PWideChar; i:int):HXML; stdcall;
+ external AppDll name 'xmlGetNthChild';
+function xmlGetNextChild(parent:HXML; const name:PWideChar; i:pint):HXML; stdcall;
+ external AppDll name 'xmlGetNextChild';
+function xmlGetChildByPath(parent:HXML; const path:PWideChar;createNodeIfMissing:boolean):HXML; stdcall;
+ external AppDll name 'xmlGetChildByPath';
+function xmlGetNextNode(node:HXML):HXML; stdcall;
+ external AppDll name 'xmlGetNextNode';
+function xmlGetName(h:HXML):PWideChar; stdcall;
+ external AppDll name 'xmlGetName';
+function xmlGetParent(h:HXML):HXML; stdcall;
+ external AppDll name 'xmlGetParent';
+function xmlGetText(h:HXML):PWideChar; stdcall; // = getTextByIndex(HXML, 0)
+ external AppDll name 'xmlGetText';
+procedure xmlSetText(h:HXML;value:PWideChar); stdcall; // = setTextByIndex(HXML, LPCTSTR, 0)
+ external AppDll name 'xmlSetText';
+
+function xmlGetAttr(h:HXML;i:int):PWideChar; stdcall;
+ external AppDll name 'xmlGetAttr';
+function xmlGetAttrName(h:HXML;i:int):PWideChar; stdcall;
+ external AppDll name 'xmlGetAttrName';
+function xmlGetAttrValue(h:HXML;const attrName:PWideChar):PWideChar; stdcall;
+ external AppDll name 'xmlGetAttrValue';
+function xmlGetAttrCount(h:HXML):int; stdcall;
+ external AppDll name 'xmlGetAttrCount';
+procedure xmlAddAttr(h:HXML;const attrName,attrValue:PWideChar); stdcall;
+ external AppDll name 'xmlAddAttr';
+procedure xmlAddAttrInt(h:HXML; const attrName:PWideChar;attrValue:int); stdcall;
+ external AppDll name 'xmlAddAttrInt';
+
+procedure xmlFree(arg:pointer); stdcall;
+ external AppDll name 'xmlFree';
+
+function xmlIsDeclaration(node:HXML):boolean; stdcall;
+ external AppDll name 'xmlIsDeclaration';
+function xmlToStringWithFormatting(node:HXML; var datalen:int):PWideChar; stdcall;
+ external AppDll name 'xmlToStringWithFormatting';
+function xmlDeepCopy(node:HXML):HXML; stdcall;
+ external AppDll name 'xmlDeepCopy';
+procedure xmlSetAttrByIndex(node:HXML; i:int; value:PWideChar); stdcall;
+ external AppDll name 'xmlSetAttrByIndex';
+procedure xmlSetAttrByName(node:HXML; name:PWideChar; value:PWideChar); stdcall;
+ external AppDll name 'xmlSetAttrByName';
+function xmlAddChildEx(parent:HXML; name:PWideChar; isDeclaration:boolean; n:XML_ELEMENT_POS):HXML; stdcall;
+ external AppDll name 'xmlAddChildEx';
+procedure xmlAddChildEx2(child:HXML; parent:HXML; n:XML_ELEMENT_POS); stdcall;
+ external AppDll name 'xmlAddChildEx2';
+function xmlGetTextCount(node:HXML):int; stdcall;
+ external AppDll name 'xmlGetTextCount';
+function xmlGetTextByIndex(node:HXML; i:int):PWideChar; stdcall;
+ external AppDll name 'xmlGetTextByIndex';
+procedure xmlAddText(node:HXML; txt:PWideChar; n:XML_ELEMENT_POS); stdcall;
+ external AppDll name 'xmlAddText';
+procedure xmlSetTextByIndex(node:HXML; i:int; txt:PWideChar); stdcall;
+ external AppDll name 'xmlSetTextByIndex';
+function xmlGetClearCount(node:HXML):int; stdcall;
+ external AppDll name 'xmlGetClearCount';
+function xmlGetClear(node:HXML; i:int; var openTag:PWideChar; var closeTag:PWideChar):PWideChar; stdcall;
+ external AppDll name 'xmlGetClear';
+procedure xmlAddClear(node:HXML; lpszValue:PWideChar; openTag:PWideChar; closeTag:PWideChar; n:XML_ELEMENT_POS); stdcall;
+ external AppDll name 'xmlAddClear';
+procedure xmlSetClear(node:HXML; i:int; lpszValue:PWideChar); stdcall;
+ external AppDll name 'xmlSetClear';
+function xmlGetElementCount(node:HXML):int; stdcall;
+ external AppDll name 'xmlGetElementCount';
+function xmlGetElement(node:HXML; n:XML_ELEMENT_POS; var _type:XML_ELEMENT_TYPE;
+ var child:HXML;var value:PWideChar; var name:PWideChar;
+ var openTag:PWideChar; var closeTag:PWideChar):int; stdcall;
+ external AppDll name 'xmlGetElement';
+
+procedure xmlDeleteNodeContent(node:HXML); stdcall; // forces the deletion of the content of this node and the subtree
+ external AppDll name 'xmlDeleteNodeContent';
+procedure xmlDeleteAttrByIndex(node:HXML; i:int); stdcall;
+ external AppDll name 'xmlDeleteAttrByIndex';
+procedure xmlDeleteAttrByName(node:HXML; name:PWideChar); stdcall;
+ external AppDll name 'xmlDeleteAttrByName';
+procedure xmlDeleteText(node:HXML; i:int); stdcall;
+ external AppDll name 'xmlDeleteText';
+procedure xmlDeleteClear(node:HXML; i:int); stdcall;
+ external AppDll name 'xmlDeleteClear';
+
+function xmlPositionOfChildByIndex(node:HXML; i:int):XML_ELEMENT_POS; stdcall;
+ external AppDll name 'xmlPositionOfChildByIndex';
+function xmlPositionOfChildByNode(node:HXML; node1:HXML):XML_ELEMENT_POS; stdcall;
+ external AppDll name 'xmlPositionOfChildByNode';
+function xmlPositionOfChildByName(node:HXML; name:PWideChar; i:int):XML_ELEMENT_POS; stdcall;
+ external AppDll name 'xmlPositionOfChildByName';
+function xmlPositionOfText(node:HXML; i:int):XML_ELEMENT_POS; stdcall;
+ external AppDll name 'xmlPositionOfText';
+function xmlPositionOfClear(node:HXML; i:int):XML_ELEMENT_POS; stdcall;
+ external AppDll name 'xmlPositionOfClear';
+
+function xmlParseFile(filename:PAnsiChar; datalen:pint; tag:PAnsiChar):HXML; stdcall;
+ external AppDll name 'xmlParseFile';
+function xmlToFile(node:HXML; filename:PAnsiChar; withformattiing:int):XMLError; stdcall;
+ external AppDll name 'xmlToFile';
-type
- TXML_API_A = record
- cbSize :size_t;
-
- createNode :function(const name, text:PAnsiChar; IsDeclaration:boolean):HXML;cdecl;
- destroyNode :procedure(node:HXML);cdecl;
-
- parseString :function(const str:PAnsiChar; datalen:pint; const tag:PAnsiChar):HXML;cdecl;
- toString :function(node:HXML;datalen:pint):PAnsiChar;cdecl;
-
- addChild :function(parent:HXML; const name,text:PAnsiChar):HXML;cdecl;
- addChild2 :procedure(child,parent:HXML);cdecl;
- copyNode :function(parent:HXML):HXML;cdecl;
- getChild :function(parent:HXML;number:int):HXML;cdecl;
- getChildCount :function(h:HXML):int;cdecl;
- getChildByAttrValue:function(parent:HXML; const name,attrName,attrValue:PAnsiChar):HXML;cdecl;
- getFirstChild :function(parent:HXML):HXML;cdecl;
- getNthChild :function(parent:HXML; const name:PAnsiChar; i:int):HXML;cdecl;
- getNextChild :function(parent:HXML; const name:PAnsiChar; i:pint):HXML;cdecl;
- getChildByPath :function(parent:HXML; const path:PAnsiChar;createNodeIfMissing:boolean):HXML;cdecl;
- getNextNode :function(node:HXML):HXML;cdecl;
- getName :function(h:HXML):PAnsiChar;cdecl;
- getParent :function(h:HXML):HXML;cdecl;
- getText :function(h:HXML):PAnsiChar;cdecl; // = getTextByIndex(HXML, 0)
- setText :procedure(h:HXML;value:PAnsiChar);cdecl; // = setTextByIndex(HXML, LPCTSTR, 0)
-
- getAttr :function(h:HXML;i:int):PAnsiChar;cdecl;
- getAttrName :function(h:HXML;i:int):PAnsiChar;cdecl;
- getAttrValue :function(h:HXML;const attrName:PAnsiChar):PAnsiChar;cdecl;
- getAttrCount :function(h:HXML):int;cdecl;
- addAttr :procedure(h:HXML;const attrName,attrValue:PAnsiChar);cdecl;
- addAttrInt :procedure(h:HXML; const attrName:PAnsiChar;attrValue:int);cdecl;
-
- freeMem :procedure(arg:pointer);cdecl;
-
- // #if MIRANDA_VER >= 0x0900, methods added in XML API v2
- isDeclaration :function(node:HXML):boolean;cdecl;
- toStringWithFormatting:function(node:HXML; var datalen:int):PAnsiChar;cdecl;
- deepCopy :function(node:HXML):HXML;cdecl;
- setAttrByIndex :procedure(node:HXML; i:int; value:PAnsiChar);cdecl;
- setAttrByName :procedure(node:HXML; name:PAnsiChar; value:PAnsiChar);cdecl;
- addChildEx :function(parent:HXML; name:PAnsiChar; isDeclaration:boolean;
- n:XML_ELEMENT_POS):HXML;cdecl;
- addChildEx2 :procedure(child:HXML; parent:HXML; n:XML_ELEMENT_POS);cdecl;
- getTextCount :function(node:HXML):int;cdecl;
- getTextByIndex :function(node:HXML; i:int):PAnsiChar;cdecl;
- addText :procedure(node:HXML; txt:PAnsiChar; n:XML_ELEMENT_POS);cdecl;
- setTextByIndex :procedure(node:HXML; i:int; txt:PAnsiChar);cdecl;
- getClearCount :function(node:HXML):int;cdecl;
- getClear :function(node:HXML; i:int; var openTag:PAnsiChar;
- var closeTag:PAnsiChar):PAnsiChar;cdecl;
- addClear :procedure(node:HXML; lpszValue:PAnsiChar; openTag:PAnsiChar;
- closeTag:PAnsiChar; n:XML_ELEMENT_POS);cdecl;
- setClear :procedure(node:HXML; i:int; lpszValue:PAnsiChar);cdecl;
- getElementCount :function(node:HXML):int;cdecl;
- getElement :function(node:HXML; n:XML_ELEMENT_POS; var _type:XML_ELEMENT_TYPE;
- var child:HXML;var value:PAnsiChar; var name:PAnsiChar;
- var openTag:PAnsiChar; var closeTag:PAnsiChar):int;cdecl;
- // With getElement() it's possible to enumerate all the different contents
- // (attribute,child,text, clear) of the current node. The order is reflecting the order
- // of the original file/string. NOTE: 0 <= i < getElementCount().
- // type, child, value, name, openTag, closeTag will be filled on return, depending on type:
- // for XML_ELEM_TYPE_CHILD , child is valid;
- // for XML_ELEM_TYPE_ATTRIBUTE, name and value are valid;
- // for XML_ELEM_TYPE_TEXT , value is valid;
- // for XML_ELEM_TYPE_CLEAR , value, openTag and closeTag are valid.
-
- deleteNodeContent:procedure(node:HXML);cdecl; // forces the deletion of the content of this node and the subtree
- deleteAttrByIndex:procedure(node:HXML; i:int);cdecl;
- deleteAttrByName :procedure(node:HXML; name:PAnsiChar);cdecl;
- deleteText :procedure(node:HXML; i:int);cdecl;
- deleteClear :procedure(node:HXML; i:int);cdecl;
-
- positionOfChildByIndex:function(node:HXML; i:int):XML_ELEMENT_POS;cdecl;
- positionOfChildByNode :function(node:HXML; node1:HXML):XML_ELEMENT_POS;cdecl;
- positionOfChildByName :function(node:HXML; name:PAnsiChar; i:int):XML_ELEMENT_POS;cdecl;
- positionOfText :function(node:HXML; i:int):XML_ELEMENT_POS;cdecl;
- positionOfClear :function(node:HXML; i:int):XML_ELEMENT_POS;cdecl;
-
- parseFile:function(filename:PAnsiChar; datalen:pint; tag:PAnsiChar):HXML;
- toFile :function(node:HXML; filename:PAnsiChar; withformattiing:int):XMLError;
- end;
-
- TXML_API_W = record
- cbSize :size_t;
-
- createNode :function(const name, text:PWideChar; IsDeclaration:boolean):HXML;cdecl;
- destroyNode :procedure(node:HXML);cdecl;
-
- parseString :function(const str:PWideChar; datalen:pint; const tag:PWideChar):HXML;cdecl;
- toString :function(node:HXML;datalen:pint):PWideChar;cdecl;
-
- addChild :function(parent:HXML; const name,text:PWideChar):HXML;cdecl;
- addChild2 :procedure(child,parent:HXML);cdecl;
- copyNode :function(parent:HXML):HXML;cdecl;
- getChild :function(parent:HXML;number:int):HXML;cdecl;
- getChildCount :function(h:HXML):int;cdecl;
- getChildByAttrValue:function(parent:HXML; const name,attrName,attrValue:PWideChar):HXML;cdecl;
- getFirstChild :function(parent:HXML):HXML;cdecl;
- getNthChild :function(parent:HXML; const name:PWideChar; i:int):HXML;cdecl;
- getNextChild :function(parent:HXML; const name:PWideChar; i:pint):HXML;cdecl;
- getChildByPath :function(parent:HXML; const path:PWideChar;createNodeIfMissing:boolean):HXML;cdecl;
- getNextNode :function(node:HXML):HXML;cdecl;
- getName :function(h:HXML):PWideChar;cdecl;
- getParent :function(h:HXML):HXML;cdecl;
- getText :function(h:HXML):PWideChar;cdecl; // = getTextByIndex(HXML, 0)
- setText :procedure(h:HXML;value:PWideChar);cdecl; // = setTextByIndex(HXML, LPCTSTR, 0)
-
- getAttr :function(h:HXML;i:int):PWideChar;cdecl;
- getAttrName :function(h:HXML;i:int):PWideChar;cdecl;
- getAttrValue :function(h:HXML;const attrName:PWideChar):PWideChar;cdecl;
- getAttrCount :function(h:HXML):int;cdecl;
- addAttr :procedure(h:HXML;const attrName,attrValue:PWideChar);cdecl;
- addAttrInt :procedure(h:HXML; const attrName:PWideChar;attrValue:int);cdecl;
-
- freeMem :procedure(arg:pointer);cdecl;
-
- // #if MIRANDA_VER >= 0x0900, methods added in XML API v2
- isDeclaration :function(node:HXML):boolean;cdecl;
- toStringWithFormatting:function(node:HXML; var datalen:int):PWideChar;cdecl;
- deepCopy :function(node:HXML):HXML;cdecl;
- setAttrByIndex :procedure(node:HXML; i:int; value:PWideChar);cdecl;
- setAttrByName :procedure(node:HXML; name:PWideChar; value:PWideChar);cdecl;
- addChildEx :function(parent:HXML; name:PWideChar; isDeclaration:boolean;
- n:XML_ELEMENT_POS):HXML;cdecl;
- addChildEx2 :procedure(child:HXML; parent:HXML; n:XML_ELEMENT_POS);cdecl;
- getTextCount :function(node:HXML):int;cdecl;
- getTextByIndex :function(node:HXML; i:int):PWideChar;cdecl;
- addText :procedure(node:HXML; txt:PWideChar; n:XML_ELEMENT_POS);cdecl;
- setTextByIndex :procedure(node:HXML; i:int; txt:PWideChar);cdecl;
- getClearCount :function(node:HXML):int;cdecl;
- getClear :function(node:HXML; i:int; var openTag:PWideChar;
- var closeTag:PWideChar):PWideChar;cdecl;
- addClear :procedure(node:HXML; lpszValue:PWideChar; openTag:PWideChar;
- closeTag:PWideChar; n:XML_ELEMENT_POS);cdecl;
- setClear :procedure(node:HXML; i:int; lpszValue:PWideChar);cdecl;
- getElementCount :function(node:HXML):int;cdecl;
- getElement :function(node:HXML; n:XML_ELEMENT_POS; var _type:XML_ELEMENT_TYPE;
- var child:HXML;var value:PWideChar; var name:PWideChar;
- var openTag:PWideChar; var closeTag:PWideChar):int;cdecl;
- // With getElement() it's possible to enumerate all the different contents
- // (attribute,child,text, clear) of the current node. The order is reflecting the order
- // of the original file/string. NOTE: 0 <= i < getElementCount().
- // type, child, value, name, openTag, closeTag will be filled on return, depending on type:
- // for XML_ELEM_TYPE_CHILD , child is valid;
- // for XML_ELEM_TYPE_ATTRIBUTE, name and value are valid;
- // for XML_ELEM_TYPE_TEXT , value is valid;
- // for XML_ELEM_TYPE_CLEAR , value, openTag and closeTag are valid.
-
- deleteNodeContent:procedure(node:HXML);cdecl; // forces the deletion of the content of this node and the subtree
- deleteAttrByIndex:procedure(node:HXML; i:int);cdecl;
- deleteAttrByName :procedure(node:HXML; name:PWideChar);cdecl;
- deleteText :procedure(node:HXML; i:int);cdecl;
- deleteClear :procedure(node:HXML; i:int);cdecl;
-
- positionOfChildByIndex:function(node:HXML; i:int):XML_ELEMENT_POS;cdecl;
- positionOfChildByNode :function(node:HXML; node1:HXML):XML_ELEMENT_POS;cdecl;
- positionOfChildByName :function(node:HXML; name:PWideChar; i:int):XML_ELEMENT_POS;cdecl;
- positionOfText :function(node:HXML; i:int):XML_ELEMENT_POS;cdecl;
- positionOfClear :function(node:HXML; i:int):XML_ELEMENT_POS;cdecl;
-
- parseFile:function(filename:PAnsiChar; datalen:pint; tag:PAnsiChar):HXML;
- toFile :function(node:HXML; filename:PAnsiChar; withformattiing:int):XMLError;
- end;
-
-// every protocol should declare this variable to use the XML API
-//const
-// extern XML_API xi;
-
-const
-{
-a service to obtain the XML API
-
-wParam = 0;
-lParam = (LPARAM)(XML_API*).
-
-returns TRUE if all is Ok, and FALSE otherwise
-}
- MS_SYSTEM_GET_XI:PAnsiChar = 'Miranda/System/GetXmlApi';
-(*
-__forceinline int mir_getXI( XML_API* dest )
-{
- dest->cbSize = sizeof(*dest);
- return CallService( MS_SYSTEM_GET_XI, 0, (LPARAM)dest );
-}
-*)
{$ENDIF}
diff --git a/include/m_xml.h b/include/m_xml.h
index 7591dab73b..f8277aef15 100644
--- a/include/m_xml.h
+++ b/include/m_xml.h
@@ -26,22 +26,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define M_XML_H__
#include <tchar.h>
-#include <newpluginapi.h>
+#include <m_core.h>
DECLARE_HANDLE(HXML);
typedef int XML_ELEMENT_POS; // XML_ELEMENT_POS is not interchangeable with simple indexes
-typedef enum
+enum XML_ELEMENT_TYPE
{
XML_ELEM_TYPE_CHILD = 0,
XML_ELEM_TYPE_ATTRIBUTE = 1,
XML_ELEM_TYPE_TEXT = 2,
XML_ELEM_TYPE_CLEAR = 3,
-}
- XML_ELEMENT_TYPE;
+};
/// Enumeration for XML parse errors.
-typedef enum XMLError
+enum XMLError
{
eXMLErrorNone = 0,
eXMLErrorMissingEndTag,
@@ -65,105 +64,71 @@ typedef enum XMLError
eXMLErrorBase64DecodeIllegalCharacter,
eXMLErrorBase64DecodeTruncatedData,
eXMLErrorBase64DecodeBufferTooSmall
-} XMLError;
-
-typedef struct
-{
- size_t cbSize;
-
- HXML (*createNode)(LPCTSTR name, LPCTSTR text, char isDeclaration);
- void (*destroyNode)(HXML node);
-
- HXML (*parseString)(LPCTSTR string, int* datalen, LPCTSTR tag);
- LPTSTR (*toString)(HXML node, int* datalen);
-
- HXML (*addChild)(HXML parent, LPCTSTR name, LPCTSTR text);
- void (*addChild2)(HXML child, HXML parent);
- HXML (*copyNode)(HXML parent);
- HXML (*getChild)(HXML parent, int number);
- int (*getChildCount)(HXML);
- HXML (*getChildByAttrValue)(HXML parent, LPCTSTR name, LPCTSTR attrName, LPCTSTR attrValue);
- HXML (*getFirstChild)(HXML parent);
- HXML (*getNthChild)(HXML parent, LPCTSTR name, int i);
- HXML (*getNextChild)(HXML parent, LPCTSTR name, int *i);
- HXML (*getChildByPath)(HXML parent, LPCTSTR path, char createNodeIfMissing);
- HXML (*getNextNode)(HXML node);
- LPCTSTR (*getName)(HXML);
- HXML (*getParent)(HXML);
- LPCTSTR (*getText)(HXML); //=getTextByIndex(HXML, 0)
- void (*setText)(HXML, LPCTSTR); //=setTextByIndex(HXML, LPCTSTR, 0)
-
- LPCTSTR (*getAttr)(HXML, int i);
- LPCTSTR (*getAttrName)(HXML, int i);
- LPCTSTR (*getAttrValue)(HXML, LPCTSTR attrName);
- int (*getAttrCount)(HXML);
- void (*addAttr)(HXML, LPCTSTR attrName, LPCTSTR attrValue);
- void (*addAttrInt)(HXML, LPCTSTR attrName, int attrValue);
-
- void (*freeMem)(void*);
-
- // methods added in XML API v2
- char (*isDeclaration)(HXML);
- LPTSTR (*toStringWithFormatting)(HXML node, int* datalen);
- HXML (*deepCopy)(HXML);
- void (*setAttrByIndex)(HXML, int i, LPCTSTR value);
- void (*setAttrByName)(HXML, LPCTSTR name, LPCTSTR value);
- HXML (*addChildEx)(HXML parent, LPCTSTR name, char isDeclaration, XML_ELEMENT_POS n);
- void (*addChildEx2)(HXML child, HXML parent, XML_ELEMENT_POS n);
- int (*getTextCount)(HXML);
- LPCTSTR (*getTextByIndex)(HXML, int i);
- void (*addText)(HXML, LPCTSTR, XML_ELEMENT_POS n);
- void (*setTextByIndex)(HXML, int i, LPCTSTR);
- int (*getClearCount)(HXML);
- LPCTSTR (*getClear)(HXML, int i, LPCTSTR *openTag, LPCTSTR *closeTag);
- void (*addClear)(HXML, LPCTSTR lpszValue, LPCTSTR openTag, LPCTSTR closeTag, XML_ELEMENT_POS n);
- void (*setClear)(HXML, int i, LPCTSTR lpszValue);
- int (*getElementCount)(HXML);
- int (*getElement)(HXML, XML_ELEMENT_POS n, XML_ELEMENT_TYPE *type, HXML *child, LPCTSTR *value, LPCTSTR *name, LPCTSTR *openTag, LPCTSTR *closeTag);
- // With getElement() it's possible to enumerate all the different contents (attribute, child, text, clear) of the current node. The order is reflecting the order of the original file/string. NOTE: 0 <= i < getElementCount().
- // type, child, value, name, openTag, closeTag will be filled on return, depending on type:
- // for XML_ELEM_TYPE_CHILD, child is valid;
- // for XML_ELEM_TYPE_ATTRIBUTE, name and value are valid;
- // for XML_ELEM_TYPE_TEXT, value is valid;
- // for XML_ELEM_TYPE_CLEAR, value, openTag and closeTag are valid.
-
- void (*deleteNodeContent)(HXML); // forces the deletion of the content of this node and the subtree
- void (*deleteAttrByIndex)(HXML, int i);
- void (*deleteAttrByName)(HXML, LPCTSTR name);
- void (*deleteText)(HXML, int i);
- void (*deleteClear)(HXML, int i);
-
- XML_ELEMENT_POS (*positionOfChildByIndex)(HXML, int i);
- XML_ELEMENT_POS (*positionOfChildByNode)(HXML, HXML);
- XML_ELEMENT_POS (*positionOfChildByName)(HXML, LPCTSTR name, int i);
- XML_ELEMENT_POS (*positionOfText)(HXML, int i);
- XML_ELEMENT_POS (*positionOfClear)(HXML, int i);
-
- HXML (*parseFile)(LPCTSTR filename, int* datalen, LPCTSTR tag);
- XMLError (*toFile)(HXML node, LPCTSTR filename, int withformattiing);
-}
- XML_API;
-
-#define XML_API_SIZEOF_V1 (sizeof(size_t)+26*sizeof(void*))
-
-/* every protocol should declare this variable to use the XML API */
-extern XML_API xi;
-
-/*
-a service to obtain the XML API
-
-wParam = 0;
-lParam = (LPARAM)(XML_API*).
-
-returns TRUE if all is Ok, and FALSE otherwise
-*/
-
-#define MS_SYSTEM_GET_XI "Miranda/System/GetXmlApi"
-
-__forceinline int mir_getXI(XML_API* dest)
-{
- dest->cbSize = sizeof(*dest);
- return CallService(MS_SYSTEM_GET_XI, 0, (LPARAM)dest);
-}
+};
+
+EXTERN_C MIR_APP_DLL(HXML) xmlCreateNode(LPCTSTR name, LPCTSTR text, char isDeclaration);
+EXTERN_C MIR_APP_DLL(void) xmlDestroyNode(HXML node);
+
+EXTERN_C MIR_APP_DLL(HXML) xmlParseString(LPCTSTR string, int *datalen, LPCTSTR tag);
+EXTERN_C MIR_APP_DLL(LPTSTR) xmlToString(HXML node, int *datalen);
+
+EXTERN_C MIR_APP_DLL(HXML) xmlAddChild(HXML parent, LPCTSTR name, LPCTSTR text);
+EXTERN_C MIR_APP_DLL(void) xmlAddChild2(HXML child, HXML parent);
+EXTERN_C MIR_APP_DLL(HXML) xmlCopyNode(HXML parent);
+EXTERN_C MIR_APP_DLL(HXML) xmlGetChild(HXML parent, int number);
+EXTERN_C MIR_APP_DLL(int) xmlGetChildCount(HXML);
+EXTERN_C MIR_APP_DLL(HXML) xmlGetChildByAttrValue(HXML parent, LPCTSTR name, LPCTSTR attrName, LPCTSTR attrValue);
+EXTERN_C MIR_APP_DLL(HXML) xmlGetFirstChild(HXML parent);
+EXTERN_C MIR_APP_DLL(HXML) xmlGetNthChild(HXML parent, LPCTSTR name, int i);
+EXTERN_C MIR_APP_DLL(HXML) xmlGetNextChild(HXML parent, LPCTSTR name, int *i);
+EXTERN_C MIR_APP_DLL(HXML) xmlGetChildByPath(HXML parent, LPCTSTR path, char createNodeIfMissing);
+EXTERN_C MIR_APP_DLL(HXML) xmlGetNextNode(HXML node);
+EXTERN_C MIR_APP_DLL(LPCTSTR) xmlGetName(HXML);
+EXTERN_C MIR_APP_DLL(HXML) xmlGetParent(HXML);
+EXTERN_C MIR_APP_DLL(LPCTSTR) xmlGetText(HXML);
+EXTERN_C MIR_APP_DLL(void) xmlSetText(HXML, LPCTSTR);
+
+EXTERN_C MIR_APP_DLL(LPCTSTR) xmlGetAttr(HXML, int i);
+EXTERN_C MIR_APP_DLL(LPCTSTR) xmlGetAttrName(HXML, int i);
+EXTERN_C MIR_APP_DLL(LPCTSTR) xmlGetAttrValue(HXML, LPCTSTR attrName);
+EXTERN_C MIR_APP_DLL(int) xmlGetAttrCount(HXML);
+EXTERN_C MIR_APP_DLL(void) xmlAddAttr(HXML, LPCTSTR attrName, LPCTSTR attrValue);
+EXTERN_C MIR_APP_DLL(void) xmlAddAttrInt(HXML, LPCTSTR attrName, int attrValue);
+
+EXTERN_C MIR_APP_DLL(void) xmlFree(void*);
+
+// methods added in xml API v2
+EXTERN_C MIR_APP_DLL(char) xmlIsDeclaration(HXML);
+EXTERN_C MIR_APP_DLL(LPTSTR) xmlToStringWithFormatting(HXML node, int* datalen);
+EXTERN_C MIR_APP_DLL(HXML) xmlDeepCopy(HXML);
+EXTERN_C MIR_APP_DLL(void) xmlSetAttrByIndex(HXML, int i, LPCTSTR value);
+EXTERN_C MIR_APP_DLL(void) xmlSetAttrByName(HXML, LPCTSTR name, LPCTSTR value);
+EXTERN_C MIR_APP_DLL(HXML) xmlAddChildEx(HXML parent, LPCTSTR name, char isDeclaration, XML_ELEMENT_POS n);
+EXTERN_C MIR_APP_DLL(void) xmlAddChildEx2(HXML child, HXML parent, XML_ELEMENT_POS n);
+EXTERN_C MIR_APP_DLL(int) xmlGetTextCount(HXML);
+EXTERN_C MIR_APP_DLL(LPCTSTR) xmlGetTextByIndex(HXML, int i);
+EXTERN_C MIR_APP_DLL(void) xmlAddText(HXML, LPCTSTR, XML_ELEMENT_POS n);
+EXTERN_C MIR_APP_DLL(void) xmlSetTextByIndex(HXML, int i, LPCTSTR);
+EXTERN_C MIR_APP_DLL(int) xmlGetClearCount(HXML);
+EXTERN_C MIR_APP_DLL(LPCTSTR) xmlGetClear(HXML, int i, LPCTSTR *openTag, LPCTSTR *closeTag);
+EXTERN_C MIR_APP_DLL(void) xmlAddClear(HXML, LPCTSTR lpszValue, LPCTSTR openTag, LPCTSTR closeTag, XML_ELEMENT_POS n);
+EXTERN_C MIR_APP_DLL(void) xmlSetClear(HXML, int i, LPCTSTR lpszValue);
+EXTERN_C MIR_APP_DLL(int) xmlGetElementCount(HXML);
+EXTERN_C MIR_APP_DLL(int) xmlGetElement(HXML, XML_ELEMENT_POS n, XML_ELEMENT_TYPE *type, HXML *child, LPCTSTR *value, LPCTSTR *name, LPCTSTR *openTag, LPCTSTR *closeTag);
+
+EXTERN_C MIR_APP_DLL(void) xmlDeleteNodeContent(HXML); // forces the deletion of the content of this node and the subtree
+EXTERN_C MIR_APP_DLL(void) xmlDeleteAttrByIndex(HXML, int i);
+EXTERN_C MIR_APP_DLL(void) xmlDeleteAttrByName(HXML, LPCTSTR name);
+EXTERN_C MIR_APP_DLL(void) xmlDeleteText(HXML, int i);
+EXTERN_C MIR_APP_DLL(void) xmlDeleteClear(HXML, int i);
+
+EXTERN_C MIR_APP_DLL(HXML) xmlParseFile(LPCTSTR filename, int *datalen, LPCTSTR tag);
+EXTERN_C MIR_APP_DLL(XMLError) xmlToFile(HXML node, LPCTSTR filename, int withformattiing);
+
+EXTERN_C MIR_APP_DLL(XML_ELEMENT_POS) xmlPositionOfChildByIndex(HXML, int i);
+EXTERN_C MIR_APP_DLL(XML_ELEMENT_POS) xmlPositionOfChildByNode(HXML, HXML);
+EXTERN_C MIR_APP_DLL(XML_ELEMENT_POS) xmlPositionOfChildByName(HXML, LPCTSTR name, int i);
+EXTERN_C MIR_APP_DLL(XML_ELEMENT_POS) xmlPositionOfText(HXML, int i);
+EXTERN_C MIR_APP_DLL(XML_ELEMENT_POS) xmlPositionOfClear(HXML, int i);
#endif // M_XML_H__
diff --git a/make_core_def.cmd b/make_core_def.cmd
index d76a4090ed..e8d7dd9116 100644
--- a/make_core_def.cmd
+++ b/make_core_def.cmd
@@ -1,13 +1,13 @@
@echo off
echo.
-.\tools\makedef\makedef.exe /IMAGE:bin12\debug\libs\mir_core.dll /DEF:src\mir_core\src\mir_core.def
+.\tools\makedef\makedef.exe /IMAGE:bin12\debug\libs\mir_core.mir /DEF:src\mir_core\src\mir_core.def
echo.
-.\tools\makedef\makedef64.exe /IMAGE:bin12\debug64\libs\mir_core.dll /DEF:src\mir_core\src\mir_core64.def
+.\tools\makedef\makedef.exe /IMAGE:bin12\debug64\libs\mir_core.mir /DEF:src\mir_core\src\mir_core64.def
echo.
-.\tools\makedef\makedef.exe /IMAGE:bin12\debug\libs\mir_app.dll /DEF:src\mir_app\src\mir_app.def
+.\tools\makedef\makedef.exe /IMAGE:bin12\debug\libs\mir_app.mir /DEF:src\mir_app\src\mir_app.def
echo.
-.\tools\makedef\makedef.exe /IMAGE:bin12\debug64\libs\mir_app.dll /DEF:src\mir_app\src\mir_app64.def
+.\tools\makedef\makedef.exe /IMAGE:bin12\debug64\libs\mir_app.mir /DEF:src\mir_app\src\mir_app64.def
echo.
-.\tools\makedef\makedef.exe /IMAGE:bin12\debug\libs\libjson.dll /DEF:libs\libjson\src\libjson.def
+.\tools\makedef\makedef.exe /IMAGE:bin12\debug\libs\libjson.mir /DEF:libs\libjson\src\libjson.def
echo.
-.\tools\makedef\makedef.exe /IMAGE:bin12\debug64\libs\libjson.dll /DEF:libs\libjson\src\libjson64.def
+.\tools\makedef\makedef.exe /IMAGE:bin12\debug64\libs\libjson.mir /DEF:libs\libjson\src\libjson64.def
diff --git a/plugins/Actman/iac_chain.pas b/plugins/Actman/iac_chain.pas
index 48b187259f..5be20d6d8c 100644
--- a/plugins/Actman/iac_chain.pas
+++ b/plugins/Actman/iac_chain.pas
@@ -141,37 +141,18 @@ begin
end;
1: begin
- with xmlparser do
- begin
- StrDupW(actname,getText(HXML(node)));
- flags:=flags or ACF_BYNAME;
-
- if StrToInt(getAttrValue(HXML(node),ioNoWait))=1 then
- flags:=flags or ACF_NOWAIT;
-
- if StrToInt(getAttrValue(HXML(node),ioKeepOld))=1 then
- flags:=flags or ACF_KEEPOLD;
-
- if StrToInt(getAttrValue(HXML(node),ioSameThread))=1 then
- flags:=flags or ACF_SAMETHREAD;
- end;
- end;
-{
- 2: begin
-
- UF8ToWide(GetParamSectionStr(node,'name',nil),actname);
+ StrDupW(actname,xmlGetText(HXML(node)));
flags:=flags or ACF_BYNAME;
- if GetParamSectionInt(node,ioNoWait)=1 then
+ if StrToInt(xmlGetAttrValue(HXML(node),ioNoWait))=1 then
flags:=flags or ACF_NOWAIT;
- if GetParamSectionInt(node,ioKeepOld)=1 then
+ if StrToInt(xmlGetAttrValue(HXML(node),ioKeepOld))=1 then
flags:=flags or ACF_KEEPOLD;
- if GetParamSectionInt(node,ioSameThread)=1 then
+ if StrToInt(xmlGetAttrValue(HXML(node),ioSameThread))=1 then
flags:=flags or ACF_SAMETHREAD;
end;
-}
end;
end;
diff --git a/plugins/Actman/iac_contact.pas b/plugins/Actman/iac_contact.pas
index 7c17334f15..561c8840fa 100644
--- a/plugins/Actman/iac_contact.pas
+++ b/plugins/Actman/iac_contact.pas
@@ -84,25 +84,12 @@ begin
contact:=LoadContact(DBBranch,node);
1: begin
- with xmlparser do
- begin
- contact:=ImportContact(HXML(node));
- if StrToInt(getAttrValue(HXML(node),ioKeepOnly))=1 then
- flags:=flags or ACF_KEEPONLY;
- if StrToInt(getAttrValue(HXML(node),ioWindow))=1 then
- flags:=flags or ACF_GETACTIVE;
- end;
- end;
-{
- 2: begin
- contact:=ImportContactINI(node);
-
- if GetParamSectionInt(node,ioKeepOnly)=1 then
+ contact:=ImportContact(HXML(node));
+ if StrToInt(xmlGetAttrValue(HXML(node),ioKeepOnly))=1 then
flags:=flags or ACF_KEEPONLY;
- if GetParamSectionInt(node,ioWindow)=1 then
+ if StrToInt(xmlGetAttrValue(HXML(node),ioWindow))=1 then
flags:=flags or ACF_GETACTIVE;
end;
-}
end;
end;
@@ -112,7 +99,6 @@ var
cws:TDBVARIANT;
p1:pAnsiChar;
p:pWideChar;
-// tmpbuf:array [0..63] of WideChar;
is_chat:boolean;
begin
result:=0;
@@ -168,14 +154,7 @@ begin
case fmt of
0: if (flags and ACF_GETACTIVE)=0 then
SaveContact(contact,DBBranch,node);
-{
- 1: begin
- sub:=AddChild(actnode,ioContactWindow,nil);
- ExportContact(sub,contact);
-// AddAttrInt(sub,ioNumber,0); // contact
- if (flags and ACF_KEEPONLY)<>0 then AddAttrInt(sub,ioKeepOnly,1);
- end;
-}
+
13: begin
tTextExport(node).AddFlag('keeponly' ,(flags or ACF_KEEPONLY )<>0);
tTextExport(node).AddFlag('getactive',(flags or ACF_GETACTIVE)<>0);
diff --git a/plugins/Actman/iac_dbrw.pas b/plugins/Actman/iac_dbrw.pas
index f9faa18293..dffd5ca233 100644
--- a/plugins/Actman/iac_dbrw.pas
+++ b/plugins/Actman/iac_dbrw.pas
@@ -389,79 +389,40 @@ begin
end;
1: begin
- with xmlparser do
+ tmp:=xmlGetAttrValue(HXML(node),ioOper);
+ if lstrcmpiw(tmp,ioDelete)=0 then flags:=flags or ACF_DBDELETE
+ else if lstrcmpiw(tmp,ioWrite )=0 then flags:=flags or ACF_DBWRITE;
+ tmp:=xmlGetAttrValue(HXML(node),ioContact);
+ if lstrcmpiw(tmp,ioCurrent)=0 then flags:=flags or ACF_CURRENT
+ else if lstrcmpiw(tmp,ioResult )=0 then flags:=flags or ACF_RESULT
+ else if lstrcmpiw(tmp,ioParam )=0 then flags:=flags or ACF_PARAM
+ else if lstrcmpiw(tmp,ioContact)=0 then
begin
- tmp:=getAttrValue(HXML(node),ioOper);
- if lstrcmpiw(tmp,ioDelete)=0 then flags:=flags or ACF_DBDELETE
- else if lstrcmpiw(tmp,ioWrite )=0 then flags:=flags or ACF_DBWRITE;
- // else if lstrcmpiw(tmp,ioRead)=0 then ;
- tmp:=getAttrValue(HXML(node),ioContact);
- if lstrcmpiw(tmp,ioCurrent)=0 then flags:=flags or ACF_CURRENT
- else if lstrcmpiw(tmp,ioResult )=0 then flags:=flags or ACF_RESULT
- else if lstrcmpiw(tmp,ioParam )=0 then flags:=flags or ACF_PARAM
- else if lstrcmpiw(tmp,ioContact)=0 then
- begin
- dbcontact:=ImportContact(HXML(node));
- end;
-
- StrDupW(dbmodule ,getAttrValue(HXML(node),ioModule));
- StrDupW(dbsetting,getAttrValue(HXML(node),ioSetting));
-
- if StrToInt(getAttrValue(HXML(node),ioFileVariable))=1 then flags:=flags or ACF_RW_MODULE;
- if StrToInt(getAttrValue(HXML(node),ioArgVariable ))=1 then flags:=flags or ACF_RW_SETTING;
- if StrToInt(getAttrValue(HXML(node),ioVariables ))=1 then flags:=flags or ACF_RW_VALUE;
-
- tmp:=getAttrValue(HXML(node),ioType);
- if lstrcmpiw(tmp,ioByte )=0 then flags:=flags or ACF_DBBYTE
- else if lstrcmpiw(tmp,ioWord )=0 then flags:=flags or ACF_DBWORD
- else if lstrcmpiw(tmp,ioDword)=0 then
- else if lstrcmpiw(tmp,ioAnsi )=0 then flags:=flags or ACF_DBANSI
- else flags:=flags or ACF_DBUTEXT;
-
- if StrToInt(getAttrValue(HXML(node),ioSaveValue))=1 then
- flags:=flags or ACF_SAVE;
-
- if StrToInt(getAttrValue(HXML(node),ioLast))=1 then
- flags:=flags or ACF_LAST
- else
- StrDupW(dbvalue,getText(HXML(node)));
- end;
- end;
-{
- 2: begin
- pc:=GetParamSectionStr(node,ioOper);
- if lstrcmpi(pc,ioDelete)=0 then flags:=flags or ACF_DBDELETE
- else if lstrcmpi(pc,ioWrite )=0 then flags:=flags or ACF_DBWRITE;
-// else if lstrcmpiw(tmp,ioRead)=0 then ;
- pc:=GetParamSectionStr(node,ioContact);
- if lstrcmpi(pc,ioCurrent)=0 then flags:=flags or ACF_CURRENT
- else if lstrcmpi(pc,ioResult )=0 then flags:=flags or ACF_RESULT
- else if lstrcmpi(pc,ioParam )=0 then flags:=flags or ACF_PARAM
- else if lstrcmpi(pc,ioContact)=0 then
- begin
- dbcontact:=ImportContactINI(node);
+ dbcontact:=ImportContact(HXML(node));
end;
- UF8ToWide(GetParamSectionStr(node,ioModule ),dbmodule);
- UF8ToWide(GetParamSectionStr(node,ioSetting),dbsetting);
+ StrDupW(dbmodule ,xmlGetAttrValue(HXML(node),ioModule));
+ StrDupW(dbsetting,xmlGetAttrValue(HXML(node),ioSetting));
- if GetParamSectionInt(node,ioFileVariable)=1 then flags:=flags or ACF_RW_MODULE;
- if GetParamSectionInt(node,ioArgVariable )=1 then flags:=flags or ACF_RW_SETTING;
- if GetParamSectionInt(node,ioVariables )=1 then flags:=flags or ACF_RW_VALUE;
+ if StrToInt(xmlGetAttrValue(HXML(node),ioFileVariable))=1 then flags:=flags or ACF_RW_MODULE;
+ if StrToInt(xmlGetAttrValue(HXML(node),ioArgVariable ))=1 then flags:=flags or ACF_RW_SETTING;
+ if StrToInt(xmlGetAttrValue(HXML(node),ioVariables ))=1 then flags:=flags or ACF_RW_VALUE;
+
+ tmp:=xmlGetAttrValue(HXML(node),ioType);
+ if lstrcmpiw(tmp,ioByte )=0 then flags:=flags or ACF_DBBYTE
+ else if lstrcmpiw(tmp,ioWord )=0 then flags:=flags or ACF_DBWORD
+ else if lstrcmpiw(tmp,ioDword)=0 then
+ else if lstrcmpiw(tmp,ioAnsi )=0 then flags:=flags or ACF_DBANSI
+ else flags:=flags or ACF_DBUTEXT;
- pc:=GetParamSectionStr(node,ioType);
- if lstrcmpi(pc,ioByte )=0 then flags:=flags or ACF_DBBYTE
- else if lstrcmpi(pc,ioWord )=0 then flags:=flags or ACF_DBWORD
- else if lstrcmpi(pc,ioDword)=0 then
- else if lstrcmpi(pc,ioAnsi )=0 then flags:=flags or ACF_DBANSI
- else flags:=flags or ACF_DBUTEXT;
+ if StrToInt(xmlGetAttrValue(HXML(node),ioSaveValue))=1 then
+ flags:=flags or ACF_SAVE;
- if GetParamSectionInt(node,ioLast))=1 then
+ if StrToInt(xmlGetAttrValue(HXML(node),ioLast))=1 then
flags:=flags or ACF_LAST
else
- UF8ToWide(GetParamSectionStr(node,'value'),dbvalue); //!!
+ StrDupW(dbvalue,xmlGetText(HXML(node)));
end;
-}
end;
end;
diff --git a/plugins/Actman/iac_global.pas b/plugins/Actman/iac_global.pas
index aee55d1bfb..aa5b9bb87c 100644
--- a/plugins/Actman/iac_global.pas
+++ b/plugins/Actman/iac_global.pas
@@ -14,9 +14,6 @@ const
rtAnsi = 3;
rtUTF8 = 4;
-var
- xmlparser:TXML_API_W;
-
const
IcoLibPrefix = 'action_type_';
const
@@ -175,22 +172,11 @@ begin
end;
1: begin
- with xmlparser do
- begin
- if StrToInt(getAttrValue(HXML(node),ioDisabled))=1 then
- flags:=flags or ACF_DISABLED;
-
- StrDupW(ActionDescr,getAttrValue(HXML(node),ioName));
- end;
- end;
-{
- 2: begin
- if GetParamSectionInt(node,ioDisabled))=1 then
+ if StrToInt(xmlGetAttrValue(HXML(node),ioDisabled))=1 then
flags:=flags or ACF_DISABLED;
- UF8ToWide(GetParamSectionStr(node,ioName),ActionDescr);
+ StrDupW(ActionDescr,xmlGetAttrValue(HXML(node),ioName));
end;
-}
end;
end;
@@ -335,36 +321,33 @@ var
is_chat:boolean;
bufLen:int;
begin
- with xmlparser do
+ proto:=FastWideToAnsiBuf(xmlGetAttrValue(node,ioCProto),tmpbuf);
+ if (proto=nil) or (proto^=#0) then
begin
- proto:=FastWideToAnsiBuf(getAttrValue(node,ioCProto),tmpbuf);
- if (proto=nil) or (proto^=#0) then
- begin
- result:=0;
- exit;
- end;
- is_chat:=StrToInt(getAttrValue(node,ioIsChat))<>0;
+ result:=0;
+ exit;
+ end;
+ is_chat:=StrToInt(xmlGetAttrValue(node,ioIsChat))<>0;
- tmp:=getAttrValue(node,ioCUID);
- if is_chat then
- begin
- dbv.szVal.W:=tmp;
- end
- else
- begin
- FillChar(dbv,SizeOf(TDBVARIANT),0);
- dbv._type:=StrToInt(getAttrValue(node,ioCUIDType));
- case dbv._type of
- DBVT_BYTE : dbv.bVal:=StrToInt(tmp);
- DBVT_WORD : dbv.wVal:=StrToInt(tmp);
- DBVT_DWORD : dbv.dVal:=StrToInt(tmp);
- DBVT_ASCIIZ: FastWideToAnsi(tmp,dbv.szVal.A);
- DBVT_UTF8 : WideToUTF8(tmp,dbv.szVal.A);
- DBVT_WCHAR : dbv.szVal.W:=tmp;
- DBVT_BLOB : begin
- dbv.pbVal := mir_base64_decode(FastWideToAnsi(tmp,pAnsiChar(dbv.pbVal)),bufLen);
- dbv.cpbVal := bufLen;
- end;
+ tmp:=xmlGetAttrValue(node,ioCUID);
+ if is_chat then
+ begin
+ dbv.szVal.W:=tmp;
+ end
+ else
+ begin
+ FillChar(dbv,SizeOf(TDBVARIANT),0);
+ dbv._type:=StrToInt(xmlGetAttrValue(node,ioCUIDType));
+ case dbv._type of
+ DBVT_BYTE : dbv.bVal:=StrToInt(tmp);
+ DBVT_WORD : dbv.wVal:=StrToInt(tmp);
+ DBVT_DWORD : dbv.dVal:=StrToInt(tmp);
+ DBVT_ASCIIZ: FastWideToAnsi(tmp,dbv.szVal.A);
+ DBVT_UTF8 : WideToUTF8(tmp,dbv.szVal.A);
+ DBVT_WCHAR : dbv.szVal.W:=tmp;
+ DBVT_BLOB : begin
+ dbv.pbVal := mir_base64_decode(FastWideToAnsi(tmp,pAnsiChar(dbv.pbVal)),bufLen);
+ dbv.cpbVal := bufLen;
end;
end;
end;
diff --git a/plugins/Actman/iac_inout.pas b/plugins/Actman/iac_inout.pas
index 5ae7a1cedf..b5fcbb466a 100644
--- a/plugins/Actman/iac_inout.pas
+++ b/plugins/Actman/iac_inout.pas
@@ -327,36 +327,32 @@ begin
end;
1: begin
- with xmlparser do
+ tmp:=xmlGetAttrValue(HXML(node),ioObject);
+ if lstrcmpiw(tmp,ioClipboard)=0 then
begin
- tmp:=getAttrValue(HXML(node),ioObject);
- if lstrcmpiw(tmp,ioClipboard)=0 then
- begin
- flags:=flags or ACF_CLIPBRD;
- tmp:=getAttrValue(HXML(node),ioOper);
- if lstrcmpiw(tmp,ioCopy)=0 then flags:=flags or ACF_COPYTO;
- // else if lstrcmpiw(tmp,'paste')=0 then ;
- end
- else
+ flags:=flags or ACF_CLIPBRD;
+ tmp:=xmlGetAttrValue(HXML(node),ioOper);
+ if lstrcmpiw(tmp,ioCopy)=0 then flags:=flags or ACF_COPYTO;
+ end
+ else
+ begin
+ if lstrcmpiw(tmp,ioFile)=0 then
begin
- if lstrcmpiw(tmp,ioFile)=0 then
- begin
- if StrToInt(getAttrValue(HXML(node),ioFileVariable))=1 then
- flags:=flags or ACF_FILE_PATH;
-
- flags:=flags or ACF_FILE;
- StrDupW(tfile,getAttrValue(HXML(node),ioFile));
- tmp:=getAttrValue(HXML(node),ioOper);
- if lstrcmpiw(tmp,ioWrite )=0 then flags:=flags or ACF_FWRITE
- else if lstrcmpiw(tmp,ioAppend)=0 then flags:=flags or ACF_FAPPEND;
- case StrToInt(getAttrValue(HXML(node),ioEnc)) of
- 0: flags:=flags or ACF_ANSI;
- 1: flags:=flags or ACF_UTF8;
- 2: flags:=flags or ACF_UTF8 or ACF_SIGN;
- 3: flags:=flags or 0;
- 4: flags:=flags or ACF_SIGN;
- end;
+ if StrToInt(xmlGetAttrValue(HXML(node),ioFileVariable))=1 then
+ flags:=flags or ACF_FILE_PATH;
+
+ flags:=flags or ACF_FILE;
+ StrDupW(tfile,xmlGetAttrValue(HXML(node),ioFile));
+ tmp:=xmlGetAttrValue(HXML(node),ioOper);
+ if lstrcmpiw(tmp,ioWrite )=0 then flags:=flags or ACF_FWRITE
+ else if lstrcmpiw(tmp,ioAppend)=0 then flags:=flags or ACF_FAPPEND;
+ case StrToInt(xmlGetAttrValue(HXML(node),ioEnc)) of
+ 0: flags:=flags or ACF_ANSI;
+ 1: flags:=flags or ACF_UTF8;
+ 2: flags:=flags or ACF_UTF8 or ACF_SIGN;
+ 3: flags:=flags or 0;
+ 4: flags:=flags or ACF_SIGN;
end;
end;
end;
diff --git a/plugins/Actman/iac_jump.pas b/plugins/Actman/iac_jump.pas
index 4ac0473405..8e2bba787c 100644
--- a/plugins/Actman/iac_jump.pas
+++ b/plugins/Actman/iac_jump.pas
@@ -293,100 +293,54 @@ begin
end;
1: begin
- with xmlparser do
+ sub:=xmlGetNthChild(HXML(node),ioIf,0);
+ if sub<>0 then
begin
- sub:=getNthChild(HXML(node),ioIf,0);
- if sub<>0 then
- begin
- tmp:=getAttrValue(sub,ioOper);
- if lstrcmpiw(tmp,'math')=0 then flags:=flags or ACF_MATH
- else if lstrcmpiw(tmp,ioNop )=0 then flags:=flags or ACF_NOP;
+ tmp:=xmlGetAttrValue(sub,ioOper);
+ if lstrcmpiw(tmp,'math')=0 then flags:=flags or ACF_MATH
+ else if lstrcmpiw(tmp,ioNop )=0 then flags:=flags or ACF_NOP;
- tmp:=getAttrValue(sub,ioCond);
- if lstrcmpiw(tmp,ioNop)=0 then flags:=flags or ACF_NOP // compatibility
- else if (flags and ACF_NOP)=0 then
+ tmp:=xmlGetAttrValue(sub,ioCond);
+ if lstrcmpiw(tmp,ioNop)=0 then flags:=flags or ACF_NOP // compatibility
+ else if (flags and ACF_NOP)=0 then
+ begin
+ if flags and ACF_MATH<>0 then
begin
- if flags and ACF_MATH<>0 then
- begin
- if lstrcmpiw(tmp,'gt' )=0 then condition:=aeGT
- else if lstrcmpiw(tmp,'lt' )=0 then condition:=aeLT
- else if lstrcmpiw(tmp,'eq' )=0 then condition:=aeEQ
- else if lstrcmpiw(tmp,'xor')=0 then condition:=aeXR
- else if lstrcmpiw(tmp,'and')=0 then condition:=aeND;
- end
- else
- begin
- if lstrcmpiw(tmp,'empty')=0 then condition:=aeEMP
- else if lstrcmpiw(tmp,'eq' )=0 then condition:=aeEQU
- else if lstrcmpiw(tmp,'cont' )=0 then condition:=aeCON
- else if lstrcmpiw(tmp,'start')=0 then condition:=aeSTR
- else if lstrcmpiw(tmp,'ends' )=0 then condition:=aeEND;
-
- if StrToInt(getAttrValue(sub,ioCase))=1 then
- flags:=flags or ACF_CASE;
- if StrToInt(getAttrValue(sub,ioBack))=1 then
- flags:=flags or ACF_BACK;
- end;
- if StrToInt(getAttrValue(sub,ioNot))=1 then
- flags:=flags or ACF_NOT;
-
- if ((flags and ACF_MATH)<>0) or (condition<>aeEMP) then
- StrDupW(value,getAttrValue(sub,ioValue));
+ if lstrcmpiw(tmp,'gt' )=0 then condition:=aeGT
+ else if lstrcmpiw(tmp,'lt' )=0 then condition:=aeLT
+ else if lstrcmpiw(tmp,'eq' )=0 then condition:=aeEQ
+ else if lstrcmpiw(tmp,'xor')=0 then condition:=aeXR
+ else if lstrcmpiw(tmp,'and')=0 then condition:=aeND;
+ end
+ else
+ begin
+ if lstrcmpiw(tmp,'empty')=0 then condition:=aeEMP
+ else if lstrcmpiw(tmp,'eq' )=0 then condition:=aeEQU
+ else if lstrcmpiw(tmp,'cont' )=0 then condition:=aeCON
+ else if lstrcmpiw(tmp,'start')=0 then condition:=aeSTR
+ else if lstrcmpiw(tmp,'ends' )=0 then condition:=aeEND;
+
+ if StrToInt(xmlGetAttrValue(sub,ioCase))=1 then
+ flags:=flags or ACF_CASE;
+ if StrToInt(xmlGetAttrValue(sub,ioBack))=1 then
+ flags:=flags or ACF_BACK;
end;
- end;
+ if StrToInt(xmlGetAttrValue(sub,ioNot))=1 then
+ flags:=flags or ACF_NOT;
- sub:=getNthChild(HXML(node),ioPost,0);
- if sub<>0 then
- begin
- tmp:=getAttrValue(sub,ioOper);
- if lstrcmpiw(tmp,ioBreak)=0 then flags:=flags or ACF_BREAK
- else if lstrcmpiw(tmp,ioJump )=0 then StrDupW(actlabel,getAttrValue(sub,ioValue));
+ if ((flags and ACF_MATH)<>0) or (condition<>aeEMP) then
+ StrDupW(value,xmlGetAttrValue(sub,ioValue));
end;
end;
- end;
-{
- 2: begin
- pc:=GetParamSectionStr(node,ioOper);
- if lstrcmpi(pc,'math')=0 then flags:=flags or ACF_MATH
- else if lstrcmpi(pc,ioNop )=0 then flags:=flags or ACF_NOP;
-
- pc:=GetParamSectionStr(node,ioCond);
- if lstrcmpi(pc,ioNop)=0 then flags:=flags or ACF_NOP // compatibility
- else if (flags and ACF_NOP)=0 then
- begin
- if flags and ACF_MATH<>0 then
- begin
- if lstrcmpi(pc,'gt' )=0 then condition:=aeGT
- else if lstrcmpi(pc,'lt' )=0 then condition:=aeLT
- else if lstrcmpi(pc,'eq' )=0 then condition:=aeEQ
- else if lstrcmpi(pc,'xor')=0 then condition:=aeXR
- else if lstrcmpi(pc,'and')=0 then condition:=aeND;
- end
- else
- begin
- if lstrcmpi(pc,'empty')=0 then condition:=aeEMP
- else if lstrcmpi(pc,'eq' )=0 then condition:=aeEQU
- else if lstrcmpi(pc,'cont' )=0 then condition:=aeCON
- else if lstrcmpi(pc,'start')=0 then condition:=aeSTR
- else if lstrcmpi(pc,'ends' )=0 then condition:=aeEND;
-
- if GetParamSectionInt(node,ioCase)=1 then
- flags:=flags or ACF_CASE;
- if GetParamSectionInt(node,ioBack)=1 then
- flags:=flags or ACF_BACK;
- end;
- if GetParamSectionInt(node,ioNot)=1 then
- flags:=flags or ACF_NOT;
- if ((flags and ACF_MATH)<>0) or (condition<>aeEMP) then
- UTF8ToWide(GetParamSectionStr(node,ioValue),value);
+ sub:=xmlGetNthChild(HXML(node),ioPost,0);
+ if sub<>0 then
+ begin
+ tmp:=xmlGetAttrValue(sub,ioOper);
+ if lstrcmpiw(tmp,ioBreak)=0 then flags:=flags or ACF_BREAK
+ else if lstrcmpiw(tmp,ioJump )=0 then StrDupW(actlabel,xmlGetAttrValue(sub,ioValue));
end;
-
- pc:=GetParamSectionStr(node,ioAction);
- if lstrcmpi(pc,ioBreak)=0 then flags:=flags or ACF_BREAK
- else if lstrcmpi(pc,ioJump )=0 then UTF8ToWide(GetParamSectionStr(node,ioLabel),actlabel);
end;
-}
end;
end;
diff --git a/plugins/Actman/iac_messagebox.pas b/plugins/Actman/iac_messagebox.pas
index 41a1068ab2..78320e1cd5 100644
--- a/plugins/Actman/iac_messagebox.pas
+++ b/plugins/Actman/iac_messagebox.pas
@@ -147,26 +147,13 @@ begin
end;
1: begin
- with xmlparser do
- begin
- StrDupW(msgtitle,getAttrValue(HXML(node),ioTitle));
- StrDupW(msgtext,getText(HXML(node)));
- boxopts:=StrToInt(getAttrValue(HXML(node),ioType));
-
- if StrToInt(getAttrValue(HXML(node),ioArgVariable))=1 then flags:=flags or ACF_MSG_TXT;
- if StrToInt(getAttrValue(HXML(node),ioVariables ))=1 then flags:=flags or ACF_MSG_TTL;
- end;
- end;
-{
- 2: begin
- UTF8ToWide(GetParamSectionInt(node,ioTitle),msgtitle);
- UTF8ToWide(GetParamSectionInt(node,ioText ),msgtext);
- boxopts:=GetParamSectionInt(node,ioType);
+ StrDupW(msgtitle,xmlGetAttrValue(HXML(node),ioTitle));
+ StrDupW(msgtext,xmlGetText(HXML(node)));
+ boxopts:=StrToInt(xmlGetAttrValue(HXML(node),ioType));
- if GetParamSectionInt(node,ioArgVariable)=1 then flags:=flags or ACF_MSG_TXT;
- if GetParamSectionInt(node,ioVariables )=1 then flags:=flags or ACF_MSG_TTL;
+ if StrToInt(xmlGetAttrValue(HXML(node),ioArgVariable))=1 then flags:=flags or ACF_MSG_TXT;
+ if StrToInt(xmlGetAttrValue(HXML(node),ioVariables ))=1 then flags:=flags or ACF_MSG_TTL;
end;
-}
end;
end;
diff --git a/plugins/Actman/iac_program.pas b/plugins/Actman/iac_program.pas
index 33924c4279..d16c356019 100644
--- a/plugins/Actman/iac_program.pas
+++ b/plugins/Actman/iac_program.pas
@@ -244,30 +244,27 @@ begin
end;
1: begin
- with xmlparser do
- begin
- StrDupW(prgname,getText(HXML(node)));
- StrDupW(args,getAttrValue(HXML(node),ioArgs));
- if StrToInt(getAttrValue(HXML(node),ioCurrent))=1 then
- flags:=flags or ACF_CURPATH;
+ StrDupW(prgname,xmlGetText(HXML(node)));
+ StrDupW(args,xmlGetAttrValue(HXML(node),ioArgs));
+ if StrToInt(xmlGetAttrValue(HXML(node),ioCurrent))=1 then
+ flags:=flags or ACF_CURPATH;
- if StrToInt(getAttrValue(HXML(node),ioParallel))=1 then
- flags:=flags or ACF_PRTHREAD
- else
- time:=StrToInt(getAttrValue(HXML(node),ioWait));
+ if StrToInt(xmlGetAttrValue(HXML(node),ioParallel))=1 then
+ flags:=flags or ACF_PRTHREAD
+ else
+ time:=StrToInt(xmlGetAttrValue(HXML(node),ioWait));
- if StrToInt(getAttrValue(HXML(node),ioFileVariable))=1 then
- flags:=flags or ACF_PRG_PRG;
+ if StrToInt(xmlGetAttrValue(HXML(node),ioFileVariable))=1 then
+ flags:=flags or ACF_PRG_PRG;
- if StrToInt(getAttrValue(HXML(node),ioArgVariable))=1 then
- flags:=flags or ACF_PRG_ARG;
+ if StrToInt(xmlGetAttrValue(HXML(node),ioArgVariable))=1 then
+ flags:=flags or ACF_PRG_ARG;
- tmp:=getAttrValue(HXML(node),ioWindow);
- if lstrcmpiw(tmp,ioHidden )=0 then show:=SW_HIDE
- else if lstrcmpiw(tmp,ioMinimized)=0 then show:=SW_SHOWMINIMIZED
- else if lstrcmpiw(tmp,ioMaximized)=0 then show:=SW_SHOWMAXIMIZED
- else show:=SW_SHOWNORMAL;
- end;
+ tmp:=xmlGetAttrValue(HXML(node),ioWindow);
+ if lstrcmpiw(tmp,ioHidden )=0 then show:=SW_HIDE
+ else if lstrcmpiw(tmp,ioMinimized)=0 then show:=SW_SHOWMINIMIZED
+ else if lstrcmpiw(tmp,ioMaximized)=0 then show:=SW_SHOWMAXIMIZED
+ else show:=SW_SHOWNORMAL;
end;
{
2: begin
diff --git a/plugins/Actman/iac_service.pas b/plugins/Actman/iac_service.pas
index cfeb456191..1868b89214 100644
--- a/plugins/Actman/iac_service.pas
+++ b/plugins/Actman/iac_service.pas
@@ -174,25 +174,22 @@ begin
result:=ACF_TYPE_NUMBER;
if act=0 then
exit;
- with xmlparser do
+
+ tmp:=xmlGetAttrValue(act,ioType);
+ if lstrcmpiw(tmp,ioCurrent)=0 then result:=ACF_TYPE_CURRENT
+ else if lstrcmpiw(tmp,ioResult )=0 then result:=ACF_TYPE_RESULT
+ else if lstrcmpiw(tmp,ioParam )=0 then result:=ACF_TYPE_PARAM
+ else if lstrcmpiw(tmp,ioStruct )=0 then
begin
- tmp:=getAttrValue(act,ioType);
- if lstrcmpiw(tmp,ioCurrent)=0 then result:=ACF_TYPE_CURRENT
- else if lstrcmpiw(tmp,ioResult )=0 then result:=ACF_TYPE_RESULT
- else if lstrcmpiw(tmp,ioParam )=0 then result:=ACF_TYPE_PARAM
- else if lstrcmpiw(tmp,ioStruct )=0 then
- begin
- result:=ACF_TYPE_STRUCT;
-//!!!! param:=ReadStruct(act);
- end
- else
- begin
- StrDupW(pWideChar(param),getAttrValue(act,ioValue));
-
- if lstrcmpiw(tmp,ioNumber )=0 then result:=ACF_TYPE_NUMBER
- else if lstrcmpiw(tmp,ioUnicode)=0 then result:=ACF_TYPE_UNICODE
- else if lstrcmpiw(tmp,ioAnsi )=0 then result:=ACF_TYPE_STRING;
- end;
+ result:=ACF_TYPE_STRUCT;
+ end
+ else
+ begin
+ StrDupW(pWideChar(param),xmlGetAttrValue(act,ioValue));
+
+ if lstrcmpiw(tmp,ioNumber )=0 then result:=ACF_TYPE_NUMBER
+ else if lstrcmpiw(tmp,ioUnicode)=0 then result:=ACF_TYPE_UNICODE
+ else if lstrcmpiw(tmp,ioAnsi )=0 then result:=ACF_TYPE_STRING;
end;
end;
{
@@ -329,60 +326,32 @@ begin
service.w_flags:=0;
service.l_flags:=0;
- with xmlparser do
- begin
- FastWideToAnsi(getAttrValue(HXML(node),ioService),service.service);
-//!!!! StrDupW(service,getAttrValue(HXML(node),ioService));
- if StrToInt(getAttrValue(HXML(node),ioVariables))=1 then
- service.flags:=service.flags or ACF_FLAG_SCRIPT;
+ FastWideToAnsi(xmlGetAttrValue(HXML(node),ioService),service.service);
+ if StrToInt(xmlGetAttrValue(HXML(node),ioVariables))=1 then
+ service.flags:=service.flags or ACF_FLAG_SCRIPT;
- sub:=getNthChild(HXML(node),ioWParam,0);
- if StrToInt(getAttrValue(sub,ioVariables))=1 then
- service.w_flags:=service.w_flags or ACF_FLAG_SCRIPT;
- service.w_flags:=service.w_flags or
- ReadParam(sub,PWideChar(service.wparam),(service.w_flags and ACF_FLAG_SCRIPT)<>0);
-
- sub:=getNthChild(HXML(node),ioLParam,0);
- if StrToInt(getAttrValue(sub,ioVariables))=1 then
- service.l_flags:=service.l_flags or ACF_FLAG_SCRIPT;
- service.l_flags:=service.l_flags or
- ReadParam(sub,PWideChar(service.lparam),(service.l_flags and ACF_FLAG_SCRIPT)<>0);
-
- sub:=getNthChild(HXML(node),ioOutput,0);
- if StrToInt(getAttrValue(sub,ioFree))=1 then
- service.flags:=service.flags or ACF_FLAG_FREEMEM;
-
- tmp:=getAttrValue(sub,ioType);
- if lstrcmpiw(tmp,ioUnicode)=0 then service.flags:=service.flags or ACF_TYPE_UNICODE
- else if lstrcmpiw(tmp,ioAnsi )=0 then service.flags:=service.flags or ACF_TYPE_STRING
- else if lstrcmpiw(tmp,ioStruct )=0 then service.flags:=service.flags or ACF_TYPE_STRUCT
- else if lstrcmpiw(tmp,ioInt )=0 then service.flags:=service.flags or ACF_TYPE_NUMBER;
- end;
- end;
-{
- 2: begin
- StrDup(service,GetParamSectionStr(node,ioService));
-//!!!! UTF8ToWide(GetParamSectionStr(node,ioService),service);
- if GetParamSectionInt(node,ioVariables)=1 then
- flags:=flags or ACF_SCRIPT_SERVICE;
-
- if GetParamSectionInt(node,ioWParam+'.'+ioVariables))=1 then
- flags:=flags or ACF_SCRIPT_PARAM;
- flags:=flags or ReadParamINI(node,ioWParam+'.',wparam,(flags and ACF_SCRIPT_PARAM)<>0);
-
- if GetParamSectionInt(node,ioLParam+'.'+ioVariables))=1 then
- flags2:=flags2 or ACF_SCRIPT_PARAM;
- flags2:=flags2 or ReadParamINI(node,ioLParam+'.',lparam,(flags2 and ACF_SCRIPT_PARAM)<>0);
-
- if GetParamSectionInt(node,ioFree)=1 then flags:=flags or ACF_RFREEMEM;
-
- pc:=GetParamSectionStr(node,ioType);
- if lstrcmpi(pс,ioUnicode)=0 then flags:=flags or ACF_RUNICODE
- else if lstrcmpi(pс,ioAnsi )=0 then flags:=flags or ACF_RSTRING
- else if lstrcmpi(pс,ioStruct )=0 then flags:=flags or ACF_RSTRUCT
-// else if lstrcmpi(pс,ioInt )=0 then ;
+ sub:=xmlGetNthChild(HXML(node),ioWParam,0);
+ if StrToInt(xmlGetAttrValue(sub,ioVariables))=1 then
+ service.w_flags:=service.w_flags or ACF_FLAG_SCRIPT;
+ service.w_flags:=service.w_flags or
+ ReadParam(sub,PWideChar(service.wparam),(service.w_flags and ACF_FLAG_SCRIPT)<>0);
+
+ sub:=xmlGetNthChild(HXML(node),ioLParam,0);
+ if StrToInt(xmlGetAttrValue(sub,ioVariables))=1 then
+ service.l_flags:=service.l_flags or ACF_FLAG_SCRIPT;
+ service.l_flags:=service.l_flags or
+ ReadParam(sub,PWideChar(service.lparam),(service.l_flags and ACF_FLAG_SCRIPT)<>0);
+
+ sub:=xmlGetNthChild(HXML(node),ioOutput,0);
+ if StrToInt(xmlGetAttrValue(sub,ioFree))=1 then
+ service.flags:=service.flags or ACF_FLAG_FREEMEM;
+
+ tmp:=xmlGetAttrValue(sub,ioType);
+ if lstrcmpiw(tmp,ioUnicode)=0 then service.flags:=service.flags or ACF_TYPE_UNICODE
+ else if lstrcmpiw(tmp,ioAnsi )=0 then service.flags:=service.flags or ACF_TYPE_STRING
+ else if lstrcmpiw(tmp,ioStruct )=0 then service.flags:=service.flags or ACF_TYPE_STRUCT
+ else if lstrcmpiw(tmp,ioInt )=0 then service.flags:=service.flags or ACF_TYPE_NUMBER;
end;
-}
end;
end;
diff --git a/plugins/Actman/iac_storage.pas b/plugins/Actman/iac_storage.pas
index 500d366334..186e88240a 100644
--- a/plugins/Actman/iac_storage.pas
+++ b/plugins/Actman/iac_storage.pas
@@ -155,12 +155,9 @@ begin
end;
1: begin
- with xmlparser do
- begin
- if lstrcmpiw(getAttrValue(HXML(node),ioOper),ioCopy)=1 then
- flags:=flags or ACF_COPYFROM;
- Number:=StrToInt(getAttrValue(HXML(node),ioNumber));
- end;
+ if lstrcmpiw(xmlGetAttrValue(HXML(node),ioOper),ioCopy)=1 then
+ flags:=flags or ACF_COPYFROM;
+ Number:=StrToInt(xmlGetAttrValue(HXML(node),ioNumber));
end;
end;
end;
diff --git a/plugins/Actman/iac_text.pas b/plugins/Actman/iac_text.pas
index 68f9acf7ba..8614d6430e 100644
--- a/plugins/Actman/iac_text.pas
+++ b/plugins/Actman/iac_text.pas
@@ -361,22 +361,12 @@ begin
end;
1: begin
- with xmlparser do
- begin
- StrDupW(text,getText(HXML(node)));
- if StrToInt(getAttrValue(HXML(node),ioVariables))=1 then
- flags:=flags or ACF_TEXTSCRIPT;
- if StrToInt(getAttrValue(HXML(node),ioPost))=1 then
- flags:=flags or ACF_POSTPROCESS;
- end;
- end;
-{
- 2: begin
- UTF8ToWide(GetParamSectionInt(node,ioText),text);
- if GetParamSectionInt(node,ioVariables)=1 then
+ StrDupW(text,xmlGetText(HXML(node)));
+ if StrToInt(xmlGetAttrValue(HXML(node),ioVariables))=1 then
flags:=flags or ACF_TEXTSCRIPT;
+ if StrToInt(xmlGetAttrValue(HXML(node),ioPost))=1 then
+ flags:=flags or ACF_POSTPROCESS;
end;
-}
end;
end;
diff --git a/plugins/Actman/inoutxml.pas b/plugins/Actman/inoutxml.pas
index cd11c1a963..bcf91222bf 100644
--- a/plugins/Actman/inoutxml.pas
+++ b/plugins/Actman/inoutxml.pas
@@ -31,17 +31,14 @@ var
begin
result:=nil;
if actnode=0 then exit;
- with xmlparser do
+ pa:=GetLinkByName(FastWideToAnsiBuf(xmlGetAttrValue(actnode,ioClass),buf));
+ if pa<>nil then
begin
- pa:=GetLinkByName(FastWideToAnsiBuf(getAttrValue(actnode,ioClass),buf));
- if pa<>nil then
- begin
- result:=pa.Create;
- result.Load(pointer(actnode),1);
- end
- else
- result:=tBaseAction(1);
- end;
+ result:=pa.Create;
+ result.Load(pointer(actnode),1);
+ end
+ else
+ result:=tBaseAction(1);
end;
function Import(list:tMacroList;fname:PWideChar;aflags:dword):integer;
@@ -76,79 +73,72 @@ begin
BlockRead(f,res^,i);
CloseHandle(f);
-//MessageBoxW(0,res,'SRC',0);
- xmlparser.cbSize:=SizeOf(TXML_API_W);
- CallService(MS_SYSTEM_GET_XI,0,lparam(@xmlparser));
- with xmlparser do
- begin
- root:=parseString(ChangeUnicode(res),@i,nil);
- nodenum:=0;
- impact:=imp_yes;
- repeat
- actnode:=getNthChild(root,ioAction,nodenum);
- if actnode=0 then break;
-//?? if StrCmpW(getName(actnode),ioAction)<>0 then break;
- tmp:=getAttrValue(actnode,ioName);
- if tmp<>nil then //!!
+ root:=xmlParseString(ChangeUnicode(res),@i,nil);
+ nodenum:=0;
+ impact:=imp_yes;
+ repeat
+ actnode:=xmlGetNthChild(root,ioAction,nodenum);
+ if actnode=0 then break;
+ tmp:=xmlGetAttrValue(actnode,ioName);
+ if tmp<>nil then //!!
+ begin
+ p:=list.GetMacro(tmp);
+ oldid:=$FFFFFFFF;
+ if p<>nil then
begin
- p:=list.GetMacro(tmp);
- oldid:=$FFFFFFFF;
- if p<>nil then
+ if (impact<>imp_yesall) and (impact<>imp_noall) then
begin
- if (impact<>imp_yesall) and (impact<>imp_noall) then
- begin
- StrCopyW(buf,TranslateW('Action "$" exists, do you want to rewrite it?'));
- impact:=ShowQuestion(StrReplaceW(buf,'$',tmp));
- end;
- if (impact=imp_yesall) or (impact=imp_yes) then
- begin
- oldid:=p^.id;
- FreeMacro(p);
- end;
+ StrCopyW(buf,TranslateW('Action "$" exists, do you want to rewrite it?'));
+ impact:=ShowQuestion(StrReplaceW(buf,'$',tmp));
end;
- // if new or overwriting then read macro details/actions
- if (p=nil) or (impact=imp_yesall) or (impact=imp_yes) or (impact=imp_append) then
+ if (impact=imp_yesall) or (impact=imp_yes) then
begin
- with List[list.NewMacro()]^ do
+ oldid:=p^.id;
+ FreeMacro(p);
+ end;
+ end;
+ // if new or overwriting then read macro details/actions
+ if (p=nil) or (impact=imp_yesall) or (impact=imp_yes) or (impact=imp_append) then
+ begin
+ with List[list.NewMacro()]^ do
+ begin
+ if (p<>nil) and (oldid<>$FFFFFFFF) then // set old id to keep UseAction setting
begin
- if (p<>nil) and (oldid<>$FFFFFFFF) then // set old id to keep UseAction setting
- begin
- flags:=flags or ACF_IMPORT or ACF_OVERLOAD;
- id:=oldid;
- end
- else
- flags:=flags or ACF_IMPORT;
- if StrToInt(getAttrValue(actnode,ioVolatile))=1 then flags:=flags or ACF_VOLATILE;
- StrCopyW(descr,tmp,MacroNameLen-1);
+ flags:=flags or ACF_IMPORT or ACF_OVERLOAD;
+ id:=oldid;
+ end
+ else
+ flags:=flags or ACF_IMPORT;
+ if StrToInt(xmlGetAttrValue(actnode,ioVolatile))=1 then flags:=flags or ACF_VOLATILE;
+ StrCopyW(descr,tmp,MacroNameLen-1);
- // reading actions
- actcnt:=0; // count in file
- ActionCount:=0; // amount of loaded
- repeat
- act:=ImportAction(getChild(actnode,actcnt));
- if act=nil then
- break;
- if uint_ptr(act)<>1 then
- begin
- arr[ActionCount]:=act;
- inc(ActionCount);
- end;
- inc(actcnt);
- until false;
- // moving actions to their place
- if Actioncount>0 then
+ // reading actions
+ actcnt:=0; // count in file
+ ActionCount:=0; // amount of loaded
+ repeat
+ act:=ImportAction(xmlGetChild(actnode,actcnt));
+ if act=nil then
+ break;
+ if uint_ptr(act)<>1 then
begin
- GetMem(ActionList,SizeOf(tBaseAction)*ActionCount);
- move(arr,ActionList^,SizeOf(tBaseAction)*ActionCount);
+ arr[ActionCount]:=act;
+ inc(ActionCount);
end;
- inc(result);
+ inc(actcnt);
+ until false;
+ // moving actions to their place
+ if Actioncount>0 then
+ begin
+ GetMem(ActionList,SizeOf(tBaseAction)*ActionCount);
+ move(arr,ActionList^,SizeOf(tBaseAction)*ActionCount);
end;
+ inc(result);
end;
end;
- inc(nodenum);
- until false;
- destroyNode(root);
- end;
+ end;
+ inc(nodenum);
+ until false;
+ xmlDestroyNode(root);
mFreeMem(res);
end;
diff --git a/plugins/Actman/ua/i_inoutjson.inc b/plugins/Actman/ua/i_inoutjson.inc
index b560e99fb1..95f793e9f2 100644
--- a/plugins/Actman/ua/i_inoutjson.inc
+++ b/plugins/Actman/ua/i_inoutjson.inc
@@ -342,7 +342,7 @@ begin
f:=Rewrite(fname);
BlockWrite(f,res^,i*SizeOf(WideChar));
CloseHandle(f);
- xmlparser.FreeMem(res);
+ FreeMem(res);
DestroyNode(root);
end;
result:=1;
diff --git a/plugins/Actman/ua/i_inoutxm.inc b/plugins/Actman/ua/i_inoutxm.inc
index bf53ff954a..4a539a8275 100644
--- a/plugins/Actman/ua/i_inoutxm.inc
+++ b/plugins/Actman/ua/i_inoutxm.inc
@@ -1,6 +1,4 @@
{}
-var
- xmlparser:TXML_API_W;
const
ioAction :PWideChar = 'Action';
@@ -32,27 +30,24 @@ function ImportMenuItems(node:HXML;var MenuItem:tUAMenuItem):integer;
begin
result:=0;
- with xmlparser do
+ with MenuItem do
begin
- with MenuItem do
- begin
- menu_opt:=0;
- // popup
- StrDupW(szMenuPopup,getAttrValue(node,ioMenuPopup));
- // name
- StrDupW(szMenuNameVars,getAttrValue(node,ioMenuName));
- // show
- StrDupW(szMenuShowWhenVars,getAttrValue(node,ioMenuShow));
- // used
- if StrToInt(getAttrValue(node,ioMenuUsed))<>0 then
- menu_opt:=menu_opt or UAF_MENUUSE;
- // separated
- if StrToInt(getAttrValue(node,ioMenuSeparated))<>0 then
- menu_opt:=menu_opt or UAF_MENUSEP;
- // no translate
- if StrToInt(getAttrValue(node,ioNoTranslate))<>0 then
- menu_opt:=menu_opt or UAF_NOTRANS;
- end;
+ menu_opt:=0;
+ // popup
+ StrDupW(szMenuPopup,xmlGetAttrValue(node,ioMenuPopup));
+ // name
+ StrDupW(szMenuNameVars,xmlGetAttrValue(node,ioMenuName));
+ // show
+ StrDupW(szMenuShowWhenVars,xmlGetAttrValue(node,ioMenuShow));
+ // used
+ if StrToInt(xmlGetAttrValue(node,ioMenuUsed))<>0 then
+ menu_opt:=menu_opt or UAF_MENUUSE;
+ // separated
+ if StrToInt(xmlGetAttrValue(node,ioMenuSeparated))<>0 then
+ menu_opt:=menu_opt or UAF_MENUSEP;
+ // no translate
+ if StrToInt(xmlGetAttrValue(node,ioNoTranslate))<>0 then
+ menu_opt:=menu_opt or UAF_NOTRANS;
end;
end;
@@ -64,52 +59,44 @@ begin
result:=0;
if actnode=0 then exit;
- with xmlparser do
- begin
- // we don't need that node as is, just it's child for UA
-// actnode:=GetNthChild(actnode,ioUA,0);
-
- UA.flags:=0;
- // ----- Common -----
- if StrToInt(getAttrValue(actnode,ioTwoState))<>0 then
- UA.flags:=UA.flags or UAF_2STATE;
-
- if StrToInt(getAttrValue(actnode,ioSaveState))<>0 then
- UA.flags:=UA.flags or UAF_SAVESTATE;
-
- // sub:=AddChild(actnode,ioRegister,nil);
- if StrToInt(getAttrValue(actnode,ioHotkey))<>0 then
- UA.flags:=UA.flags or UAF_REGHOTKEY;
- if StrToInt(getAttrValue(actnode,ioToolbar))<>0 then
- UA.flags:=UA.flags or UAF_REGTTBB;
- if StrToInt(getAttrValue(actnode,ioTabSRMM))<>0 then
- UA.flags:=UA.flags or UAF_REGTABB;
-
- // ----- Hotkey -----
- // nothing
-
- // ----- Modern CList toolbar -----
- // source - ANSI text
- sub:=GetNthChild(actnode,ioToolbar,0);
- WideToAnsi(GetAttrValue(sub,ioTooltip ),UA.szTTBTooltip ,MirandaCP);
- WideToAnsi(GetAttrValue(sub,ioTooltipPressed),UA.szTTBTooltipPressed,MirandaCP);
-
- // ----- TabSRMM toolbar -----
- sub:=GetNthChild(actnode,ioTabSRMM,0);
- StrDupW(UA.szTabBTooltip ,getAttrValue(sub,ioTooltip));
- StrDupW(UA.szTabBTooltipPressed,getAttrValue(sub,ioTooltipPressed));
-
- // ----- Menus -----
- num:=0;
- repeat
- sub:=getNextChild(actnode,ioMenuItem,@num);
- if sub=0 then break;
-
- i:=StrToInt(getAttrValue(sub,ioType));
- ImportMenuItems(sub,
- UA.UAMenuItem[tMenuType(i)]);
- until false;
- end;
+ UA.flags:=0;
+ // ----- Common -----
+ if StrToInt(xmlGetAttrValue(actnode,ioTwoState))<>0 then
+ UA.flags:=UA.flags or UAF_2STATE;
+
+ if StrToInt(xmlGetAttrValue(actnode,ioSaveState))<>0 then
+ UA.flags:=UA.flags or UAF_SAVESTATE;
+
+ if StrToInt(xmlGetAttrValue(actnode,ioHotkey))<>0 then
+ UA.flags:=UA.flags or UAF_REGHOTKEY;
+ if StrToInt(xmlGetAttrValue(actnode,ioToolbar))<>0 then
+ UA.flags:=UA.flags or UAF_REGTTBB;
+ if StrToInt(xmlGetAttrValue(actnode,ioTabSRMM))<>0 then
+ UA.flags:=UA.flags or UAF_REGTABB;
+
+ // ----- Hotkey -----
+ // nothing
+
+ // ----- Modern CList toolbar -----
+ // source - ANSI text
+ sub:=xmlGetNthChild(actnode,ioToolbar,0);
+ WideToAnsi(xmlGetAttrValue(sub,ioTooltip ),UA.szTTBTooltip ,MirandaCP);
+ WideToAnsi(xmlGetAttrValue(sub,ioTooltipPressed),UA.szTTBTooltipPressed,MirandaCP);
+
+ // ----- TabSRMM toolbar -----
+ sub:=xmlGetNthChild(actnode,ioTabSRMM,0);
+ StrDupW(UA.szTabBTooltip ,xmlGetAttrValue(sub,ioTooltip));
+ StrDupW(UA.szTabBTooltipPressed,xmlGetAttrValue(sub,ioTooltipPressed));
+
+ // ----- Menus -----
+ num:=0;
+ repeat
+ sub:=xmlGetNextChild(actnode,ioMenuItem,@num);
+ if sub=0 then break;
+
+ i:=StrToInt(xmlGetAttrValue(sub,ioType));
+ ImportMenuItems(sub,UA.UAMenuItem[tMenuType(i)]);
+ until false;
end;
function Import(fname:PWideChar;aflags:dword):integer;
@@ -139,50 +126,45 @@ begin
BlockRead(f,res^,i);
CloseHandle(f);
- xmlparser.cbSize:={XML_API_SIZEOF_V1;//}SizeOf(TXML_API_W);
- CallService(MS_SYSTEM_GET_XI,0,lparam(@xmlparser));
- with xmlparser do
- begin
- root:=parseString(ChangeUnicode(res),@i,nil);
- j:=0;
- repeat
- actnode:=getNthChild(root,ioAction,j);
- if actnode=0 then break;
- // search id by name?
- pcw:=GetAttrValue(actnode,ioName);
- ptr:=ptr1;
- inc(pbyte(ptr),4);
- for i:=0 to num-1 do
+ root:=xmlParseString(ChangeUnicode(res),@i,nil);
+ j:=0;
+ repeat
+ actnode:=xmlGetNthChild(root,ioAction,j);
+ if actnode=0 then break;
+ // search id by name?
+ pcw:=xmlGetAttrValue(actnode,ioName);
+ ptr:=ptr1;
+ inc(pbyte(ptr),4);
+ for i:=0 to num-1 do
+ begin
+ if (ptr.flags and ACF_SELECTED)<>0 then
begin
- if (ptr.flags and ACF_SELECTED)<>0 then
+ if StrCmpw(pcw,ptr.descr)=0 then
begin
- if StrCmpw(pcw,ptr.descr)=0 then
+ // delete old UA for overwrited actions
+ if (ptr.flags and ACF_OVERLOAD)<>0 then
begin
- // delete old UA for overwrited actions
- if (ptr.flags and ACF_OVERLOAD)<>0 then
+ for act:=0 to HIGH(UActionList) do
begin
- for act:=0 to HIGH(UActionList) do
+ if ptr.id=UActionList[act].dwActID then
begin
- if ptr.id=UActionList[act].dwActID then
- begin
- DeleteUAction(act,true);
- break;
- end;
+ DeleteUAction(act,true);
+ break;
end;
end;
- num1:=AddUAction(-1,ptr);
- ImportUAction(getNthChild(actnode,ioUA,0),UActionList[num1]);
- break;
end;
+ num1:=AddUAction(-1,ptr);
+ ImportUAction(xmlGetNthChild(actnode,ioUA,0),UActionList[num1]);
+ break;
end;
- inc(ptr);
end;
-
- inc(j);
- until false;
+ inc(ptr);
+ end;
+
+ inc(j);
+ until false;
+ xmlDestroyNode(root);
- DestroyNode(root);
- end;
CallService(MS_ACT_FREELIST,0,LPARAM(ptr1));
mFreeMem(res);
result:=1;
@@ -197,27 +179,24 @@ end;
function ExportMenuItems(node:HXML;const MenuItem:tUAMenuItem):HXML;
begin
- with xmlparser do
+ result:=xmlAddChild(node,ioMenuItem,nil);
+ with MenuItem do
begin
- result:=AddChild(node,ioMenuItem,nil);
- with MenuItem do
- begin
- // popup
- if (szMenuPopup<>nil) and (szMenuPopup^<>#0) then
- AddAttr(result,ioMenuPopup,szMenuPopup);
- // name
- if (szMenuNameVars<>nil) and (szMenuNameVars^<>#0) then
- AddAttr(result,ioMenuName,szMenuNameVars);
- // show
- if (szMenuShowWhenVars<>nil) and (szMenuShowWhenVars^<>#0) then
- AddAttr(result,ioMenuShow,szMenuShowWhenVars);
- // used
- AddAttrInt(result,ioMenuUsed,ord((menu_opt AND UAF_MENUUSE)<>0));
- // separated
- AddAttrInt(result,ioMenuSeparated,ord((menu_opt AND UAF_MENUSEP)<>0));
- // no translate
- AddAttrInt(result,ioNoTranslate,ord((menu_opt AND UAF_NOTRANS)<>0));
- end;
+ // popup
+ if (szMenuPopup<>nil) and (szMenuPopup^<>#0) then
+ xmlAddAttr(result,ioMenuPopup,szMenuPopup);
+ // name
+ if (szMenuNameVars<>nil) and (szMenuNameVars^<>#0) then
+ xmlAddAttr(result,ioMenuName,szMenuNameVars);
+ // show
+ if (szMenuShowWhenVars<>nil) and (szMenuShowWhenVars^<>#0) then
+ xmlAddAttr(result,ioMenuShow,szMenuShowWhenVars);
+ // used
+ xmlAddAttrInt(result,ioMenuUsed,ord((menu_opt AND UAF_MENUUSE)<>0));
+ // separated
+ xmlAddAttrInt(result,ioMenuSeparated,ord((menu_opt AND UAF_MENUSEP)<>0));
+ // no translate
+ xmlAddAttrInt(result,ioNoTranslate,ord((menu_opt AND UAF_NOTRANS)<>0));
end;
end;
@@ -229,70 +208,66 @@ var
actnode,sub:HXML;
UA:pMyActionItem;
begin
- with xmlparser do
+ for i:=0 to HIGH(UActionList) do
begin
- for i:=0 to HIGH(UActionList) do
+ if UActionList[i].dwActID=id then
begin
- if UActionList[i].dwActID=id then
+ UA:=@UActionList[i];
+ actnode:=xmlGetChildByAttrValue(root,ioAction,ioName,name);
+ if actnode=0 then break;
+ // we don't need that node as is, just it's child for UA
+ actnode:=xmlAddChild(actnode,ioUA,nil);
+
+ // ----- Common -----
+ xmlAddAttrInt(actnode,ioTwoState ,ORD((UA.flags and UAF_2STATE )<>0));
+ xmlAddAttrInt(actnode,ioSaveState,ORD((UA.flags and UAF_SAVESTATE)<>0));
+
+ xmlAddAttrInt(actnode,ioHotkey ,ORD((UA.flags and UAF_REGHOTKEY)<>0));
+ xmlAddAttrInt(actnode,ioToolbar,ORD((UA.flags and UAF_REGTTBB )<>0));
+ xmlAddAttrInt(actnode,ioTabSRMM,ORD((UA.flags and UAF_REGTABB )<>0));
+
+ // ----- Hotkey -----
+ // nothing
+
+ // ----- Modern CList toolbar -----
+ // source - ANSI text
+ if ((UA.szTTBTooltip <>nil) and (UA.szTTBTooltip^ <>#0)) or
+ ((UA.szTTBTooltipPressed<>nil) and (UA.szTTBTooltipPressed^<>#0)) then
begin
- UA:=@UActionList[i];
- actnode:=getChildByAttrValue(root,ioAction,ioName,name);
- if actnode=0 then break;
- // we don't need that node as is, just it's child for UA
- actnode:=addChild(actnode,ioUA,nil);
-
- // ----- Common -----
- AddAttrInt(actnode,ioTwoState ,ORD((UA.flags and UAF_2STATE )<>0));
- AddAttrInt(actnode,ioSaveState,ORD((UA.flags and UAF_SAVESTATE)<>0));
-
- // sub:=AddChild(actnode,ioRegister,nil);
- AddAttrInt(actnode,ioHotkey ,ORD((UA.flags and UAF_REGHOTKEY)<>0));
- AddAttrInt(actnode,ioToolbar,ORD((UA.flags and UAF_REGTTBB )<>0));
- AddAttrInt(actnode,ioTabSRMM,ORD((UA.flags and UAF_REGTABB )<>0));
-
- // ----- Hotkey -----
- // nothing
-
- // ----- Modern CList toolbar -----
- // source - ANSI text
- if ((UA.szTTBTooltip <>nil) and (UA.szTTBTooltip^ <>#0)) or
- ((UA.szTTBTooltipPressed<>nil) and (UA.szTTBTooltipPressed^<>#0)) then
+ sub:=xmlAddChild(actnode,ioToolbar,nil);
+ if (UA.szTTBTooltip<>nil) and (UA.szTTBTooltip^<>#0) then
begin
- sub:=AddChild(actnode,ioToolbar,nil);
- if (UA.szTTBTooltip<>nil) and (UA.szTTBTooltip^<>#0) then
- begin
- AnsiToWide(UA.szTTBTooltip,pc,MirandaCP);
- AddAttr(sub,ioTooltip,pc);
- mFreeMem(pc);
- end;
- if (UA.szTTBTooltipPressed<>nil) and (UA.szTTBTooltipPressed^<>#0) then
- begin
- AnsiToWide(UA.szTTBTooltipPressed,pc,MirandaCP);
- AddAttr(sub,ioTooltipPressed,pc);
- mFreeMem(pc);
- end;
+ AnsiToWide(UA.szTTBTooltip,pc,MirandaCP);
+ xmlAddAttr(sub,ioTooltip,pc);
+ mFreeMem(pc);
end;
-
- // ----- TabSRMM toolbar -----
- if ((UA.szTabBTooltip <>nil) and (UA.szTabBTooltip^ <>#0)) or
- ((UA.szTabBTooltipPressed<>nil) and (UA.szTabBTooltipPressed^<>#0)) then
+ if (UA.szTTBTooltipPressed<>nil) and (UA.szTTBTooltipPressed^<>#0) then
begin
- sub:=AddChild(actnode,ioTabSRMM,nil);
- if (UA.szTabBTooltip<>nil) and (UA.szTabBTooltip^<>#0) then
- AddAttr(sub,ioTooltip,UA.szTabBTooltip);
- if (UA.szTabBTooltipPressed<>nil) and (UA.szTabBTooltipPressed^<>#0) then
- AddAttr(sub,ioTooltipPressed,UA.szTabBTooltipPressed);
+ AnsiToWide(UA.szTTBTooltipPressed,pc,MirandaCP);
+ xmlAddAttr(sub,ioTooltipPressed,pc);
+ mFreeMem(pc);
end;
+ end;
- // ----- Menus -----
- for lmenu:=main_menu to HIGH(tMenuType) do
- begin
- sub:=ExportMenuItems(actnode,UA.UAMenuItem[lmenu]);
- AddAttrInt(sub,ioType,ORD(lmenu));
- end;
+ // ----- TabSRMM toolbar -----
+ if ((UA.szTabBTooltip <>nil) and (UA.szTabBTooltip^ <>#0)) or
+ ((UA.szTabBTooltipPressed<>nil) and (UA.szTabBTooltipPressed^<>#0)) then
+ begin
+ sub:=xmlAddChild(actnode,ioTabSRMM,nil);
+ if (UA.szTabBTooltip<>nil) and (UA.szTabBTooltip^<>#0) then
+ xmlAddAttr(sub,ioTooltip,UA.szTabBTooltip);
+ if (UA.szTabBTooltipPressed<>nil) and (UA.szTabBTooltipPressed^<>#0) then
+ xmlAddAttr(sub,ioTooltipPressed,UA.szTabBTooltipPressed);
+ end;
- break;
+ // ----- Menus -----
+ for lmenu:=main_menu to HIGH(tMenuType) do
+ begin
+ sub:=ExportMenuItems(actnode,UA.UAMenuItem[lmenu]);
+ xmlAddAttrInt(sub,ioType,ORD(lmenu));
end;
+
+ break;
end;
end;
end;
@@ -306,47 +281,43 @@ var
ptr,ptr1:pChain;
begin
result:=0;
- xmlparser.cbSize:={XML_API_SIZEOF_V1;//}SizeOf(TXML_API_W);
- CallService(MS_SYSTEM_GET_XI,0,lparam(@xmlparser));
- with xmlparser do
+
+ // we need append file, not rewrite
+ i:=GetFSize(fname);
+ if i=0 then exit;
+
+ mGetMem (res ,i+SizeOf(WideChar));
+ FillChar(res^,i+SizeOf(WideChar),0);
+ f:=Reset(fname);
+ BlockRead(f,res^,i);
+ CloseHandle(f);
+ root:=xmlParseString(res,@i,nil);
+ mFreeMem(res);
+
+ num:=CallService(MS_ACT_GETLIST,0,LPARAM(@ptr));
+ if num>0 then
begin
- // we need append file, not rewrite
- i:=GetFSize(fname);
- if i=0 then exit;
-
- mGetMem (res ,i+SizeOf(WideChar));
- FillChar(res^,i+SizeOf(WideChar),0);
- f:=Reset(fname);
- BlockRead(f,res^,i);
- CloseHandle(f);
- root:=parseString(res,@i,nil);
- mFreeMem(res);
-
- num:=CallService(MS_ACT_GETLIST,0,LPARAM(@ptr));
- if num>0 then
+ ptr1:=ptr;
+ inc(pbyte(ptr),4);
+ for i:=0 to num-1 do
begin
- ptr1:=ptr;
- inc(pbyte(ptr),4);
- for i:=0 to num-1 do
+ if ((aflags and ACIO_SELECTED)=0) or
+ ((ptr.flags and ACCF_EXPORT)<>0) then
begin
- if ((aflags and ACIO_SELECTED)=0) or
- ((ptr.flags and ACCF_EXPORT)<>0) then
- begin
- WriteUAction(root,ptr.id,ptr.descr);
- end;
- inc(ptr);
+ WriteUAction(root,ptr.id,ptr.descr);
end;
- CallService(MS_ACT_FREELIST,0,LPARAM(ptr1));
+ inc(ptr);
end;
+ CallService(MS_ACT_FREELIST,0,LPARAM(ptr1));
+ end;
- res:=toString(root,@i);
+ res:=xmlToString(root,@i);
- f:=Rewrite(fname);
- BlockWrite(f,res^,i*SizeOf(WideChar));
- CloseHandle(f);
- xmlparser.FreeMem(res);
- DestroyNode(root);
- end;
+ f:=Rewrite(fname);
+ BlockWrite(f,res^,i*SizeOf(WideChar));
+ CloseHandle(f);
+ xmlFree(res);
+ xmlDestroyNode(root);
result:=1;
end;
diff --git a/plugins/ImportTXT/BICQ5IP.inc b/plugins/ImportTXT/BICQ5IP.inc
index 9f9a2e3f3c..1df28964b0 100644
--- a/plugins/ImportTXT/BICQ5IP.inc
+++ b/plugins/ImportTXT/BICQ5IP.inc
@@ -1,7 +1,6 @@
{$IFDEF BIN_IMPORT_}
var
- XI: TXML_API_W;
rhxml: HXML;
curxml: HXML;
chldxml: HXML;
@@ -13,28 +12,6 @@ var
{$ELSE}
begin
- If ServiceExists(MS_SYSTEM_GET_XI) > 0 then
- begin
- XI.cbSize := SizeOf(TXML_API_W);
- res := LongBool(CallService(MS_SYSTEM_GET_XI, 0, int(@XI)));
- if not res then
- begin
- XI.cbSize := SizeOf(TXML_API_W) - 4;
- res := LongBool(CallService(MS_SYSTEM_GET_XI, 0, int(@XI)));
- if not res then
- begin
- s := TranslateWideString('Error at initialization XML parser');
- DoMessage(ITXT_THREAD_ERROR, wparam(PWideChar(s)), 0);
- exit;
- end;
- end;
- end
- else
- begin
- s := TranslateWideString('Your version of Miranda don''t support XML parsing');
- DoMessage(ITXT_THREAD_ERROR, wparam(PWideChar(s)), 0);
- exit;
- end;
if (DContact.hContact = 0) or (DContact.hContact = INVALID_HANDLE_VALUE) then
if (fContact.hContact <> 0) and (fContact.hContact <> INVALID_HANDLE_VALUE) then
DContact := fContact;
@@ -47,40 +24,40 @@ begin
try
ptxt := UTF8toWide(pFileText, ptxt, SizeOf(WideChar) * FileLen + 2);
ptxt[FileLen + 1] := #0000;
- rhxml := XI.parseString(ptxt, @txtlen, 'root');
+ rhxml := xmlparseString(ptxt, @txtlen, 'root');
finally
freemem(ptxt);
end;
if (rhxml = 0) then
exit;
- DoMessage(ITXT_THREAD_MAXPROGRESS, 0, XI.getChildCount(rhxml));
- chldxml := XI.getFirstChild(rhxml);
- if XI.getName(chldxml) = 'version' then
+ DoMessage(ITXT_THREAD_MAXPROGRESS, 0, xmlgetChildCount(rhxml));
+ chldxml := xmlgetFirstChild(rhxml);
+ if xmlgetName(chldxml) = 'version' then
begin
ic := 0;
- curxml := XI.getNextChild(rhxml, 'event', @ic);
+ curxml := xmlgetNextChild(rhxml, 'event', @ic);
while (curxml <> 0) do
begin
fillchar(dbei, SizeOf(dbei), 0);
dbei.cbSize := SizeOf(dbei);
dbei.szModule := PAnsiChar(proto);
- if TryStrToInt(XI.getText(XI.getChildByPath(curxml, 'time', false)), tm)
+ if TryStrToInt(xmlgetText(xmlgetChildByPath(curxml, 'time', false)), tm)
then
dbei.timestamp := tm;
- if XI.getText(XI.getChildByPath(curxml, 'incoming', false)) = 'Yes' then
+ if xmlgetText(xmlgetChildByPath(curxml, 'incoming', false)) = 'Yes' then
dbei.flags := DBEF_READ or DBEF_UTF
else
dbei.flags := DBEF_READ or DBEF_UTF or DBEF_SENT;
- if XI.getText(XI.getChildByPath(curxml, 'type', false))^ = '2' then
+ if xmlgetText(xmlgetChildByPath(curxml, 'type', false))^ = '2' then
begin
- s := XI.getText(XI.getChildByPath(curxml, 'text', false)) + ': ' +
- XI.getText(XI.getChildByPath(curxml, 'data', false));
+ s := xmlgetText(xmlgetChildByPath(curxml, 'text', false)) + ': ' +
+ xmlgetText(xmlgetChildByPath(curxml, 'data', false));
dbei.eventType := EVENTTYPE_URL;
end
else
begin
- s := XI.getText(XI.getChildByPath(curxml, 'text', false));
+ s := xmlgetText(xmlgetChildByPath(curxml, 'text', false));
dbei.eventType := EVENTTYPE_MESSAGE;
end;
try
@@ -102,7 +79,7 @@ begin
finally
freemem(tempstr);
- curxml := XI.getNextChild(rhxml, 'event', @ic);
+ curxml := xmlgetNextChild(rhxml, 'event', @ic);
DoMessage(ITXT_THREAD_PROGRESS, ic, 0);
end;
end;
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp
index 7e06f1040c..9cb03cc152 100644
--- a/plugins/New_GPG/src/init.cpp
+++ b/plugins/New_GPG/src/init.cpp
@@ -27,7 +27,7 @@ HFONT bold_font = NULL;
HANDLE hLoadPubKey = NULL, g_hCLIcon = NULL, hExportGpgKeys = NULL, hImportGpgKeys = NULL;
HGENMENU hSendKey = NULL, hToggleEncryption = NULL;
RECT key_from_keyserver_rect = {0}, firstrun_rect = {0}, new_key_rect = {0}, key_gen_rect = {0}, load_key_rect = {0}, import_key_rect = {0}, key_password_rect = {0}, load_existing_key_rect = {0};
-XML_API xi = {0};
+
int hLangpack = 0;
logtofile debuglog;
bool gpg_valid = false, gpg_keyexist = false;
@@ -168,7 +168,6 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
extern "C" int __declspec(dllexport) Load()
{
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
- mir_getXI(&xi); //TODO: check if we have access to api
mir_getLP(&pluginInfo);
init_vars();
CreateServiceFunction("/LoadPubKey",LoadKey);
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp
index 711fbadf95..df16fde641 100755
--- a/plugins/New_GPG/src/utilities.cpp
+++ b/plugins/New_GPG/src/utilities.cpp
@@ -706,11 +706,11 @@ int GetJabberInterface(WPARAM w, LPARAM l) //get interface for all jabber accoun
static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pUserData)
{
HXML local_node = node;
- for(int n = 0; n <= xi.getChildCount(node); n++)
+ for(int n = 0; n <= xmlGetChildCount(node); n++)
{
- LPCTSTR str = xi.getText(local_node);
- LPCTSTR nodename = xi.getName(local_node);
- LPCTSTR attr = xi.getAttrValue(local_node, _T("to"));
+ LPCTSTR str = xmlGetText(local_node);
+ LPCTSTR nodename = xmlGetName(local_node);
+ LPCTSTR attr = xmlGetAttrValue(local_node, _T("to"));
if(attr)
{
MCONTACT hContact = ji->ContactFromJID(attr);
@@ -723,7 +723,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU
if(_tcsstr(str, _T("-----BEGIN PGP MESSAGE-----")) && _tcsstr(str, _T("-----END PGP MESSAGE-----")))
{
wstring data = str;
- xi.setText(local_node, _T("This message is encrypted."));
+ xmlSetText(local_node, _T("This message is encrypted."));
wstring::size_type p1 = data.find(_T("-----BEGIN PGP MESSAGE-----")) + mir_tstrlen(_T("-----BEGIN PGP MESSAGE-----"));
while(data.find(_T("Version: "), p1) != wstring::npos)
{
@@ -744,8 +744,8 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU
wstring::size_type p2 = data.find(_T("-----END PGP MESSAGE-----"));
wstring data2 = data.substr(p1, p2-p1-2);
strip_line_term(data2);
- HXML encrypted_data = xi.addChild(node, _T("x"), data2.c_str());
- xi.addAttr(encrypted_data, _T("xmlns"), _T("jabber:x:encrypted"));
+ HXML encrypted_data = xmlAddChild(node, _T("x"), data2.c_str());
+ xmlAddAttr(encrypted_data, _T("xmlns"), _T("jabber:x:encrypted"));
return FALSE;
}
}
@@ -892,15 +892,15 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU
{
std::wstring tmp = data.substr(p1, p2-p1);
strip_line_term(tmp);
- HXML encrypted_data = xi.addChild(node, _T("x"), tmp.c_str());
- xi.addAttr(encrypted_data, _T("xmlns"), _T("jabber:x:signed"));
+ HXML encrypted_data = xmlAddChild(node, _T("x"), tmp.c_str());
+ xmlAddAttr(encrypted_data, _T("xmlns"), _T("jabber:x:signed"));
}
}
return FALSE;
}
}
}
- local_node = xi.getChild(node, n);
+ local_node = xmlGetChild(node, n);
}
return FALSE;
}
@@ -910,35 +910,35 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU
static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface *ji, HXML node, void *pUserData)
{
HXML local_node = node;
- for(int n = 0; n <= xi.getChildCount(node); n++)
+ for(int n = 0; n <= xmlGetChildCount(node); n++)
{
- LPCTSTR str = xi.getText(local_node);
- LPCTSTR nodename = xi.getName(local_node);
+ LPCTSTR str = xmlGetText(local_node);
+ LPCTSTR nodename = xmlGetName(local_node);
if(nodename)
{
if(_tcsstr(nodename, _T("x")))
{
- for(int n = 0; n < xi.getAttrCount(local_node); n++)
+ for(int n = 0; n < xmlGetAttrCount(local_node); n++)
{
- LPCTSTR name = xi.getAttrName(local_node, n);
- LPCTSTR value = xi.getAttrValue(local_node, name);
+ LPCTSTR name = xmlGetAttrName(local_node, n);
+ LPCTSTR value = xmlGetAttrValue(local_node, name);
if(_tcsstr(value, _T("jabber:x:signed")))
{
std::wstring status_str;
HXML local_node2 = node;
- for(int n = 0; n <= xi.getChildCount(node); n++)
+ for(int n = 0; n <= xmlGetChildCount(node); n++)
{
- LPCTSTR nodename2 = xi.getName(local_node2);
+ LPCTSTR nodename2 = xmlGetName(local_node2);
if(_tcsstr(nodename2, _T("status")))
{
- LPCTSTR status = xi.getText(local_node2);
+ LPCTSTR status = xmlGetText(local_node2);
if(status)
status_str = status;
break;
}
- local_node2 = xi.getChild(node, n);
+ local_node2 = xmlGetChild(node, n);
}
- LPCTSTR data = xi.getText(local_node);
+ LPCTSTR data = xmlGetText(local_node);
wstring sign = _T("-----BEGIN PGP SIGNATURE-----\n\n");
wstring file = toUTF16(get_random(10)), status_file = toUTF16(get_random(10));
sign += data;
@@ -1010,7 +1010,7 @@ static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface *ji, HXML node, voi
{
if(!(*p))
break;
- hContact = (*p)->getJabberInterface()->ContactFromJID(xi.getAttrValue(node, _T("from")));
+ hContact = (*p)->getJabberInterface()->ContactFromJID(xmlGetAttrValue(node, _T("from")));
if(hContact)
hcontact_data[hContact].key_in_prescense = out.substr(p1, p2-p1-1).c_str();
}
@@ -1023,7 +1023,7 @@ static JABBER_HANDLER_FUNC PrescenseHandler(IJabberInterface *ji, HXML node, voi
}
}
}
- local_node = xi.getChild(node, n);
+ local_node = xmlGetChild(node, n);
}
return FALSE;
}
diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp
index 9e156a3162..3ea2a0f3d9 100644
--- a/plugins/NewsAggregator/Src/CheckFeed.cpp
+++ b/plugins/NewsAggregator/Src/CheckFeed.cpp
@@ -19,7 +19,7 @@ Boston, MA 02111-1307, USA.
#include "common.h"
-TCHAR* CheckFeed(TCHAR *tszURL, HWND hwndDlg)
+LPCTSTR CheckFeed(TCHAR *tszURL, HWND hwndDlg)
{
Netlib_LogfT(hNetlibUser, _T("Started validating feed %s."), tszURL);
char *szData = NULL;
@@ -29,47 +29,45 @@ TCHAR* CheckFeed(TCHAR *tszURL, HWND hwndDlg)
if (!tszData)
tszData = mir_a2t(szData);
int bytesParsed = 0;
- HXML hXml = xi.parseString(tszData, &bytesParsed, NULL);
+ HXML hXml = xmlParseString(tszData, &bytesParsed, NULL);
mir_free(tszData);
mir_free(szData);
if (hXml != NULL) {
int childcount = 0;
HXML node;
- if (!mir_tstrcmpi(xi.getName(hXml), _T("xml")))
- node = xi.getChild(hXml, childcount);
+ if (!mir_tstrcmpi(xmlGetName(hXml), _T("xml")))
+ node = xmlGetChild(hXml, childcount);
else
node = hXml;
while (node) {
- LPCTSTR szNodeName = xi.getName(node);
+ LPCTSTR szNodeName = xmlGetName(node);
if (!mir_tstrcmpi(szNodeName, _T("rss")) || !mir_tstrcmpi(szNodeName, _T("rdf"))) {
- HXML chan = xi.getChild(node, 0);
- for (int j = 0; j < xi.getChildCount(chan); j++) {
- HXML child = xi.getChild(chan, j);
- if (!mir_tstrcmpi(xi.getName(child), _T("title"))) {
+ HXML chan = xmlGetChild(node, 0);
+ for (int j = 0; j < xmlGetChildCount(chan); j++) {
+ HXML child = xmlGetChild(chan, j);
+ if (!mir_tstrcmpi(xmlGetName(child), _T("title"))) {
TCHAR mes[MAX_PATH];
mir_sntprintf(mes, _countof(mes), TranslateT("%s\nis a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION);
- TCHAR *tszTitle = (TCHAR *)xi.getText(child);
- return tszTitle;
+ return xmlGetText(child);
}
}
}
else if (!mir_tstrcmpi(szNodeName, _T("feed"))) {
- for (int j = 0; j < xi.getChildCount(node); j++) {
- HXML child = xi.getChild(node, j);
- if (!mir_tstrcmpi(xi.getName(child), _T("title"))) {
+ for (int j = 0; j < xmlGetChildCount(node); j++) {
+ HXML child = xmlGetChild(node, j);
+ if (!mir_tstrcmpi(xmlGetName(child), _T("title"))) {
TCHAR mes[MAX_PATH];
mir_sntprintf(mes, _countof(mes), TranslateT("%s\nis a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION);
- TCHAR *tszTitle = (TCHAR *)xi.getText(child);
- return tszTitle;
+ return xmlGetText(child);
}
}
}
- node = xi.getChild(hXml, ++childcount);
+ node = xmlGetChild(hXml, ++childcount);
}
}
- xi.destroyNode(hXml);
+ xmlDestroyNode(hXml);
}
Netlib_LogfT(hNetlibUser, _T("%s is not a valid feed's address."), tszURL);
TCHAR mes[MAX_PATH];
@@ -178,7 +176,7 @@ void CheckCurrentFeed(MCONTACT hContact)
if (!tszData)
tszData = mir_a2t(szData);
int bytesParsed = 0;
- HXML hXml = xi.parseString(tszData, &bytesParsed, NULL);
+ HXML hXml = xmlParseString(tszData, &bytesParsed, NULL);
mir_free(tszData);
mir_free(szData);
@@ -186,20 +184,20 @@ void CheckCurrentFeed(MCONTACT hContact)
if (hXml != NULL) {
int childcount = 0;
HXML node;
- if (!mir_tstrcmpi(xi.getName(hXml), _T("xml")))
- node = xi.getChild(hXml, childcount);
+ if (!mir_tstrcmpi(xmlGetName(hXml), _T("xml")))
+ node = xmlGetChild(hXml, childcount);
else
node = hXml;
while (node) {
- LPCTSTR szNodeName = xi.getName(node);
+ LPCTSTR szNodeName = xmlGetName(node);
bool isRSS = !mir_tstrcmpi(szNodeName, _T("rss")), isAtom = !mir_tstrcmpi(szNodeName, _T("rdf"));
if (isRSS || isAtom) {
if (isRSS) {
- for (int i = 0; i < xi.getAttrCount(node); i++) {
- LPCTSTR szAttrName = xi.getAttrName(node, i);
+ for (int i = 0; i < xmlGetAttrCount(node); i++) {
+ LPCTSTR szAttrName = xmlGetAttrName(node, i);
if (!mir_tstrcmpi(szAttrName, _T("version"))) {
TCHAR ver[MAX_PATH];
- mir_sntprintf(ver, _countof(ver), _T("RSS %s"), xi.getAttrValue(node, szAttrName));
+ mir_sntprintf(ver, _countof(ver), _T("RSS %s"), xmlGetAttrValue(node, szAttrName));
db_set_ts(hContact, MODULE, "MirVer", ver);
break;
}
@@ -208,22 +206,22 @@ void CheckCurrentFeed(MCONTACT hContact)
else if (isAtom)
db_set_ts(hContact, MODULE, "MirVer", _T("RSS 1.0"));
- HXML chan = xi.getChild(node, 0);
- for (int j = 0; j < xi.getChildCount(chan); j++) {
- HXML child = xi.getChild(chan, j);
- LPCTSTR childName = xi.getName(child);
+ HXML chan = xmlGetChild(node, 0);
+ for (int j = 0; j < xmlGetChildCount(chan); j++) {
+ HXML child = xmlGetChild(chan, j);
+ LPCTSTR childName = xmlGetName(child);
if (!mir_tstrcmpi(childName, _T("title"))) {
- LPCTSTR szChildText = xi.getText(child);
+ LPCTSTR szChildText = xmlGetText(child);
if (szChildText)
db_set_ts(hContact, MODULE, "FirstName", ClearText(szValue, szChildText));
}
else if (!mir_tstrcmpi(childName, _T("link"))) {
- LPCTSTR szChildText = xi.getText(child);
+ LPCTSTR szChildText = xmlGetText(child);
if (szChildText)
db_set_ts(hContact, MODULE, "Homepage", ClearText(szValue, szChildText));
}
else if (!mir_tstrcmpi(childName, _T("description"))) {
- LPCTSTR szChildText = xi.getText(child);
+ LPCTSTR szChildText = xmlGetText(child);
if (szChildText) {
ClearText(szValue, szChildText);
db_set_ts(hContact, MODULE, "About", szValue);
@@ -231,30 +229,30 @@ void CheckCurrentFeed(MCONTACT hContact)
}
}
else if (!mir_tstrcmpi(childName, _T("language"))) {
- LPCTSTR szChildText = xi.getText(child);
+ LPCTSTR szChildText = xmlGetText(child);
if (szChildText)
db_set_ts(hContact, MODULE, "Language1", ClearText(szValue, szChildText));
}
else if (!mir_tstrcmpi(childName, _T("managingEditor"))) {
- LPCTSTR szChildText = xi.getText(child);
+ LPCTSTR szChildText = xmlGetText(child);
if (szChildText)
db_set_ts(hContact, MODULE, "e-mail", ClearText(szValue, szChildText));
}
else if (!mir_tstrcmpi(childName, _T("category"))) {
- LPCTSTR szChildText = xi.getText(child);
+ LPCTSTR szChildText = xmlGetText(child);
if (szChildText)
db_set_ts(hContact, MODULE, "Interest0Text", ClearText(szValue, szChildText));
}
else if (!mir_tstrcmpi(childName, _T("copyright"))) {
- LPCTSTR szChildText = xi.getText(child);
+ LPCTSTR szChildText = xmlGetText(child);
if (szChildText)
db_set_s(hContact, "UserInfo", "MyNotes", _T2A(ClearText(szValue, szChildText)));
}
else if (!mir_tstrcmpi(childName, _T("image"))) {
- for (int x = 0; x < xi.getChildCount(child); x++) {
- HXML imageval = xi.getChild(child, x);
- if (!mir_tstrcmpi(xi.getName(imageval), _T("url"))) {
- LPCTSTR url = xi.getText(imageval);
+ for (int x = 0; x < xmlGetChildCount(child); x++) {
+ HXML imageval = xmlGetChild(child, x);
+ if (!mir_tstrcmpi(xmlGetName(imageval), _T("url"))) {
+ LPCTSTR url = xmlGetText(imageval);
db_set_ts(hContact, MODULE, "ImageURL", url);
PROTO_AVATAR_INFORMATION ai = { 0 };
@@ -281,15 +279,15 @@ void CheckCurrentFeed(MCONTACT hContact)
}
}
else if (!mir_tstrcmpi(childName, _T("lastBuildDate"))) {
- LPCTSTR szChildText = xi.getText(child);
+ LPCTSTR szChildText = xmlGetText(child);
if (szChildText) {
- TCHAR *lastupdtime = (TCHAR *)xi.getText(child);
+ TCHAR *lastupdtime = (TCHAR *)xmlGetText(child);
time_t stamp = DateToUnixTime(lastupdtime, 0);
double deltaupd = difftime(time(NULL), stamp);
double deltacheck = difftime(time(NULL), (time_t)db_get_dw(hContact, MODULE, "LastCheck", 0));
if (deltaupd - deltacheck >= 0) {
db_set_dw(hContact, MODULE, "LastCheck", (DWORD)time(NULL));
- xi.destroyNode(hXml);
+ xmlDestroyNode(hXml);
return;
}
}
@@ -297,34 +295,34 @@ void CheckCurrentFeed(MCONTACT hContact)
else if (!mir_tstrcmpi(childName, _T("item"))) {
CMString title, link, descr, author, comments, guid, category;
time_t stamp = 0;
- for (int z = 0; z < xi.getChildCount(child); z++) {
- HXML itemval = xi.getChild(child, z);
- LPCTSTR itemName = xi.getName(itemval);
+ for (int z = 0; z < xmlGetChildCount(child); z++) {
+ HXML itemval = xmlGetChild(child, z);
+ LPCTSTR itemName = xmlGetName(itemval);
// We only use the first tag for now and ignore the rest.
if (!mir_tstrcmpi(itemName, _T("title")))
- ClearText(title, xi.getText(itemval));
+ ClearText(title, xmlGetText(itemval));
else if (!mir_tstrcmpi(itemName, _T("link")))
- ClearText(link, xi.getText(itemval));
+ ClearText(link, xmlGetText(itemval));
else if (!mir_tstrcmpi(itemName, _T("pubDate")) || !mir_tstrcmpi(itemName, _T("date"))) {
if (stamp == 0)
- stamp = DateToUnixTime(xi.getText(itemval), 0);
+ stamp = DateToUnixTime(xmlGetText(itemval), 0);
}
else if (!mir_tstrcmpi(itemName, _T("description")) || !mir_tstrcmpi(itemName, _T("encoded")))
- ClearText(descr, xi.getText(itemval));
+ ClearText(descr, xmlGetText(itemval));
else if (!mir_tstrcmpi(itemName, _T("author")) || !mir_tstrcmpi(itemName, _T("creator")))
- ClearText(author, xi.getText(itemval));
+ ClearText(author, xmlGetText(itemval));
else if (!mir_tstrcmpi(itemName, _T("comments")))
- ClearText(comments, xi.getText(itemval));
+ ClearText(comments, xmlGetText(itemval));
else if (!mir_tstrcmpi(itemName, _T("guid")))
- ClearText(guid, xi.getText(itemval));
+ ClearText(guid, xmlGetText(itemval));
else if (!mir_tstrcmpi(itemName, _T("category")))
- ClearText(category, xi.getText(itemval));
+ ClearText(category, xmlGetText(itemval));
}
XmlToMsg(hContact, title, link, descr, author, comments, guid, category, stamp);
@@ -333,26 +331,26 @@ void CheckCurrentFeed(MCONTACT hContact)
}
else if (!mir_tstrcmpi(szNodeName, _T("feed"))) {
db_set_ts(hContact, MODULE, "MirVer", _T("Atom 3"));
- for (int j = 0; j < xi.getChildCount(node); j++) {
- HXML child = xi.getChild(node, j);
- LPCTSTR szChildName = xi.getName(child);
+ for (int j = 0; j < xmlGetChildCount(node); j++) {
+ HXML child = xmlGetChild(node, j);
+ LPCTSTR szChildName = xmlGetName(child);
if (!mir_tstrcmpi(szChildName, _T("title"))) {
- LPCTSTR szChildText = xi.getText(child);
+ LPCTSTR szChildText = xmlGetText(child);
if (szChildText)
db_set_ts(hContact, MODULE, "FirstName", ClearText(szValue, szChildText));
}
else if (!mir_tstrcmpi(szChildName, _T("link"))) {
- for (int x = 0; x < xi.getAttrCount(child); x++) {
- if (!mir_tstrcmpi(xi.getAttrName(child, x), _T("rel")))
- if (!mir_tstrcmpi(xi.getAttrValue(child, xi.getAttrName(child, x)), _T("self")))
+ for (int x = 0; x < xmlGetAttrCount(child); x++) {
+ if (!mir_tstrcmpi(xmlGetAttrName(child, x), _T("rel")))
+ if (!mir_tstrcmpi(xmlGetAttrValue(child, xmlGetAttrName(child, x)), _T("self")))
break;
- if (!mir_tstrcmpi(xi.getAttrName(child, x), _T("href")))
- db_set_ts(hContact, MODULE, "Homepage", xi.getAttrValue(child, xi.getAttrName(child, x)));
+ if (!mir_tstrcmpi(xmlGetAttrName(child, x), _T("href")))
+ db_set_ts(hContact, MODULE, "Homepage", xmlGetAttrValue(child, xmlGetAttrName(child, x)));
}
}
else if (!mir_tstrcmpi(szChildName, _T("subtitle"))) {
- LPCTSTR szChildText = xi.getText(child);
+ LPCTSTR szChildText = xmlGetText(child);
if (szChildText) {
ClearText(szValue, szChildText);
db_set_ts(hContact, MODULE, "About", szValue);
@@ -360,29 +358,29 @@ void CheckCurrentFeed(MCONTACT hContact)
}
}
else if (!mir_tstrcmpi(szChildName, _T("language"))) {
- LPCTSTR szChildText = xi.getText(child);
+ LPCTSTR szChildText = xmlGetText(child);
if (szChildText)
db_set_ts(hContact, MODULE, "Language1", ClearText(szValue, szChildText));
}
else if (!mir_tstrcmpi(szChildName, _T("author"))) {
- for (int x = 0; x < xi.getChildCount(child); x++) {
- HXML authorval = xi.getChild(child, x);
- if (!mir_tstrcmpi(xi.getName(authorval), _T("email"))) {
- db_set_ts(hContact, MODULE, "e-mail", xi.getText(authorval));
+ for (int x = 0; x < xmlGetChildCount(child); x++) {
+ HXML authorval = xmlGetChild(child, x);
+ if (!mir_tstrcmpi(xmlGetName(authorval), _T("email"))) {
+ db_set_ts(hContact, MODULE, "e-mail", xmlGetText(authorval));
break;
}
}
}
else if (!mir_tstrcmpi(szChildName, _T("category"))) {
- LPCTSTR szChildText = xi.getText(child);
+ LPCTSTR szChildText = xmlGetText(child);
if (szChildText)
db_set_ts(hContact, MODULE, "Interest0Text", ClearText(szValue, szChildText));
}
else if (!mir_tstrcmpi(szChildName, _T("icon"))) {
- for (int x = 0; x < xi.getChildCount(child); x++) {
- HXML imageval = xi.getChild(child, x);
- if (!mir_tstrcmpi(xi.getName(imageval), _T("url"))) {
- LPCTSTR url = xi.getText(imageval);
+ for (int x = 0; x < xmlGetChildCount(child); x++) {
+ HXML imageval = xmlGetChild(child, x);
+ if (!mir_tstrcmpi(xmlGetName(imageval), _T("url"))) {
+ LPCTSTR url = xmlGetText(imageval);
db_set_ts(hContact, MODULE, "ImageURL", url);
ptrT szNick(db_get_tsa(hContact, MODULE, "Nick"));
@@ -405,7 +403,7 @@ void CheckCurrentFeed(MCONTACT hContact)
}
}
else if (!mir_tstrcmpi(szChildName, _T("updated"))) {
- LPCTSTR szChildText = xi.getText(child);
+ LPCTSTR szChildText = xmlGetText(child);
if (szChildText) {
TCHAR *lastupdtime = (TCHAR *)szChildText;
time_t stamp = DateToUnixTime(lastupdtime, 1);
@@ -413,7 +411,7 @@ void CheckCurrentFeed(MCONTACT hContact)
double deltacheck = difftime(time(NULL), (time_t)db_get_dw(hContact, MODULE, "LastCheck", 0));
if (deltaupd - deltacheck >= 0) {
db_set_dw(hContact, MODULE, "LastCheck", (DWORD)time(NULL));
- xi.destroyNode(hXml);
+ xmlDestroyNode(hXml);
return;
}
}
@@ -421,55 +419,55 @@ void CheckCurrentFeed(MCONTACT hContact)
else if (!mir_tstrcmpi(szChildName, _T("entry"))) {
CMString title, link, descr, author, comments, guid, category;
time_t stamp = 0;
- for (int z = 0; z < xi.getChildCount(child); z++) {
- HXML itemval = xi.getChild(child, z);
- LPCTSTR szItemName = xi.getName(itemval);
+ for (int z = 0; z < xmlGetChildCount(child); z++) {
+ HXML itemval = xmlGetChild(child, z);
+ LPCTSTR szItemName = xmlGetName(itemval);
if (!mir_tstrcmpi(szItemName, _T("title"))) {
- LPCTSTR szItemText = xi.getText(itemval);
+ LPCTSTR szItemText = xmlGetText(itemval);
if (szItemText)
ClearText(title, szItemText);
}
else if (!mir_tstrcmpi(szItemName, _T("link"))) {
- for (int x = 0; x < xi.getAttrCount(itemval); x++) {
- if (!mir_tstrcmpi(xi.getAttrName(itemval, x), _T("href"))) {
- ClearText(link, xi.getAttrValue(itemval, xi.getAttrName(itemval, x)));
+ for (int x = 0; x < xmlGetAttrCount(itemval); x++) {
+ if (!mir_tstrcmpi(xmlGetAttrName(itemval, x), _T("href"))) {
+ ClearText(link, xmlGetAttrValue(itemval, xmlGetAttrName(itemval, x)));
break;
}
}
}
else if (!mir_tstrcmpi(szItemName, _T("updated"))) {
if (stamp == 0)
- stamp = DateToUnixTime(xi.getText(itemval), 0);
+ stamp = DateToUnixTime(xmlGetText(itemval), 0);
}
else if (!mir_tstrcmpi(szItemName, _T("summary")) || !mir_tstrcmpi(szItemName, _T("content"))) {
- LPCTSTR szItemText = xi.getText(itemval);
+ LPCTSTR szItemText = xmlGetText(itemval);
if (szItemText)
ClearText(descr, szItemText);
}
else if (!mir_tstrcmpi(szItemName, _T("author"))) {
- for (int x = 0; x < xi.getChildCount(itemval); x++) {
- HXML authorval = xi.getChild(itemval, x);
- if (!mir_tstrcmpi(xi.getName(authorval), _T("name")) && xi.getText(authorval)) {
- ClearText(author, xi.getText(authorval));
+ for (int x = 0; x < xmlGetChildCount(itemval); x++) {
+ HXML authorval = xmlGetChild(itemval, x);
+ if (!mir_tstrcmpi(xmlGetName(authorval), _T("name")) && xmlGetText(authorval)) {
+ ClearText(author, xmlGetText(authorval));
break;
}
}
}
else if (!mir_tstrcmpi(szItemName, _T("comments"))) {
- LPCTSTR szItemText = xi.getText(itemval);
+ LPCTSTR szItemText = xmlGetText(itemval);
if (szItemText)
ClearText(comments, szItemText);
}
else if (!mir_tstrcmpi(szItemName, _T("id"))) {
- LPCTSTR szItemText = xi.getText(itemval);
+ LPCTSTR szItemText = xmlGetText(itemval);
if (szItemText)
- ClearText(guid, xi.getText(itemval));
+ ClearText(guid, xmlGetText(itemval));
}
else if (!mir_tstrcmpi(szItemName, _T("category"))) {
- for (int x = 0; x < xi.getAttrCount(itemval); x++) {
- LPCTSTR szAttrName = xi.getAttrName(itemval, x);
- if (!mir_tstrcmpi(szAttrName, _T("term")) && xi.getText(itemval)) {
- ClearText(category, xi.getAttrValue(itemval, szAttrName));
+ for (int x = 0; x < xmlGetAttrCount(itemval); x++) {
+ LPCTSTR szAttrName = xmlGetAttrName(itemval, x);
+ if (!mir_tstrcmpi(szAttrName, _T("term")) && xmlGetText(itemval)) {
+ ClearText(category, xmlGetAttrValue(itemval, szAttrName));
break;
}
}
@@ -480,9 +478,9 @@ void CheckCurrentFeed(MCONTACT hContact)
}
}
}
- node = xi.getChild(hXml, ++childcount);
+ node = xmlGetChild(hXml, ++childcount);
}
- xi.destroyNode(hXml);
+ xmlDestroyNode(hXml);
}
}
db_set_dw(hContact, MODULE, "LastCheck", (DWORD)time(NULL));
@@ -508,25 +506,25 @@ void CheckCurrentFeedAvatar(MCONTACT hContact)
if (!tszData)
tszData = mir_a2t(szData);
int bytesParsed = 0;
- HXML hXml = xi.parseString(tszData, &bytesParsed, NULL);
+ HXML hXml = xmlParseString(tszData, &bytesParsed, NULL);
mir_free(tszData);
mir_free(szData);
if (hXml == NULL)
return;
int childcount = 0;
- HXML node = xi.getChild(hXml, childcount);
+ HXML node = xmlGetChild(hXml, childcount);
while (node) {
- LPCTSTR szNodeName = xi.getName(node);
+ LPCTSTR szNodeName = xmlGetName(node);
if (!mir_tstrcmpi(szNodeName, _T("rss")) || !mir_tstrcmpi(szNodeName, _T("rdf"))) {
- HXML chan = xi.getChild(node, 0);
- for (int j = 0; j < xi.getChildCount(chan); j++) {
- HXML child = xi.getChild(chan, j);
- if (!mir_tstrcmpi(xi.getName(child), _T("image"))) {
- for (int x = 0; x < xi.getChildCount(child); x++) {
- HXML imageval = xi.getChild(child, x);
- if (!mir_tstrcmpi(xi.getName(imageval), _T("url"))) {
- LPCTSTR url = xi.getText(imageval);
+ HXML chan = xmlGetChild(node, 0);
+ for (int j = 0; j < xmlGetChildCount(chan); j++) {
+ HXML child = xmlGetChild(chan, j);
+ if (!mir_tstrcmpi(xmlGetName(child), _T("image"))) {
+ for (int x = 0; x < xmlGetChildCount(child); x++) {
+ HXML imageval = xmlGetChild(child, x);
+ if (!mir_tstrcmpi(xmlGetName(imageval), _T("url"))) {
+ LPCTSTR url = xmlGetText(imageval);
db_set_ts(hContact, MODULE, "ImageURL", url);
PROTO_AVATAR_INFORMATION ai = { 0 };
@@ -553,13 +551,13 @@ void CheckCurrentFeedAvatar(MCONTACT hContact)
}
}
else if (!mir_tstrcmpi(szNodeName, _T("feed"))) {
- for (int j = 0; j < xi.getChildCount(node); j++) {
- HXML child = xi.getChild(node, j);
- if (!mir_tstrcmpi(xi.getName(child), _T("icon"))) {
- for (int x = 0; x < xi.getChildCount(child); x++) {
- HXML imageval = xi.getChild(child, x);
- if (!mir_tstrcmpi(xi.getName(imageval), _T("url"))) {
- LPCTSTR url = xi.getText(imageval);
+ for (int j = 0; j < xmlGetChildCount(node); j++) {
+ HXML child = xmlGetChild(node, j);
+ if (!mir_tstrcmpi(xmlGetName(child), _T("icon"))) {
+ for (int x = 0; x < xmlGetChildCount(child); x++) {
+ HXML imageval = xmlGetChild(child, x);
+ if (!mir_tstrcmpi(xmlGetName(imageval), _T("url"))) {
+ LPCTSTR url = xmlGetText(imageval);
db_set_ts(hContact, MODULE, "ImageURL", url);
ptrT szNick(db_get_tsa(hContact, MODULE, "Nick"));
@@ -584,7 +582,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact)
}
}
}
- node = xi.getChild(hXml, ++childcount);
+ node = xmlGetChild(hXml, ++childcount);
}
- xi.destroyNode(hXml);
+ xmlDestroyNode(hXml);
}
diff --git a/plugins/NewsAggregator/Src/Common.h b/plugins/NewsAggregator/Src/Common.h
index 7a2c424978..6e84892346 100644
--- a/plugins/NewsAggregator/Src/Common.h
+++ b/plugins/NewsAggregator/Src/Common.h
@@ -88,58 +88,59 @@ void UpdateListAdd(MCONTACT hContact);
void UpdateThreadProc(LPVOID AvatarCheck);
void DestroyUpdateList(void);
-extern HANDLE hUpdateMutex;
-extern HGENMENU hService2[7];
-
-int NewsAggrInit(WPARAM wParam,LPARAM lParam);
-int OptInit(WPARAM wParam, LPARAM lParam);
-int NewsAggrPreShutdown(WPARAM wParam,LPARAM lParam);
-void NetlibInit();
-void NetlibUnInit();
-void InitMenu();
-void InitIcons();
-HICON LoadIconEx(const char* name, bool big);
-HANDLE GetIconHandle(const char* name);
-INT_PTR NewsAggrGetName(WPARAM wParam, LPARAM lParam);
-INT_PTR NewsAggrGetCaps(WPARAM wp, LPARAM lp);
-INT_PTR NewsAggrSetStatus(WPARAM wp, LPARAM /*lp*/);
-INT_PTR NewsAggrGetStatus(WPARAM/* wp*/, LPARAM/* lp*/);
-INT_PTR NewsAggrLoadIcon(WPARAM wParam, LPARAM lParam);
-INT_PTR NewsAggrGetInfo(WPARAM wParam, LPARAM lParam);
-INT_PTR NewsAggrGetAvatarInfo(WPARAM wParam, LPARAM lParam);
-INT_PTR NewsAggrRecvMessage(WPARAM wParam, LPARAM lParam);
-
-INT_PTR CheckAllFeeds(WPARAM wParam, LPARAM lParam);
-INT_PTR AddFeed(WPARAM wParam, LPARAM lParam);
-INT_PTR ChangeFeed(WPARAM wParam, LPARAM lParam);
-INT_PTR ImportFeeds(WPARAM wParam, LPARAM lParam);
-INT_PTR ExportFeeds(WPARAM wParam, LPARAM lParam);
-INT_PTR CheckFeed(WPARAM wParam, LPARAM lParam);
-INT_PTR EnableDisable(WPARAM wParam, LPARAM lParam);
-int OnToolbarLoaded(WPARAM wParam, LPARAM lParam);
-INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-void CALLBACK timerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
-void CALLBACK timerProc2(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
-
-bool IsMyContact(MCONTACT hContact);
-void GetNewsData(TCHAR *szUrl, char **szData, MCONTACT hContact, HWND hwndDlg);
-void CreateList(HWND hwndList);
-void UpdateList(HWND hwndList);
-void DeleteAllItems(HWND hwndList);
-time_t __stdcall DateToUnixTime(const TCHAR *stamp, bool FeedType);
-void CheckCurrentFeed(MCONTACT hContact);
-void CheckCurrentFeedAvatar(MCONTACT hContact);
-TCHAR* CheckFeed(TCHAR* tszURL, HWND hwndDlg);
-void UpdateMenu(bool State);
-int ImportFeedsDialog();
-LPCTSTR ClearText(CMString &value, const TCHAR *message);
-bool DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal);
-void CreateAuthString(char *auth, MCONTACT hContact, HWND hwndDlg);
-INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+extern HANDLE hUpdateMutex;
+extern HGENMENU hService2[7];
+
+int NewsAggrInit(WPARAM wParam,LPARAM lParam);
+int OptInit(WPARAM wParam, LPARAM lParam);
+int NewsAggrPreShutdown(WPARAM wParam,LPARAM lParam);
+void NetlibInit();
+void NetlibUnInit();
+void InitMenu();
+void InitIcons();
+HICON LoadIconEx(const char* name, bool big);
+HANDLE GetIconHandle(const char* name);
+
+INT_PTR NewsAggrGetName(WPARAM wParam, LPARAM lParam);
+INT_PTR NewsAggrGetCaps(WPARAM wp, LPARAM lp);
+INT_PTR NewsAggrSetStatus(WPARAM wp, LPARAM /*lp*/);
+INT_PTR NewsAggrGetStatus(WPARAM/* wp*/, LPARAM/* lp*/);
+INT_PTR NewsAggrLoadIcon(WPARAM wParam, LPARAM lParam);
+INT_PTR NewsAggrGetInfo(WPARAM wParam, LPARAM lParam);
+INT_PTR NewsAggrGetAvatarInfo(WPARAM wParam, LPARAM lParam);
+INT_PTR NewsAggrRecvMessage(WPARAM wParam, LPARAM lParam);
+
+INT_PTR CheckAllFeeds(WPARAM wParam, LPARAM lParam);
+INT_PTR AddFeed(WPARAM wParam, LPARAM lParam);
+INT_PTR ChangeFeed(WPARAM wParam, LPARAM lParam);
+INT_PTR ImportFeeds(WPARAM wParam, LPARAM lParam);
+INT_PTR ExportFeeds(WPARAM wParam, LPARAM lParam);
+INT_PTR CheckFeed(WPARAM wParam, LPARAM lParam);
+INT_PTR EnableDisable(WPARAM wParam, LPARAM lParam);
+int OnToolbarLoaded(WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+void CALLBACK timerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
+void CALLBACK timerProc2(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
+
+bool IsMyContact(MCONTACT hContact);
+void GetNewsData(TCHAR *szUrl, char **szData, MCONTACT hContact, HWND hwndDlg);
+void CreateList(HWND hwndList);
+void UpdateList(HWND hwndList);
+void DeleteAllItems(HWND hwndList);
+time_t __stdcall DateToUnixTime(const TCHAR *stamp, bool FeedType);
+void CheckCurrentFeed(MCONTACT hContact);
+void CheckCurrentFeedAvatar(MCONTACT hContact);
+LPCTSTR CheckFeed(TCHAR* tszURL, HWND hwndDlg);
+void UpdateMenu(bool State);
+int ImportFeedsDialog();
+LPCTSTR ClearText(CMString &value, const TCHAR *message);
+bool DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal);
+void CreateAuthString(char *auth, MCONTACT hContact, HWND hwndDlg);
+INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
MCONTACT GetContactByNick(const TCHAR *nick);
MCONTACT GetContactByURL(const TCHAR *url);
diff --git a/plugins/NewsAggregator/Src/ExportImport.cpp b/plugins/NewsAggregator/Src/ExportImport.cpp
index fe6e512c29..d62d9b6f39 100644
--- a/plugins/NewsAggregator/Src/ExportImport.cpp
+++ b/plugins/NewsAggregator/Src/ExportImport.cpp
@@ -43,45 +43,45 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
TCHAR FileName[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_IMPORTFILEPATH, FileName, _countof(FileName));
int bytesParsed = 0;
- HXML hXml = xi.parseFile(FileName, &bytesParsed, NULL);
+ HXML hXml = xmlParseFile(FileName, &bytesParsed, NULL);
if(hXml != NULL) {
HWND hwndList = (HWND)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
bool isTextUTF = false, isURLUTF = false, isSiteURLUTF = false, isGroupUTF = false;
- HXML node = xi.getChildByPath(hXml, _T("opml/body/outline"), 0);
+ HXML node = xmlGetChildByPath(hXml, _T("opml/body/outline"), 0);
if ( !node)
- node = xi.getChildByPath(hXml, _T("body/outline"), 0);
+ node = xmlGetChildByPath(hXml, _T("body/outline"), 0);
int count = (int)SendMessage(FeedsImportList, LB_GETCOUNT, 0, 0);
int DUPES = 0;
if (node) {
while (node) {
- int outlineAttr = xi.getAttrCount(node);
- int outlineChildsCount = xi.getChildCount(node);
- TCHAR *xmlUrl = (TCHAR *)xi.getAttrValue(node, _T("xmlUrl"));
+ int outlineAttr = xmlGetAttrCount(node);
+ int outlineChildsCount = xmlGetChildCount(node);
+ TCHAR *xmlUrl = (TCHAR *)xmlGetAttrValue(node, _T("xmlUrl"));
if (!xmlUrl && !outlineChildsCount) {
HXML tmpnode = node;
- node = xi.getNextNode(node);
+ node = xmlGetNextNode(node);
if ( !node) {
do {
node = tmpnode;
- node = xi.getParent(node);
+ node = xmlGetParent(node);
tmpnode = node;
- node = xi.getNextNode(node);
+ node = xmlGetNextNode(node);
if (node)
break;
- } while (mir_tstrcmpi(xi.getName(node), _T("body")));
+ } while (mir_tstrcmpi(xmlGetName(node), _T("body")));
}
}
else if (!xmlUrl && outlineChildsCount)
- node = xi.getFirstChild(node);
+ node = xmlGetFirstChild(node);
else if (xmlUrl) {
TCHAR *text = NULL, *url = NULL, *siteurl = NULL, *group = NULL;
BYTE NeedToImport = FALSE;
for (int i = 0; i < outlineAttr; i++) {
- if (!mir_tstrcmpi(xi.getAttrName(node, i), _T("text"))) {
- text = mir_utf8decodeT(_T2A(xi.getAttrValue(node, xi.getAttrName(node, i))));
+ if (!mir_tstrcmpi(xmlGetAttrName(node, i), _T("text"))) {
+ text = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
if (!text) {
isTextUTF = 0;
- text = (TCHAR *)xi.getAttrValue(node, xi.getAttrName(node, i));
+ text = (TCHAR *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
} else
isTextUTF = 1;
@@ -95,11 +95,11 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
}
continue;
}
- if (!mir_tstrcmpi(xi.getAttrName(node, i), _T("xmlUrl"))) {
- url = mir_utf8decodeT(_T2A(xi.getAttrValue(node, xi.getAttrName(node, i))));
+ if (!mir_tstrcmpi(xmlGetAttrName(node, i), _T("xmlUrl"))) {
+ url = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
if ( !url) {
isURLUTF = false;
- url = (TCHAR *)xi.getAttrValue(node, xi.getAttrName(node, i));
+ url = (TCHAR *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
} else
isURLUTF = true;
if (GetContactByURL(url) && NeedToImport) {
@@ -108,11 +108,11 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
}
continue;
}
- if (!mir_tstrcmpi(xi.getAttrName(node, i), _T("htmlUrl"))) {
- siteurl = mir_utf8decodeT(_T2A(xi.getAttrValue(node, xi.getAttrName(node, i))));
+ if (!mir_tstrcmpi(xmlGetAttrName(node, i), _T("htmlUrl"))) {
+ siteurl = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
if ( !siteurl) {
isSiteURLUTF = false;
- siteurl = (TCHAR *)xi.getAttrValue(node, xi.getAttrName(node, i));
+ siteurl = (TCHAR *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
} else
isSiteURLUTF = true;
continue;
@@ -122,21 +122,21 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
}
if (NeedToImport) {
- HXML parent = xi.getParent(node);
+ HXML parent = xmlGetParent(node);
TCHAR tmpgroup[1024];
- while (mir_tstrcmpi(xi.getName(parent), _T("body"))) {
- for (int i = 0; i < xi.getAttrCount(parent); i++) {
- if (!mir_tstrcmpi(xi.getAttrName(parent, i), _T("text"))) {
+ while (mir_tstrcmpi(xmlGetName(parent), _T("body"))) {
+ for (int i = 0; i < xmlGetAttrCount(parent); i++) {
+ if (!mir_tstrcmpi(xmlGetAttrName(parent, i), _T("text"))) {
if ( !group)
- group = (TCHAR *)xi.getAttrValue(parent, xi.getAttrName(parent, i));
+ group = (TCHAR *)xmlGetAttrValue(parent, xmlGetAttrName(parent, i));
else {
- mir_sntprintf(tmpgroup, _countof(tmpgroup), _T("%s\\%s"), xi.getAttrValue(parent, xi.getAttrName(parent, i)), group);
+ mir_sntprintf(tmpgroup, _countof(tmpgroup), _T("%s\\%s"), xmlGetAttrValue(parent, xmlGetAttrName(parent, i)), group);
group = tmpgroup;
}
break;
}
}
- parent = xi.getParent(parent);
+ parent = xmlGetParent(parent);
}
TCHAR *utfgroup = NULL;
@@ -187,22 +187,22 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
mir_free(siteurl);
HXML tmpnode = node;
- node = xi.getNextNode(node);
+ node = xmlGetNextNode(node);
if ( !node) {
do {
node = tmpnode;
- node = xi.getParent(node);
+ node = xmlGetParent(node);
tmpnode = node;
- node = xi.getNextNode(node);
+ node = xmlGetNextNode(node);
if (node)
break;
}
- while (mir_tstrcmpi(xi.getName(tmpnode), _T("body")));
+ while (mir_tstrcmpi(xmlGetName(tmpnode), _T("body")));
}
}
}
}
- xi.destroyNode(hXml);
+ xmlDestroyNode(hXml);
if (hwndList) {
DeleteAllItems(hwndList);
UpdateList(hwndList);
@@ -241,40 +241,40 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (GetOpenFileName(&ofn)) {
int bytesParsed = 0;
- HXML hXml = xi.parseFile(FileName, &bytesParsed, NULL);
+ HXML hXml = xmlParseFile(FileName, &bytesParsed, NULL);
if(hXml != NULL) {
- HXML node = xi.getChildByPath(hXml, _T("opml/body/outline"), 0);
+ HXML node = xmlGetChildByPath(hXml, _T("opml/body/outline"), 0);
if ( !node)
- node = xi.getChildByPath(hXml, _T("body/outline"), 0);
+ node = xmlGetChildByPath(hXml, _T("body/outline"), 0);
if (node) {
while (node) {
- int outlineAttr = xi.getAttrCount(node);
- int outlineChildsCount = xi.getChildCount(node);
- TCHAR *xmlUrl = (TCHAR *)xi.getAttrValue(node, _T("xmlUrl"));
+ int outlineAttr = xmlGetAttrCount(node);
+ int outlineChildsCount = xmlGetChildCount(node);
+ TCHAR *xmlUrl = (TCHAR *)xmlGetAttrValue(node, _T("xmlUrl"));
if (!xmlUrl && !outlineChildsCount) {
HXML tmpnode = node;
- node = xi.getNextNode(node);
+ node = xmlGetNextNode(node);
if ( !node) {
do {
node = tmpnode;
- node = xi.getParent(node);
+ node = xmlGetParent(node);
tmpnode = node;
- node = xi.getNextNode(node);
+ node = xmlGetNextNode(node);
if (node)
break;
- } while (mir_tstrcmpi(xi.getName(node), _T("body")));
+ } while (mir_tstrcmpi(xmlGetName(node), _T("body")));
}
}
else if (!xmlUrl && outlineChildsCount)
- node = xi.getFirstChild(node);
+ node = xmlGetFirstChild(node);
else if (xmlUrl) {
for (int i = 0; i < outlineAttr; i++) {
- if (!mir_tstrcmpi(xi.getAttrName(node, i), _T("text"))) {
- TCHAR *text = mir_utf8decodeT(_T2A(xi.getAttrValue(node, xi.getAttrName(node, i))));
+ if (!mir_tstrcmpi(xmlGetAttrName(node, i), _T("text"))) {
+ TCHAR *text = mir_utf8decodeT(_T2A(xmlGetAttrValue(node, xmlGetAttrName(node, i))));
bool isTextUTF;
if (!text) {
isTextUTF = false;
- text = (TCHAR *)xi.getAttrValue(node, xi.getAttrName(node, i));
+ text = (TCHAR *)xmlGetAttrValue(node, xmlGetAttrName(node, i));
} else
isTextUTF = true;
SendMessage(FeedsList, LB_ADDSTRING, 0, (LPARAM)text);
@@ -287,23 +287,23 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
HXML tmpnode = node;
- node = xi.getNextNode(node);
+ node = xmlGetNextNode(node);
if ( !node) {
do {
node = tmpnode;
- node = xi.getParent(node);
+ node = xmlGetParent(node);
tmpnode = node;
- node = xi.getNextNode(node);
+ node = xmlGetNextNode(node);
if (node)
break;
- } while (mir_tstrcmpi(xi.getName(tmpnode), _T("body")));
+ } while (mir_tstrcmpi(xmlGetName(tmpnode), _T("body")));
}
}
}
}
else
MessageBox(hwndDlg, TranslateT("Not valid import file."), TranslateT("Error"), MB_OK | MB_ICONERROR);
- xi.destroyNode(hXml);
+ xmlDestroyNode(hXml);
SetDlgItemText(hwndDlg, IDC_IMPORTFILEPATH, FileName);
}
else
@@ -503,11 +503,11 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
ofn.lpstrDefExt = _T("");
if (GetSaveFileName(&ofn)) {
- HXML hXml = xi.createNode(_T("opml"), NULL, FALSE);
- xi.addAttr(hXml, _T("version"), _T("1.0"));
- HXML header = xi.addChild(hXml, _T("head"), NULL);
- xi.addChild(header, _T("title"), _T("Miranda NG NewsAggregator plugin export"));
- header = xi.addChild(hXml, _T("body"), NULL);
+ HXML hXml = xmlCreateNode(_T("opml"), NULL, FALSE);
+ xmlAddAttr(hXml, _T("version"), _T("1.0"));
+ HXML header = xmlAddChild(hXml, _T("head"), NULL);
+ xmlAddChild(header, _T("title"), _T("Miranda NG NewsAggregator plugin export"));
+ header = xmlAddChild(hXml, _T("body"), NULL);
int count = (int)SendMessage(FeedsExportList, LB_GETCOUNT, 0, 0);
for (int i = 0; i < count; i++) {
@@ -526,34 +526,34 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
TCHAR *section = _tcstok(group, _T("\\"));
while (section != NULL)
{
- HXML existgroup = xi.getChildByAttrValue(header, _T("outline"), _T("title"), section);
+ HXML existgroup = xmlGetChildByAttrValue(header, _T("outline"), _T("title"), section);
if ( !existgroup)
{
- elem = xi.addChild(elem, _T("outline"), NULL);
- xi.addAttr(elem, _T("title"), section);
- xi.addAttr(elem, _T("text"), section);
+ elem = xmlAddChild(elem, _T("outline"), NULL);
+ xmlAddAttr(elem, _T("title"), section);
+ xmlAddAttr(elem, _T("text"), section);
} else {
elem = existgroup;
}
section = _tcstok(NULL, _T("\\"));
}
- elem = xi.addChild(elem, _T("outline"), NULL);
+ elem = xmlAddChild(elem, _T("outline"), NULL);
}
else
- elem = xi.addChild(elem, _T("outline"), NULL);
- xi.addAttr(elem, _T("text"), title);
- xi.addAttr(elem, _T("title"), title);
- xi.addAttr(elem, _T("type"), _T("rss"));
- xi.addAttr(elem, _T("xmlUrl"), url);
- xi.addAttr(elem, _T("htmlUrl"), siteurl);
+ elem = xmlAddChild(elem, _T("outline"), NULL);
+ xmlAddAttr(elem, _T("text"), title);
+ xmlAddAttr(elem, _T("title"), title);
+ xmlAddAttr(elem, _T("type"), _T("rss"));
+ xmlAddAttr(elem, _T("xmlUrl"), url);
+ xmlAddAttr(elem, _T("htmlUrl"), siteurl);
mir_free(title);
mir_free(url);
mir_free(siteurl);
mir_free(group);
}
- xi.toFile(hXml, FileName, 1);
- xi.destroyNode(hXml);
+ xmlToFile(hXml, FileName, 1);
+ xmlDestroyNode(hXml);
}
}
diff --git a/plugins/NewsAggregator/Src/NewsAggregator.cpp b/plugins/NewsAggregator/Src/NewsAggregator.cpp
index fc40b58c16..279a69ea5a 100644
--- a/plugins/NewsAggregator/Src/NewsAggregator.cpp
+++ b/plugins/NewsAggregator/Src/NewsAggregator.cpp
@@ -25,7 +25,6 @@ int hLangpack;
HANDLE hPrebuildMenuHook = NULL;
HWND hAddFeedDlg;
MWindowList hChangeFeedDlgList = NULL;
-XML_API xi = {0};
TCHAR tszRoot[MAX_PATH] = {0};
HANDLE hUpdateMutex;
@@ -57,7 +56,6 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfoEx);
- mir_getXI(&xi);
// Add options hook
HookEvent(ME_OPT_INITIALISE, OptInit);
diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp
index 66006753ff..7dac335b90 100644
--- a/plugins/NewsAggregator/Src/Options.cpp
+++ b/plugins/NewsAggregator/Src/Options.cpp
@@ -114,7 +114,8 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
case IDC_DISCOVERY:
EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE);
SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait..."));
- TCHAR tszURL[MAX_PATH] = { 0 }, *tszTitle = NULL;
+ TCHAR tszURL[MAX_PATH] = { 0 };
+ const TCHAR *tszTitle = NULL;
if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_tstrcmp(tszURL, _T("http://")) != 0)
tszTitle = CheckFeed(tszURL, hwndDlg);
else
@@ -281,7 +282,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_tstrcmp(tszURL, _T("http://")) != 0) {
EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE);
SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait..."));
- TCHAR *tszTitle = CheckFeed(tszURL, hwndDlg);
+ const TCHAR *tszTitle = CheckFeed(tszURL, hwndDlg);
SetDlgItemText(hwndDlg, IDC_FEEDTITLE, tszTitle);
EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), TRUE);
SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Check Feed"));
@@ -436,7 +437,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (GetDlgItemText(hwndDlg, IDC_FEEDURL, tszURL, _countof(tszURL)) || mir_tstrcmp(tszURL, _T("http://")) != 0) {
EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), FALSE);
SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Wait..."));
- TCHAR *tszTitle = CheckFeed(tszURL, hwndDlg);
+ const TCHAR *tszTitle = CheckFeed(tszURL, hwndDlg);
SetDlgItemText(hwndDlg, IDC_FEEDTITLE, tszTitle);
EnableWindow(GetDlgItem(hwndDlg, IDC_DISCOVERY), TRUE);
SetDlgItemText(hwndDlg, IDC_DISCOVERY, TranslateT("Check Feed"));
diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp
index fce900c8dc..925b22dc34 100644
--- a/plugins/PasteIt/src/PasteIt.cpp
+++ b/plugins/PasteIt/src/PasteIt.cpp
@@ -53,7 +53,6 @@ PLUGININFOEX pluginInfo = {
static IconItem icon = { LPGEN("Paste It"), "PasteIt_main", IDI_MENU };
-XML_API xi = { 0 };
int hLangpack = 0;
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
@@ -402,7 +401,6 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
extern "C" int __declspec(dllexport) Load(void)
{
- mir_getXI(&xi);
mir_getLP(&pluginInfo);
Icon_Register(hInst, LPGEN("Paste It"), &icon, 1);
diff --git a/plugins/PasteIt/src/PasteToWeb2.cpp b/plugins/PasteIt/src/PasteToWeb2.cpp
index e14db0a966..36e168a922 100644
--- a/plugins/PasteIt/src/PasteToWeb2.cpp
+++ b/plugins/PasteIt/src/PasteToWeb2.cpp
@@ -105,22 +105,22 @@ void PasteToWeb2::SendToServer(std::wstring str, std::wstring fileName, std::wst
error = TranslateT("Error during sending text to web page");
if (resCont != NULL)
{
- HXML hXml = xi.parseString(resCont, NULL, _T("methodResponse"));
+ HXML hXml = xmlParseString(resCont, NULL, _T("methodResponse"));
if (hXml != NULL)
{
- HXML node = xi.getChildByPath(hXml, _T("params/param/value/array/data/value/int"), 0);
- if (node != NULL && !mir_tstrcmp(xi.getText(node), _T("1")))
+ HXML node = xmlGetChildByPath(hXml, _T("params/param/value/array/data/value/int"), 0);
+ if (node != NULL && !mir_tstrcmp(xmlGetText(node), _T("1")))
{
- node = xi.getChildByPath(hXml, _T("params/param/value/array/data"), 0);
+ node = xmlGetChildByPath(hXml, _T("params/param/value/array/data"), 0);
if (node != NULL)
{
- node = xi.getNthChild(node, _T("value"), 1);
+ node = xmlGetNthChild(node, _T("value"), 1);
if (node != NULL)
{
- node = xi.getChildByPath(node, _T("string"), 0);
+ node = xmlGetChildByPath(node, _T("string"), 0);
if (node != NULL)
{
- char* s = mir_t2a_cp(xi.getText(node), CP_ACP);
+ char* s = mir_t2a_cp(xmlGetText(node), CP_ACP);
mir_strncpy(szFileLink, s, _countof(szFileLink));
mir_free(s);
error = NULL;
@@ -128,7 +128,7 @@ void PasteToWeb2::SendToServer(std::wstring str, std::wstring fileName, std::wst
}
}
}
- xi.destroyNode(hXml);
+ xmlDestroyNode(hXml);
}
mir_free(resCont);
}
@@ -145,22 +145,22 @@ std::list<PasteFormat> PasteToWeb2::GetFormats()
wchar_t* resCont = SendToWeb("http://wklej.to/api/", headers, content);
if (resCont != NULL)
{
- HXML hXml = xi.parseString(resCont, NULL, _T("methodResponse"));
+ HXML hXml = xmlParseString(resCont, NULL, _T("methodResponse"));
if (hXml != NULL)
{
- HXML node = xi.getChildByPath(hXml, _T("params/param/value/array/data/value/int"), 0);
- if (node != NULL && !mir_tstrcmp(xi.getText(node), _T("1")))
+ HXML node = xmlGetChildByPath(hXml, _T("params/param/value/array/data/value/int"), 0);
+ if (node != NULL && !mir_tstrcmp(xmlGetText(node), _T("1")))
{
- node = xi.getChildByPath(hXml, _T("params/param/value/array/data"), 0);
+ node = xmlGetChildByPath(hXml, _T("params/param/value/array/data"), 0);
if (node != NULL)
{
- node = xi.getNthChild(node, _T("value"), 1);
+ node = xmlGetNthChild(node, _T("value"), 1);
if (node != NULL)
{
- node = xi.getChildByPath(node, _T("string"), 0);
+ node = xmlGetChildByPath(node, _T("string"), 0);
if (node != NULL)
{
- std::wstring str = xi.getText(node);
+ std::wstring str = xmlGetText(node);
std::wstring::size_type pos = str.find(L'\n');
if (pos < str.length())
{
@@ -225,7 +225,7 @@ std::list<PasteFormat> PasteToWeb2::GetFormats()
}
}
}
- xi.destroyNode(hXml);
+ xmlDestroyNode(hXml);
}
mir_free(resCont);
}
diff --git a/plugins/Quotes/src/ModuleInfo.cpp b/plugins/Quotes/src/ModuleInfo.cpp
index 65d2593482..2b137a6258 100644
--- a/plugins/Quotes/src/ModuleInfo.cpp
+++ b/plugins/Quotes/src/ModuleInfo.cpp
@@ -60,10 +60,7 @@ CModuleInfo::TXMLEnginePtr CModuleInfo::GetXMLEnginePtr()
{
mir_cslock lck(g_lmParsers);
if (!g_pXMLEngine)
- {
- mir_getXI(&xi);
g_pXMLEngine = TXMLEnginePtr(new CXMLEngineMI);
- }
}
return g_pXMLEngine;
diff --git a/plugins/Quotes/src/XMLEngineMI.cpp b/plugins/Quotes/src/XMLEngineMI.cpp
index 871cc2ed4f..6cd1ca5863 100644
--- a/plugins/Quotes/src/XMLEngineMI.cpp
+++ b/plugins/Quotes/src/XMLEngineMI.cpp
@@ -1,7 +1,5 @@
#include "StdAfx.h"
-XML_API xi;
-
namespace
{
class CXMLNodeMI : public IXMLNode,
@@ -20,18 +18,18 @@ namespace
{
if (m_bDestroy)
{
- xi.destroyNode(m_hXML);
+ xmlDestroyNode(m_hXML);
}
}
virtual size_t GetChildCount()const
{
- return xi.getChildCount(m_hXML);
+ return xmlGetChildCount(m_hXML);
}
virtual TXMLNodePtr GetChildNode(size_t nIndex)const
{
- HXML h = xi.getChild(m_hXML, (int)nIndex);
+ HXML h = xmlGetChild(m_hXML, (int)nIndex);
if (h)
{
return TXMLNodePtr(new CXMLNodeMI(h));
@@ -45,7 +43,7 @@ namespace
virtual tstring GetText()const
{
tstring sResult;
- LPCTSTR psz = xi.getText(m_hXML);
+ LPCTSTR psz = xmlGetText(m_hXML);
if (psz)
{
sResult = psz;
@@ -57,7 +55,7 @@ namespace
virtual tstring GetName()const
{
tstring sResult;
- LPCTSTR psz = xi.getName(m_hXML);
+ LPCTSTR psz = xmlGetName(m_hXML);
if (psz)
{
sResult = psz;
@@ -71,7 +69,7 @@ namespace
CXMLNodeMI* pXML = dynamic_cast<CXMLNodeMI*>(pNode.get());
if (pXML)
{
- xi.addChild2(pXML->m_hXML, m_hXML);
+ xmlAddChild2(pXML->m_hXML, m_hXML);
pXML->m_bDestroy = false;
return true;
}
@@ -83,13 +81,13 @@ namespace
virtual bool AddAttribute(const tstring& rsName, const tstring& rsValue)
{
- xi.addAttr(m_hXML, rsName.c_str(), rsValue.c_str());
+ xmlAddAttr(m_hXML, rsName.c_str(), rsValue.c_str());
return true;
}
virtual tstring GetAttributeValue(const tstring& rsAttrName)
{
- LPCTSTR pszValue = xi.getAttrValue(m_hXML, rsAttrName.c_str());
+ LPCTSTR pszValue = xmlGetAttrValue(m_hXML, rsAttrName.c_str());
return ((NULL != pszValue) ? tstring(pszValue) : tstring());
}
@@ -98,7 +96,7 @@ namespace
// struct safe_string
// {
// safe_string(LPTSTR p):m_p(p){}
- // ~safe_string(){xi.freeMem(m_p);}
+ // ~safe_string(){xmlFree(m_p);}
//
// LPTSTR m_p;
// };
@@ -112,7 +110,7 @@ namespace
// };
- safe_string<TCHAR> ss(xi.toString(m_hXML, NULL));
+ safe_string<TCHAR> ss(xmlToString(m_hXML, NULL));
if (ss.m_p)
o << (char*)T2Utf(ss.m_p);
}
@@ -160,7 +158,7 @@ IXMLNode::TXMLNodePtr CXMLEngineMI::LoadFile(const tstring& rsFileName)const
mir_safe_string<TCHAR> ss(mir_utf8decodeT(pBuffer));
if (ss.m_p)
{
- HXML h = xi.parseString(ss.m_p, &nLen, NULL);
+ HXML h = xmlParseString(ss.m_p, &nLen, NULL);
if (h)
{
pResult = IXMLNode::TXMLNodePtr(new CXMLNodeMI(h, true));
@@ -179,7 +177,7 @@ namespace
IXMLNode::TXMLNodePtr create_node(const tstring& rsName, const tstring& rsText, bool bIsDecl)
{
IXMLNode::TXMLNodePtr pResult;
- HXML h = xi.createNode(rsName.c_str(), rsText.c_str(), bIsDecl);
+ HXML h = xmlCreateNode(rsName.c_str(), rsText.c_str(), bIsDecl);
if (h)
{
pResult = IXMLNode::TXMLNodePtr(new CXMLNodeMI(h, true));
diff --git a/plugins/Watrack/lastfm/i_last_api.inc b/plugins/Watrack/lastfm/i_last_api.inc
index e67b8854af..a5be3d3111 100644
--- a/plugins/Watrack/lastfm/i_last_api.inc
+++ b/plugins/Watrack/lastfm/i_last_api.inc
@@ -223,9 +223,6 @@ begin
result:=dst;
end;
-var
- xmlparser:TXML_API_W;
-
function FixInfo(Info:pWideChar):pWideChar;
var
pc,ppc:pWideChar;
@@ -301,77 +298,73 @@ begin
begin
UTF8ToWide(res,pcw);
mFreeMem(res);
- xmlparser.cbSize:={XML_API_SIZEOF_V1;//}SizeOf(TXML_API_W);
- CallService(MS_SYSTEM_GET_XI,0,lparam(@xmlparser));
- with xmlparser do
- begin
- i:=StrLenW(pcw)*SizeOf(WideChar);
- root:=parseString(pcw,@i,nil);
-
- actnode:=getChild(getChild(root,0),0); // "artist"
-
- if data.artist=nil then
- StrDupW(data.artist,getText(GetNthChild(actnode,'name',0)));
-
- i:=0;
- repeat
- node:=GetNthChild(actnode,'image',i);
- if node=0 then break;
- if StrCmpW(GetAttrValue(node,'size'),'medium')=0 then
- begin
- WideToUTF8(GetText(node),data.image);
- break;
- end;
- inc(i);
- until false;
-
- // bio
- p:=StrPosW(pcw,'<content><![CDATA[');
- if p<>nil then
+
+ i:=StrLenW(pcw)*SizeOf(WideChar);
+ root:=xmlParseString(pcw,@i,nil);
+
+ actnode:=xmlGetChild(xmlGetChild(root,0),0); // "artist"
+
+ if data.artist=nil then
+ StrDupW(data.artist,xmlGetText(xmlGetNthChild(actnode,'name',0)));
+
+ i:=0;
+ repeat
+ node:=xmlGetNthChild(actnode,'image',i);
+ if node=0 then break;
+ if StrCmpW(xmlGetAttrValue(node,'size'),'medium')=0 then
begin
- inc(p,18);
- pp:=StrPosW(p,']]');
- if pp<> nil then pp^:=#0;
- data.info:=FixInfo(p);
+ WideToUTF8(xmlGetText(node),data.image);
+ break;
end;
+ inc(i);
+ until false;
- // similar
- i:=0;
- pcw:=pWideChar(@request); pcw^:=#0;
- node:=GetNthChild(actnode,'similar',0);
- repeat
- nnode:=GetNthChild(GetNthChild(node,'artist',i),'name',0);
- if nnode=0 then break;
- if pcw<>@request then
- begin
- pcw^:=','; inc(pcw);
- pcw^:=' '; inc(pcw);
- end;
- pcw:=StrCopyEW(pcw,GetText(nnode));
- inc(i);
- until false;
- pcw:=#0;
- StrDupW(data.similar,pWideChar(@request));
-
- // tags
- i:=0;
- pcw:=pWideChar(@request); pcw^:=#0;
- node:=GetNthChild(actnode,'tags',0);
- repeat
- nnode:=GetNthChild(GetNthChild(node,'tag',i),'name',0);
- if nnode=0 then break;
- if pcw<>@request then
- begin
- pcw^:=','; inc(pcw);
- pcw^:=' '; inc(pcw);
- end;
- pcw:=StrCopyEW(pcw,GetText(nnode));
- inc(i);
- until false;
- pcw:=#0;
- StrDupW(data.tags,pWideChar(@request));
- DestroyNode(root);
+ // bio
+ p:=StrPosW(pcw,'<content><![CDATA[');
+ if p<>nil then
+ begin
+ inc(p,18);
+ pp:=StrPosW(p,']]');
+ if pp<> nil then pp^:=#0;
+ data.info:=FixInfo(p);
end;
+
+ // similar
+ i:=0;
+ pcw:=pWideChar(@request); pcw^:=#0;
+ node:=xmlGetNthChild(actnode,'similar',0);
+ repeat
+ nnode:=xmlGetNthChild(xmlGetNthChild(node,'artist',i),'name',0);
+ if nnode=0 then break;
+ if pcw<>@request then
+ begin
+ pcw^:=','; inc(pcw);
+ pcw^:=' '; inc(pcw);
+ end;
+ pcw:=StrCopyEW(pcw,xmlGetText(nnode));
+ inc(i);
+ until false;
+ pcw:=#0;
+ StrDupW(data.similar,pWideChar(@request));
+
+ // tags
+ i:=0;
+ pcw:=pWideChar(@request); pcw^:=#0;
+ node:=xmlGetNthChild(actnode,'tags',0);
+ repeat
+ nnode:=xmlGetNthChild(xmlGetNthChild(node,'tag',i),'name',0);
+ if nnode=0 then break;
+ if pcw<>@request then
+ begin
+ pcw^:=','; inc(pcw);
+ pcw^:=' '; inc(pcw);
+ end;
+ pcw:=StrCopyEW(pcw,xmlGetText(nnode));
+ inc(i);
+ until false;
+ pcw:=#0;
+ StrDupW(data.tags,pWideChar(@request));
+ xmlDestroyNode(root);
end;
end;
@@ -424,62 +417,58 @@ begin
begin
UTF8ToWide(res,pcw);
mFreeMem(res);
- xmlparser.cbSize:={XML_API_SIZEOF_V1;//}SizeOf(TXML_API_W);
- CallService(MS_SYSTEM_GET_XI,0,lparam(@xmlparser));
- with xmlparser do
- begin
- i:=StrLenW(pcw)*SizeOf(WideChar);
- root:=parseString(pcw,@i,nil);
-
- actnode:=getChild(getChild(root,0),0); // "album"
-
- if data.album=nil then
- StrDupW(data.album,getText(GetNthChild(actnode,'name',0)));
- StrDupW(data.release,getText(GetNthChild(actnode,'releasedate',0)));
- if data.artist=nil then
- StrDupW(data.artist,getText(GetNthChild(actnode,'artist',0)));
-
- i:=0;
- repeat
- node:=GetNthChild(actnode,'image',i);
- if node=0 then break;
- if StrCmpW(GetAttrValue(node,'size'),'medium')=0 then
- begin
- WideToUTF8(GetText(node),data.image);
- break;
- end;
- inc(i);
- until false;
-
- p:=StrPosW(pcw,'<content><![CDATA[');
- if p<>nil then
+
+ i:=StrLenW(pcw)*SizeOf(WideChar);
+ root:=xmlParseString(pcw,@i,nil);
+
+ actnode:=xmlGetChild(xmlGetChild(root,0),0); // "album"
+
+ if data.album=nil then
+ StrDupW(data.album,xmlGetText(xmlGetNthChild(actnode,'name',0)));
+ StrDupW(data.release,xmlGetText(xmlGetNthChild(actnode,'releasedate',0)));
+ if data.artist=nil then
+ StrDupW(data.artist,xmlGetText(xmlGetNthChild(actnode,'artist',0)));
+
+ i:=0;
+ repeat
+ node:=xmlGetNthChild(actnode,'image',i);
+ if node=0 then break;
+ if StrCmpW(xmlGetAttrValue(node,'size'),'medium')=0 then
begin
- inc(p,18);
- pp:=StrPosW(p,']]');
- if pp<> nil then pp^:=#0;
- data.info:=FixInfo(p);
+ WideToUTF8(xmlGetText(node),data.image);
+ break;
end;
+ inc(i);
+ until false;
- // tags
- i:=0;
- pcw:=pWideChar(@request); pcw^:=#0;
- node:=GetNthChild(actnode,'toptags',0);
- repeat
- nnode:=GetNthChild(GetNthChild(node,'tag',i),'name',0);
- if nnode=0 then break;
- if pcw<>@request then
- begin
- pcw^:=','; inc(pcw);
- pcw^:=' '; inc(pcw);
- end;
- pcw:=StrCopyEW(pcw,GetText(nnode));
- inc(i);
- until false;
- pcw:=#0;
- StrDupW(data.tags,pWideChar(@request));
-
- DestroyNode(root);
+ p:=StrPosW(pcw,'<content><![CDATA[');
+ if p<>nil then
+ begin
+ inc(p,18);
+ pp:=StrPosW(p,']]');
+ if pp<> nil then pp^:=#0;
+ data.info:=FixInfo(p);
end;
+
+ // tags
+ i:=0;
+ pcw:=pWideChar(@request); pcw^:=#0;
+ node:=xmlGetNthChild(actnode,'toptags',0);
+ repeat
+ nnode:=xmlGetNthChild(xmlGetNthChild(node,'tag',i),'name',0);
+ if nnode=0 then break;
+ if pcw<>@request then
+ begin
+ pcw^:=','; inc(pcw);
+ pcw^:=' '; inc(pcw);
+ end;
+ pcw:=StrCopyEW(pcw,xmlGetText(nnode));
+ inc(i);
+ until false;
+ pcw:=#0;
+ StrDupW(data.tags,pWideChar(@request));
+
+ xmlDestroyNode(root);
end;
end;
@@ -532,66 +521,62 @@ begin
begin
UTF8ToWide(res,pcw);
mFreeMem(res);
- xmlparser.cbSize:={XML_API_SIZEOF_V1;//}SizeOf(TXML_API_W);
- CallService(MS_SYSTEM_GET_XI,0,lparam(@xmlparser));
- with xmlparser do
- begin
- i:=StrLenW(pcw)*SizeOf(WideChar);
- root:=parseString(pcw,@i,nil);
-
- actnode:=getChild(getChild(root,0),0); // "track"
- if data.artist=nil then
- StrDupW(data.artist,getText(GetNthChild(GetNthChild(actnode,'artist',0),'name',0)));
-
- anode:=GetNthChild(actnode,'album',i);
-
- if data.album=nil then
- StrDupW(data.album,getText(GetNthChild(anode,'title',0)));
-
- data.trknum:=StrToInt(getAttrValue(anode,'position'));
- if data.title=nil then
- StrDupW(data.title,getText(GetNthChild(actnode,'name',0)));
-
- i:=0;
- repeat
- node:=GetNthChild(anode,'image',i);
- if node=0 then break;
- if StrCmpW(GetAttrValue(node,'size'),'medium')=0 then
- begin
- WideToUTF8(GetText(node),data.image);
- break;
- end;
- inc(i);
- until false;
-
- p:=StrPosW(pcw,'<content><![CDATA[');
- if p<>nil then
+
+ i:=StrLenW(pcw)*SizeOf(WideChar);
+ root:=xmlParseString(pcw,@i,nil);
+
+ actnode:=xmlGetChild(xmlGetChild(root,0),0); // "track"
+ if data.artist=nil then
+ StrDupW(data.artist,xmlGetText(xmlGetNthChild(xmlGetNthChild(actnode,'artist',0),'name',0)));
+
+ anode:=xmlGetNthChild(actnode,'album',i);
+
+ if data.album=nil then
+ StrDupW(data.album,xmlGetText(xmlGetNthChild(anode,'title',0)));
+
+ data.trknum:=StrToInt(xmlGetAttrValue(anode,'position'));
+ if data.title=nil then
+ StrDupW(data.title,xmlGetText(xmlGetNthChild(actnode,'name',0)));
+
+ i:=0;
+ repeat
+ node:=xmlGetNthChild(anode,'image',i);
+ if node=0 then break;
+ if StrCmpW(xmlGetAttrValue(node,'size'),'medium')=0 then
begin
- inc(p,18);
- pp:=StrPosW(p,']]');
- if pp<> nil then pp^:=#0;
- data.info:=FixInfo(p);
+ WideToUTF8(xmlGetText(node),data.image);
+ break;
end;
+ inc(i);
+ until false;
- // tags
- i:=0;
- pcw:=pWideChar(@request); pcw^:=#0;
- node:=GetNthChild(actnode,'toptags',0);
- repeat
- anode:=GetNthChild(GetNthChild(node,'tag',i),'name',0);
- if anode=0 then break;
- if pcw<>@request then
- begin
- pcw^:=','; inc(pcw);
- pcw^:=' '; inc(pcw);
- end;
- pcw:=StrCopyEW(pcw,GetText(anode));
- inc(i);
- until false;
- pcw:=#0;
- StrDupW(data.tags,pWideChar(@request));
-
- DestroyNode(root);
+ p:=StrPosW(pcw,'<content><![CDATA[');
+ if p<>nil then
+ begin
+ inc(p,18);
+ pp:=StrPosW(p,']]');
+ if pp<> nil then pp^:=#0;
+ data.info:=FixInfo(p);
end;
+
+ // tags
+ i:=0;
+ pcw:=pWideChar(@request); pcw^:=#0;
+ node:=xmlGetNthChild(actnode,'toptags',0);
+ repeat
+ anode:=xmlGetNthChild(xmlGetNthChild(node,'tag',i),'name',0);
+ if anode=0 then break;
+ if pcw<>@request then
+ begin
+ pcw^:=','; inc(pcw);
+ pcw^:=' '; inc(pcw);
+ end;
+ pcw:=StrCopyEW(pcw,xmlGetText(anode));
+ inc(i);
+ until false;
+ pcw:=#0;
+ StrDupW(data.tags,pWideChar(@request));
+
+ xmlDestroyNode(root);
end;
end;
diff --git a/protocols/GTalkExt/src/GTalkExt.cpp b/protocols/GTalkExt/src/GTalkExt.cpp
index c2ad8dcaaf..6d0eb2f435 100644
--- a/protocols/GTalkExt/src/GTalkExt.cpp
+++ b/protocols/GTalkExt/src/GTalkExt.cpp
@@ -79,7 +79,6 @@ LRESULT CALLBACK WndProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
- mir_getXI(&xi);
WNDCLASS cls = { 0 };
cls.lpfnWndProc = WndProc;
diff --git a/protocols/GTalkExt/src/handlers.cpp b/protocols/GTalkExt/src/handlers.cpp
index 0c835729f6..1f5c6f02e6 100644
--- a/protocols/GTalkExt/src/handlers.cpp
+++ b/protocols/GTalkExt/src/handlers.cpp
@@ -31,8 +31,6 @@
LRESULT CALLBACK PopupProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam);
-XML_API xi = { 0 };
-
#include <tchar.h>
GoogleTalkAcc* isGoogle(LPARAM lParam)
@@ -79,17 +77,17 @@ BOOL InternalListHandler(HXML node, LPCTSTR jid, LPCTSTR mailboxUrl)
ULONGLONG maxTid = 0;
LPCTSTR sMaxTid = NULL;
int unreadCount = 0;
- for (int i = 0; i < xi.getChildCount(node); i++) {
- LPCTSTR sTid = xi.getAttrValue(xi.getChild(node, i), ATTRNAME_TID);
+ for (int i = 0; i < xmlGetChildCount(node); i++) {
+ LPCTSTR sTid = xmlGetAttrValue(xmlGetChild(node, i), ATTRNAME_TID);
ULONGLONG tid = _tcstoui64(sTid, NULL, 10);
if (tid > maxTid) {
maxTid = tid;
sMaxTid = sTid;
}
- HXML senders = xi.getChildByPath(xi.getChild(node, i), NODENAME_SENDERS, FALSE);
- for (int j = 0; j < xi.getChildCount(senders); j++)
- if (xi.getAttrValue(xi.getChild(senders, j), ATTRNAME_UNREAD)) {
+ HXML senders = xmlGetChildByPath(xmlGetChild(node, i), NODENAME_SENDERS, FALSE);
+ for (int j = 0; j < xmlGetChildCount(senders); j++)
+ if (xmlGetAttrValue(xmlGetChild(senders, j), ATTRNAME_UNREAD)) {
unreadCount++;
break;
}
@@ -100,7 +98,7 @@ BOOL InternalListHandler(HXML node, LPCTSTR jid, LPCTSTR mailboxUrl)
return FALSE;
if (!unreadCount) {
- SetupPseudocontact(jid, xi.getAttrValue(node, ATTRNAME_TOTAL_MATCHED), acc);
+ SetupPseudocontact(jid, xmlGetAttrValue(node, ATTRNAME_TOTAL_MATCHED), acc);
return TRUE;
}
@@ -108,29 +106,29 @@ BOOL InternalListHandler(HXML node, LPCTSTR jid, LPCTSTR mailboxUrl)
if (unreadCount > 5) {
CloseNotifications(acc, mailboxUrl, jid, FALSE);
- UnreadMailNotification(acc, jid, mailboxUrl, xi.getAttrValue(node, ATTRNAME_TOTAL_MATCHED));
+ UnreadMailNotification(acc, jid, mailboxUrl, xmlGetAttrValue(node, ATTRNAME_TOTAL_MATCHED));
}
else
- for (int i = 0; i < xi.getChildCount(node); i++) {
+ for (int i = 0; i < xmlGetChildCount(node); i++) {
MAIL_THREAD_NOTIFICATION mtn = { 0 };
- HXML thread = xi.getChild(node, i);
+ HXML thread = xmlGetChild(node, i);
- mtn.subj = xi.getText(xi.getChildByPath(thread, NODENAME_SUBJECT, FALSE));
- mtn.snip = xi.getText(xi.getChildByPath(thread, NODENAME_SNIPPET, FALSE));
+ mtn.subj = xmlGetText(xmlGetChildByPath(thread, NODENAME_SUBJECT, FALSE));
+ mtn.snip = xmlGetText(xmlGetChildByPath(thread, NODENAME_SNIPPET, FALSE));
int threadUnreadCount = 0;
- HXML senders = xi.getChildByPath(thread, NODENAME_SENDERS, FALSE);
- for (int j = 0; threadUnreadCount < SENDER_COUNT && j < xi.getChildCount(senders); j++) {
- HXML sender = xi.getChild(senders, j);
- if (xi.getAttrValue(sender, ATTRNAME_UNREAD)) {
- mtn.senders[threadUnreadCount].name = xi.getAttrValue(sender, ATTRNAME_NAME);
- mtn.senders[threadUnreadCount].addr = xi.getAttrValue(sender, ATTRNAME_ADDRESS);
+ HXML senders = xmlGetChildByPath(thread, NODENAME_SENDERS, FALSE);
+ for (int j = 0; threadUnreadCount < SENDER_COUNT && j < xmlGetChildCount(senders); j++) {
+ HXML sender = xmlGetChild(senders, j);
+ if (xmlGetAttrValue(sender, ATTRNAME_UNREAD)) {
+ mtn.senders[threadUnreadCount].name = xmlGetAttrValue(sender, ATTRNAME_NAME);
+ mtn.senders[threadUnreadCount].addr = xmlGetAttrValue(sender, ATTRNAME_ADDRESS);
threadUnreadCount++;
}
}
- LPCTSTR url = xi.getAttrValue(thread, ATTRNAME_URL);
- LPCTSTR tid = xi.getAttrValue(thread, ATTRNAME_TID);
+ LPCTSTR url = xmlGetAttrValue(thread, ATTRNAME_URL);
+ LPCTSTR tid = xmlGetAttrValue(thread, ATTRNAME_TID);
if (ReadCheckbox(0, IDC_STANDARDVIEW, settings))
FormatMessageUrl(MESSAGE_URL_FORMAT_STANDARD, (LPTSTR)url, mailboxUrl, tid);
@@ -140,10 +138,10 @@ BOOL InternalListHandler(HXML node, LPCTSTR jid, LPCTSTR mailboxUrl)
MakeUrlHex((LPTSTR)url, tid);
CloseNotifications(acc, url, jid, i);
- UnreadThreadNotification(acc, jid, url, xi.getAttrValue(node, ATTRNAME_TOTAL_MATCHED), &mtn);
+ UnreadThreadNotification(acc, jid, url, xmlGetAttrValue(node, ATTRNAME_TOTAL_MATCHED), &mtn);
}
- LPCTSTR time = xi.getAttrValue(node, ATTRNAME_RESULT_TIME);
+ LPCTSTR time = xmlGetAttrValue(node, ATTRNAME_RESULT_TIME);
WriteJidSetting(LAST_MAIL_TIME_FROM_JID, jid, time);
WriteJidSetting(LAST_THREAD_ID_FROM_JID, jid, sMaxTid);
return TRUE;
@@ -151,17 +149,17 @@ BOOL InternalListHandler(HXML node, LPCTSTR jid, LPCTSTR mailboxUrl)
BOOL MailListHandler(IJabberInterface *ji, HXML node, void *)
{
- LPCTSTR jidWithRes = xi.getAttrValue(node, ATTRNAME_TO);
+ LPCTSTR jidWithRes = xmlGetAttrValue(node, ATTRNAME_TO);
__try {
- if (!node || mir_tstrcmp(xi.getAttrValue(node, ATTRNAME_TYPE), IQTYPE_RESULT)) return TRUE;
+ if (!node || mir_tstrcmp(xmlGetAttrValue(node, ATTRNAME_TYPE), IQTYPE_RESULT)) return TRUE;
- LPCTSTR jid = xi.getAttrValue(node, ATTRNAME_FROM);
+ LPCTSTR jid = xmlGetAttrValue(node, ATTRNAME_FROM);
assert(jid);
- node = xi.getChildByPath(node, NODENAME_MAILBOX, FALSE);
+ node = xmlGetChildByPath(node, NODENAME_MAILBOX, FALSE);
if (!node) return TRUE; // empty list
- LPCTSTR url = xi.getAttrValue(node, ATTRNAME_URL);
+ LPCTSTR url = xmlGetAttrValue(node, ATTRNAME_URL);
return InternalListHandler(node, jid, url);
}
@@ -176,13 +174,13 @@ BOOL MailListHandler(IJabberInterface *ji, HXML node, void *)
void RequestMail(LPCTSTR jidWithRes, IJabberInterface *ji)
{
HXML child = NULL;
- HXML node = xi.createNode(NODENAME_IQ, NULL, FALSE);
- xi.addAttr(node, ATTRNAME_TYPE, IQTYPE_GET);
- xi.addAttr(node, ATTRNAME_FROM, jidWithRes);
+ HXML node = xmlCreateNode(NODENAME_IQ, NULL, FALSE);
+ xmlAddAttr(node, ATTRNAME_TYPE, IQTYPE_GET);
+ xmlAddAttr(node, ATTRNAME_FROM, jidWithRes);
UINT uID = ji->SerialNext();
ptrT jid(ExtractJid(jidWithRes));
- xi.addAttr(node, ATTRNAME_TO, jid);
+ xmlAddAttr(node, ATTRNAME_TO, jid);
ptrT
lastMailTime(ReadJidSetting(LAST_MAIL_TIME_FROM_JID, jid)),
@@ -190,18 +188,18 @@ void RequestMail(LPCTSTR jidWithRes, IJabberInterface *ji)
TCHAR id[30];
mir_sntprintf(id, JABBER_IQID_FORMAT, uID);
- xi.addAttr(node, ATTRNAME_ID, id);
+ xmlAddAttr(node, ATTRNAME_ID, id);
- child = xi.addChild(node, NODENAME_QUERY, NULL);
- xi.addAttr(child, ATTRNAME_XMLNS, NOTIFY_FEATURE_XMLNS);
- xi.addAttr(child, ATTRNAME_NEWER_THAN_TIME, lastMailTime);
- xi.addAttr(child, ATTRNAME_NEWER_THAN_TID, lastThreadId);
+ child = xmlAddChild(node, NODENAME_QUERY, NULL);
+ xmlAddAttr(child, ATTRNAME_XMLNS, NOTIFY_FEATURE_XMLNS);
+ xmlAddAttr(child, ATTRNAME_NEWER_THAN_TIME, lastMailTime);
+ xmlAddAttr(child, ATTRNAME_NEWER_THAN_TID, lastThreadId);
if (ji->SendXmlNode(node))
ji->AddTemporaryIqHandler(MailListHandler, JABBER_IQ_TYPE_RESULT, (int)uID, NULL, RESPONSE_TIMEOUT);
- if (child) xi.destroyNode(child);
- if (node) xi.destroyNode(node);
+ if (child) xmlDestroyNode(child);
+ if (node) xmlDestroyNode(node);
}
BOOL TimerHandler(IJabberInterface *ji, HXML, void *pUserData)
@@ -213,70 +211,70 @@ BOOL TimerHandler(IJabberInterface *ji, HXML, void *pUserData)
BOOL NewMailHandler(IJabberInterface *ji, HXML node, void *)
{
- HXML response = xi.createNode(NODENAME_IQ, NULL, FALSE);
+ HXML response = xmlCreateNode(NODENAME_IQ, NULL, FALSE);
__try {
- xi.addAttr(response, ATTRNAME_TYPE, IQTYPE_RESULT);
+ xmlAddAttr(response, ATTRNAME_TYPE, IQTYPE_RESULT);
- LPCTSTR attr = xi.getAttrValue(node, ATTRNAME_ID);
+ LPCTSTR attr = xmlGetAttrValue(node, ATTRNAME_ID);
if (!attr) return FALSE;
- xi.addAttr(response, ATTRNAME_ID, attr);
+ xmlAddAttr(response, ATTRNAME_ID, attr);
- attr = xi.getAttrValue(node, ATTRNAME_FROM);
- if (attr) xi.addAttr(response, ATTRNAME_TO, attr);
+ attr = xmlGetAttrValue(node, ATTRNAME_FROM);
+ if (attr) xmlAddAttr(response, ATTRNAME_TO, attr);
- attr = xi.getAttrValue(node, ATTRNAME_TO);
+ attr = xmlGetAttrValue(node, ATTRNAME_TO);
if (!attr) return FALSE;
- xi.addAttr(response, ATTRNAME_FROM, attr);
+ xmlAddAttr(response, ATTRNAME_FROM, attr);
int bytesSent = ji->SendXmlNode(response);
RequestMail(attr, ji);
return bytesSent > 0;
}
__finally {
- xi.destroyNode(response);
+ xmlDestroyNode(response);
}
}
void SetNotificationSetting(LPCTSTR jidWithResource, IJabberInterface *ji)
{
HXML child = NULL;
- HXML node = xi.createNode(NODENAME_IQ, NULL, FALSE);
+ HXML node = xmlCreateNode(NODENAME_IQ, NULL, FALSE);
- xi.addAttr(node, ATTRNAME_TYPE, IQTYPE_SET);
- xi.addAttr(node, ATTRNAME_FROM, jidWithResource);
+ xmlAddAttr(node, ATTRNAME_TYPE, IQTYPE_SET);
+ xmlAddAttr(node, ATTRNAME_FROM, jidWithResource);
ptrT jid(ExtractJid(jidWithResource));
- xi.addAttr(node, ATTRNAME_TO, jid);
+ xmlAddAttr(node, ATTRNAME_TO, jid);
TCHAR id[30];
mir_sntprintf(id, JABBER_IQID_FORMAT, ji->SerialNext());
- xi.addAttr(node, ATTRNAME_ID, id);
+ xmlAddAttr(node, ATTRNAME_ID, id);
- child = xi.addChild(node, NODENAME_USERSETTING, NULL);
- xi.addAttr(child, ATTRNAME_XMLNS, SETTING_FEATURE_XMLNS);
+ child = xmlAddChild(node, NODENAME_USERSETTING, NULL);
+ xmlAddAttr(child, ATTRNAME_XMLNS, SETTING_FEATURE_XMLNS);
- child = xi.addChild(child, NODENAME_MAILNOTIFICATIONS, NULL);
- xi.addAttr(child, ATTRNAME_VALUE, SETTING_TRUE);
+ child = xmlAddChild(child, NODENAME_MAILNOTIFICATIONS, NULL);
+ xmlAddAttr(child, ATTRNAME_VALUE, SETTING_TRUE);
ji->SendXmlNode(node);
- if (child) xi.destroyNode(child);
- if (node) xi.destroyNode(node);
+ if (child) xmlDestroyNode(child);
+ if (node) xmlDestroyNode(node);
}
BOOL DiscoverHandler(IJabberInterface *ji, HXML node, void *)
{
if (!node) return FALSE;
- LPCTSTR jid = xi.getAttrValue(node, ATTRNAME_TO);
+ LPCTSTR jid = xmlGetAttrValue(node, ATTRNAME_TO);
assert(jid);
- node = xi.getChildByAttrValue(node, NODENAME_QUERY, ATTRNAME_XMLNS, DISCOVERY_XMLNS);
+ node = xmlGetChildByAttrValue(node, NODENAME_QUERY, ATTRNAME_XMLNS, DISCOVERY_XMLNS);
- HXML child = xi.getChildByAttrValue(node, NODENAME_FEATURE, ATTRNAME_VAR, SETTING_FEATURE_XMLNS);
+ HXML child = xmlGetChildByAttrValue(node, NODENAME_FEATURE, ATTRNAME_VAR, SETTING_FEATURE_XMLNS);
if (child)
SetNotificationSetting(jid, ji);
- child = xi.getChildByAttrValue(node, NODENAME_FEATURE, ATTRNAME_VAR, NOTIFY_FEATURE_XMLNS);
+ child = xmlGetChildByAttrValue(node, NODENAME_FEATURE, ATTRNAME_VAR, NOTIFY_FEATURE_XMLNS);
if (child) {
ji->AddIqHandler(NewMailHandler, JABBER_IQ_TYPE_SET, NOTIFY_FEATURE_XMLNS, NODENAME_NEW_MAIL);
RequestMail(jid, ji);
@@ -291,22 +289,22 @@ BOOL SendHandler(IJabberInterface *ji, HXML node, void *)
if (gta == NULL)
return FALSE;
- HXML queryNode = xi.getChildByAttrValue(node, NODENAME_QUERY, ATTRNAME_XMLNS, DISCOVERY_XMLNS);
+ HXML queryNode = xmlGetChildByAttrValue(node, NODENAME_QUERY, ATTRNAME_XMLNS, DISCOVERY_XMLNS);
if (queryNode) {
- LPCTSTR ptszId = xi.getAttrValue(node, ATTRNAME_ID);
+ LPCTSTR ptszId = xmlGetAttrValue(node, ATTRNAME_ID);
if (ptszId)
ji->AddTemporaryIqHandler(DiscoverHandler, JABBER_IQ_TYPE_RESULT, _ttoi(ptszId + 4), NULL, RESPONSE_TIMEOUT, 500);
}
- if (!mir_tstrcmp(xi.getName(node), _T("presence")) && xi.getAttrValue(node, ATTRNAME_TO) == 0) {
+ if (!mir_tstrcmp(xmlGetName(node), _T("presence")) && xmlGetAttrValue(node, ATTRNAME_TO) == 0) {
if (!gta->m_bGoogleSharedStatus)
return FALSE;
- HXML statNode = xi.getChildByPath(node, _T("status"), 0);
- HXML showNode = xi.getChildByPath(node, _T("show"), 0);
+ HXML statNode = xmlGetChildByPath(node, _T("status"), 0);
+ HXML showNode = xmlGetChildByPath(node, _T("show"), 0);
if (statNode) {
- LPCTSTR status = xi.getText(showNode);
- LPCTSTR msg = xi.getText(statNode);
+ LPCTSTR status = xmlGetText(showNode);
+ LPCTSTR msg = xmlGetText(statNode);
gta->SendIqGoogleSharedStatus(status, msg);
}
}
@@ -321,7 +319,7 @@ BOOL OnIqResultGoogleSharedStatus(IJabberInterface *ji, HXML node, void *)
{
GoogleTalkAcc *gta = isGoogle(LPARAM(ji));
if (gta != NULL) {
- gta->m_bGoogleSharedStatus = mir_tstrcmp(xi.getAttrValue(node, ATTRNAME_TYPE), IQTYPE_RESULT) == 0;
+ gta->m_bGoogleSharedStatus = mir_tstrcmp(xmlGetAttrValue(node, ATTRNAME_TYPE), IQTYPE_RESULT) == 0;
gta->m_bGoogleSharedStatusLock = FALSE;
}
return FALSE;
@@ -332,18 +330,18 @@ BOOL OnIqSetGoogleSharedStatus(IJabberInterface *ji, HXML iqNode, void *)
GoogleTalkAcc *gta = isGoogle(LPARAM(ji));
if (gta == NULL)
return FALSE;
- if (mir_tstrcmp(xi.getAttrValue(iqNode, ATTRNAME_TYPE), IQTYPE_SET))
+ if (mir_tstrcmp(xmlGetAttrValue(iqNode, ATTRNAME_TYPE), IQTYPE_SET))
return FALSE;
if (gta->m_bGoogleSharedStatusLock)
return TRUE;
int status;
- HXML query = xi.getChildByPath(iqNode, NODENAME_QUERY, 0);
- HXML node = xi.getChildByPath(query, _T("invisible"), 0);
- if (0 == mir_tstrcmpi(_T("true"), xi.getAttrValue(node, _T("value"))))
+ HXML query = xmlGetChildByPath(iqNode, NODENAME_QUERY, 0);
+ HXML node = xmlGetChildByPath(query, _T("invisible"), 0);
+ if (0 == mir_tstrcmpi(_T("true"), xmlGetAttrValue(node, _T("value"))))
status = ID_STATUS_INVISIBLE;
else {
- LPCTSTR txt = xi.getText(xi.getChildByPath(query, _T("show"), 0));
+ LPCTSTR txt = xmlGetText(xmlGetChildByPath(query, _T("show"), 0));
if (txt && 0 == mir_tstrcmpi(_T("dnd"), txt))
status = ID_STATUS_DND;
else if (gta->m_pa->ppro->m_iStatus == ID_STATUS_DND || gta->m_pa->ppro->m_iStatus == ID_STATUS_INVISIBLE)
@@ -360,29 +358,29 @@ BOOL OnIqSetGoogleSharedStatus(IJabberInterface *ji, HXML iqNode, void *)
void GoogleTalkAcc::SendIqGoogleSharedStatus(LPCTSTR status, LPCTSTR msg)
{
- HXML iq = xi.createNode(NODENAME_IQ, NULL, FALSE);
- xi.addAttr(iq, ATTRNAME_TYPE, IQTYPE_GET);
+ HXML iq = xmlCreateNode(NODENAME_IQ, NULL, FALSE);
+ xmlAddAttr(iq, ATTRNAME_TYPE, IQTYPE_GET);
- HXML query = xi.addChild(iq, NODENAME_QUERY, NULL);
- xi.addChild(query, ATTRNAME_XMLNS, JABBER_FEAT_GTALK_SHARED_STATUS);
- xi.addAttrInt(query, _T("version"), 2);
+ HXML query = xmlAddChild(iq, NODENAME_QUERY, NULL);
+ xmlAddChild(query, ATTRNAME_XMLNS, JABBER_FEAT_GTALK_SHARED_STATUS);
+ xmlAddAttrInt(query, _T("version"), 2);
- xi.addChild(query, _T("status"), msg);
+ xmlAddChild(query, _T("status"), msg);
if (!mir_tstrcmp(status, _T("invisible"))) {
- xi.addChild(query, _T("show"), _T("default"));
- xi.addAttr(xi.addChild(query, _T("invisible"), 0), _T("value"), _T("true"));
+ xmlAddChild(query, _T("show"), _T("default"));
+ xmlAddAttr(xmlAddChild(query, _T("invisible"), 0), _T("value"), _T("true"));
}
else {
if (!mir_tstrcmp(status, _T("dnd")))
- xi.addChild(query, _T("show"), _T("dnd"));
+ xmlAddChild(query, _T("show"), _T("dnd"));
else
- xi.addChild(query, _T("show"), _T("default"));
+ xmlAddChild(query, _T("show"), _T("default"));
- xi.addAttr(xi.addChild(query, _T("invisible"), 0), _T("value"), _T("false"));
+ xmlAddAttr(xmlAddChild(query, _T("invisible"), 0), _T("value"), _T("false"));
}
m_bGoogleSharedStatusLock = TRUE;
m_japi->SendXmlNode(iq);
- xi.destroyNode(iq);
+ xmlDestroyNode(iq);
}
int OnServerDiscoInfo(WPARAM wParam, LPARAM lParam)
@@ -395,14 +393,14 @@ int OnServerDiscoInfo(WPARAM wParam, LPARAM lParam)
JABBER_DISCO_FIELD *fld = (JABBER_DISCO_FIELD*)wParam;
if (!mir_tstrcmp(fld->category, _T("server")) && !mir_tstrcmp(fld->type, _T("im")) && !mir_tstrcmp(fld->name, _T("Google Talk"))) {
- HXML iq = xi.createNode(NODENAME_IQ, NULL, FALSE);
- xi.addAttr(iq, ATTRNAME_TYPE, IQTYPE_GET);
+ HXML iq = xmlCreateNode(NODENAME_IQ, NULL, FALSE);
+ xmlAddAttr(iq, ATTRNAME_TYPE, IQTYPE_GET);
- HXML query = xi.addChild(iq, NODENAME_QUERY, NULL);
- xi.addChild(query, ATTRNAME_XMLNS, JABBER_FEAT_GTALK_SHARED_STATUS);
- xi.addAttrInt(query, _T("version"), 2);
+ HXML query = xmlAddChild(iq, NODENAME_QUERY, NULL);
+ xmlAddChild(query, ATTRNAME_XMLNS, JABBER_FEAT_GTALK_SHARED_STATUS);
+ xmlAddAttrInt(query, _T("version"), 2);
gta->m_japi->SendXmlNode(iq);
- xi.destroyNode(iq);
+ xmlDestroyNode(iq);
}
return 0;
}
diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp
index f054c5e0e9..c666bd591b 100644
--- a/protocols/Gadu-Gadu/src/avatar.cpp
+++ b/protocols/Gadu-Gadu/src/avatar.cpp
@@ -84,20 +84,20 @@ bool GGPROTO::getAvatarFileInfo(uin_t uin, char **avatarurl, char **avatarts)
//if this url returned xml data (before and after 11.2013 gg convention)
TCHAR *xmlAction = mir_a2t(resp->pData);
- HXML hXml = xi.parseString(xmlAction, 0, _T("result"));
+ HXML hXml = xmlParseString(xmlAction, 0, _T("result"));
if (hXml != NULL) {
- HXML node = xi.getChildByPath(hXml, _T("users/user/avatars/avatar"), 0);
- const TCHAR *blank = (node != NULL) ? xi.getAttrValue(node, _T("blank")) : NULL;
+ HXML node = xmlGetChildByPath(hXml, _T("users/user/avatars/avatar"), 0);
+ const TCHAR *blank = (node != NULL) ? xmlGetAttrValue(node, _T("blank")) : NULL;
if (blank != NULL && mir_tstrcmp(blank, _T("1"))) {
- node = xi.getChildByPath(hXml, _T("users/user/avatars/avatar/timestamp"), 0);
- *avatarts = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
- node = xi.getChildByPath(hXml, _T("users/user/avatars/avatar/bigavatar"), 0); //new gg convention
+ node = xmlGetChildByPath(hXml, _T("users/user/avatars/avatar/timestamp"), 0);
+ *avatarts = node != NULL ? mir_t2a(xmlGetText(node)) : NULL;
+ node = xmlGetChildByPath(hXml, _T("users/user/avatars/avatar/bigavatar"), 0); //new gg convention
if (node == NULL){
- node = xi.getChildByPath(hXml, _T("users/user/avatars/avatar/originBigAvatar"), 0); //old gg convention
+ node = xmlGetChildByPath(hXml, _T("users/user/avatars/avatar/originBigAvatar"), 0); //old gg convention
}
- *avatarurl = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
+ *avatarurl = node != NULL ? mir_t2a(xmlGetText(node)) : NULL;
}
- xi.destroyNode(hXml);
+ xmlDestroyNode(hXml);
}
mir_free(xmlAction);
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp
index dca61cd88b..efe7df5d0a 100644
--- a/protocols/Gadu-Gadu/src/core.cpp
+++ b/protocols/Gadu-Gadu/src/core.cpp
@@ -1153,7 +1153,7 @@ retry:
xmlAction = mir_a2t(e->event.xml_action.data);
tag = mir_a2t("events");
- hXml = xi.parseString(xmlAction, 0, tag);
+ hXml = xmlParseString(xmlAction, 0, tag);
if (hXml != NULL) {
HXML node;
@@ -1161,13 +1161,13 @@ retry:
mir_free(tag);
tag = mir_a2t("event/type");
- node = xi.getChildByPath(hXml, tag, 0);
- type = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
+ node = xmlGetChildByPath(hXml, tag, 0);
+ type = node != NULL ? mir_t2a(xmlGetText(node)) : NULL;
mir_free(tag);
tag = mir_a2t("event/sender");
- node = xi.getChildByPath(hXml, tag, 0);
- sender = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
+ node = xmlGetChildByPath(hXml, tag, 0);
+ sender = node != NULL ? mir_t2a(xmlGetText(node)) : NULL;
debugLogA("mainthread() (%x): XML Action type: %s.", this, type != NULL ? type : "unknown");
// Avatar change notify
if (type != NULL && !mir_strcmp(type, "28")) {
@@ -1176,7 +1176,7 @@ retry:
}
mir_free(type);
mir_free(sender);
- xi.destroyNode(hXml);
+ xmlDestroyNode(hXml);
}
mir_free(tag);
mir_free(xmlAction);
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp
index 5d673107c0..b5f5c81243 100644
--- a/protocols/Gadu-Gadu/src/gg.cpp
+++ b/protocols/Gadu-Gadu/src/gg.cpp
@@ -41,7 +41,6 @@ PLUGININFOEX pluginInfo = {
// Other variables
HINSTANCE hInstance;
-XML_API xi;
SSL_API si;
CLIST_INTERFACE *pcli;
int hLangpack;
@@ -328,7 +327,6 @@ static int gg_proto_uninit(PROTO_INTERFACE *proto)
extern "C" int __declspec(dllexport) Load(void)
{
- mir_getXI(&xi);
mir_getLP(&pluginInfo);
mir_getCLI();
diff --git a/protocols/Gadu-Gadu/src/oauth.cpp b/protocols/Gadu-Gadu/src/oauth.cpp
index 773b3ade25..19c74c0acf 100644
--- a/protocols/Gadu-Gadu/src/oauth.cpp
+++ b/protocols/Gadu-Gadu/src/oauth.cpp
@@ -316,15 +316,15 @@ int GGPROTO::oauth_receivetoken()
nlc = resp->nlc;
if (resp->resultCode == 200 && resp->dataLength > 0 && resp->pData) {
TCHAR *xmlAction = mir_a2t(resp->pData);
- HXML hXml = xi.parseString(xmlAction, 0, _T("result"));
+ HXML hXml = xmlParseString(xmlAction, 0, _T("result"));
if (hXml != NULL) {
- HXML node = xi.getChildByPath(hXml, _T("oauth_token"), 0);
- token = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
+ HXML node = xmlGetChildByPath(hXml, _T("oauth_token"), 0);
+ token = node != NULL ? mir_t2a(xmlGetText(node)) : NULL;
- node = xi.getChildByPath(hXml, _T("oauth_token_secret"), 0);
- token_secret = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
+ node = xmlGetChildByPath(hXml, _T("oauth_token_secret"), 0);
+ token_secret = node != NULL ? mir_t2a(xmlGetText(node)) : NULL;
- xi.destroyNode(hXml);
+ xmlDestroyNode(hXml);
}
mir_free(xmlAction);
}
@@ -385,15 +385,15 @@ int GGPROTO::oauth_receivetoken()
if (resp) {
if (resp->resultCode == 200 && resp->dataLength > 0 && resp->pData) {
TCHAR *xmlAction = mir_a2t(resp->pData);
- HXML hXml = xi.parseString(xmlAction, 0, _T("result"));
+ HXML hXml = xmlParseString(xmlAction, 0, _T("result"));
if (hXml != NULL) {
- HXML node = xi.getChildByPath(hXml, _T("oauth_token"), 0);
- token = mir_t2a(xi.getText(node));
+ HXML node = xmlGetChildByPath(hXml, _T("oauth_token"), 0);
+ token = mir_t2a(xmlGetText(node));
- node = xi.getChildByPath(hXml, _T("oauth_token_secret"), 0);
- token_secret = mir_t2a(xi.getText(node));
+ node = xmlGetChildByPath(hXml, _T("oauth_token_secret"), 0);
+ token_secret = mir_t2a(xmlGetText(node));
- xi.destroyNode(hXml);
+ xmlDestroyNode(hXml);
}
mir_free(xmlAction);
}
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp
index a78d4512ef..10e21ebd18 100644
--- a/protocols/JabberG/src/jabber.cpp
+++ b/protocols/JabberG/src/jabber.cpp
@@ -58,8 +58,6 @@ PLUGININFOEX pluginInfo = {
{0x144e80a2, 0xd198, 0x428b, {0xac, 0xbe, 0x9d, 0x55, 0xda, 0xcc, 0x7f, 0xde}} // {144E80A2-D198-428b-ACBE-9D55DACC7FDE}
};
-XML_API xi;
-
CLIST_INTERFACE* pcli;
FI_INTERFACE *FIP = NULL;
@@ -182,7 +180,6 @@ static int jabberProtoUninit(CJabberProto *ppro)
extern "C" int __declspec(dllexport) Load()
{
// set the memory, lists & utf8 managers
- mir_getXI(&xi);
mir_getLP(&pluginInfo);
mir_getCLI();
diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp
index 348f7cabf5..043fd4a265 100644
--- a/protocols/JabberG/src/jabber_adhoc.cpp
+++ b/protocols/JabberG/src/jabber_adhoc.cpp
@@ -98,12 +98,12 @@ static void JabberAdHoc_RefreshFrameScroll(HWND hwndDlg, JabberAdHocData * dat)
void CJabberProto::OnIqResult_ListOfCommands(HXML iqNode, CJabberIqInfo *pInfo)
{
- SendMessage(GetWindowFromIq(pInfo), JAHM_COMMANDLISTRESULT, 0, (LPARAM)xi.copyNode(iqNode));
+ SendMessage(GetWindowFromIq(pInfo), JAHM_COMMANDLISTRESULT, 0, (LPARAM)xmlCopyNode(iqNode));
}
void CJabberProto::OnIqResult_CommandExecution(HXML iqNode, CJabberIqInfo *pInfo)
{
- SendMessage(GetWindowFromIq(pInfo), JAHM_PROCESSRESULT, (WPARAM)xi.copyNode(iqNode), 0);
+ SendMessage(GetWindowFromIq(pInfo), JAHM_PROCESSRESULT, (WPARAM)xmlCopyNode(iqNode), 0);
}
void CJabberProto::AdHoc_RequestListOfCommands(TCHAR * szResponder, HWND hwndDlg)
@@ -115,16 +115,16 @@ void CJabberProto::AdHoc_RequestListOfCommands(TCHAR * szResponder, HWND hwndDlg
int CJabberProto::AdHoc_ExecuteCommand(HWND hwndDlg, TCHAR*, JabberAdHocData* dat)
{
for (int i = 1;; i++) {
- HXML itemNode = xmlGetNthChild(dat->CommandsNode, _T("item"), i);
+ HXML itemNode = XmlGetNthChild(dat->CommandsNode, _T("item"), i);
if (!itemNode)
break;
if (BST_UNCHECKED == IsDlgButtonChecked(GetDlgItem(hwndDlg, IDC_FRAME), i))
continue;
- const TCHAR *node = xmlGetAttrValue(itemNode, _T("node"));
+ const TCHAR *node = XmlGetAttrValue(itemNode, _T("node"));
if (node) {
- const TCHAR *jid2 = xmlGetAttrValue(itemNode, _T("jid"));
+ const TCHAR *jid2 = XmlGetAttrValue(itemNode, _T("jid"));
m_ThreadInfo->send(
XmlNodeIq(AddIQ(&CJabberProto::OnIqResult_CommandExecution, JABBER_IQ_TYPE_SET, jid2, 0, -1, hwndDlg))
<< XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), node) << XATTR(_T("action"), _T("execute")));
@@ -134,7 +134,7 @@ int CJabberProto::AdHoc_ExecuteCommand(HWND hwndDlg, TCHAR*, JabberAdHocData* da
}
}
- xi.destroyNode(dat->CommandsNode); dat->CommandsNode = NULL;
+ xmlDestroyNode(dat->CommandsNode); dat->CommandsNode = NULL;
return TRUE;
}
@@ -142,17 +142,17 @@ int CJabberProto::AdHoc_ExecuteCommand(HWND hwndDlg, TCHAR*, JabberAdHocData* da
int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, JabberAdHocData* dat)
{
int nodeIdx = 0;
- const TCHAR * type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR * type = XmlGetAttrValue(iqNode, _T("type"));
if (!type || !mir_tstrcmp(type, _T("error"))) {
// error occurred here
TCHAR buff[255];
const TCHAR *code = NULL;
const TCHAR *description = NULL;
- HXML errorNode = xmlGetChild(iqNode, "error");
+ HXML errorNode = XmlGetChild(iqNode, "error");
if (errorNode) {
- code = xmlGetAttrValue(errorNode, _T("code"));
- description = xmlGetText(errorNode);
+ code = XmlGetAttrValue(errorNode, _T("code"));
+ description = XmlGetText(errorNode);
}
mir_sntprintf(buff, TranslateT("Error %s %s"), (code) ? code : _T(""), (description) ? description : _T(""));
JabberFormSetInstruction(hwndDlg, buff);
@@ -163,24 +163,24 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, Jabbe
dat->CurrentHeight = 0;
dat->curPos = 0;
SetScrollPos(GetDlgItem(hwndDlg, IDC_VSCROLL), SB_CTL, 0, FALSE);
- HXML queryNode = xmlGetChild(iqNode, "query");
+ HXML queryNode = XmlGetChild(iqNode, "query");
if (queryNode) {
- const TCHAR *xmlns = xmlGetAttrValue(queryNode, _T("xmlns"));
- const TCHAR *node = xmlGetAttrValue(queryNode, _T("node"));
+ const TCHAR *xmlns = XmlGetAttrValue(queryNode, _T("xmlns"));
+ const TCHAR *node = XmlGetAttrValue(queryNode, _T("node"));
if (xmlns && node && !mir_tstrcmp(xmlns, JABBER_FEAT_DISCO_ITEMS) && !mir_tstrcmp(node, JABBER_FEAT_COMMANDS))
validResponse = TRUE;
}
- if (queryNode && xmlGetChild(queryNode, 0) && validResponse) {
- dat->CommandsNode = xi.copyNode(queryNode);
+ if (queryNode && XmlGetChild(queryNode, 0) && validResponse) {
+ dat->CommandsNode = xmlCopyNode(queryNode);
int ypos = 20;
for (nodeIdx = 1;; nodeIdx++) {
- HXML itemNode = xmlGetNthChild(queryNode, _T("item"), nodeIdx);
+ HXML itemNode = XmlGetNthChild(queryNode, _T("item"), nodeIdx);
if (!itemNode)
break;
- const TCHAR *name = xmlGetAttrValue(itemNode, _T("name"));
- if (!name) name = xmlGetAttrValue(itemNode, _T("node"));
+ const TCHAR *name = XmlGetAttrValue(itemNode, _T("name"));
+ if (!name) name = XmlGetAttrValue(itemNode, _T("node"));
ypos = AdHoc_AddCommandRadio(GetDlgItem(hwndDlg, IDC_FRAME), TranslateTS(name), nodeIdx, ypos, (nodeIdx == 1) ? 1 : 0);
dat->CurrentHeight = ypos;
}
@@ -209,27 +209,27 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA
if (workNode == NULL)
return TRUE;
- dat->AdHocNode = xi.copyNode(workNode);
+ dat->AdHocNode = xmlCopyNode(workNode);
const TCHAR *type;
- if ((type = xmlGetAttrValue(workNode, _T("type"))) == NULL) return TRUE;
+ if ((type = XmlGetAttrValue(workNode, _T("type"))) == NULL) return TRUE;
if (!mir_tstrcmp(type, _T("result"))) {
// wParam = <iq/> node from responder as a result of command execution
HXML commandNode, xNode;
- if ((commandNode = xmlGetChild(dat->AdHocNode, _T("command"))) == NULL)
+ if ((commandNode = XmlGetChild(dat->AdHocNode, _T("command"))) == NULL)
return TRUE;
- const TCHAR *status = xmlGetAttrValue(commandNode, _T("status"));
+ const TCHAR *status = XmlGetAttrValue(commandNode, _T("status"));
if (!status)
status = _T("completed");
- if ((xNode = xmlGetChild(commandNode, "x"))) {
+ if ((xNode = XmlGetChild(commandNode, "x"))) {
// use jabber:x:data form
HWND hFrame = GetDlgItem(hwndDlg, IDC_FRAME);
ShowWindow(GetDlgItem(hwndDlg, IDC_FRAME_TEXT), SW_HIDE);
- if (LPCTSTR ptszInstr = xmlGetText(xmlGetChild(xNode, "instructions")))
+ if (LPCTSTR ptszInstr = XmlGetText(XmlGetChild(xNode, "instructions")))
JabberFormSetInstruction(hwndDlg, ptszInstr);
- else if (LPCTSTR ptszTitle = xmlGetText(xmlGetChild(xNode, "title")))
+ else if (LPCTSTR ptszTitle = XmlGetText(XmlGetChild(xNode, "title")))
JabberFormSetInstruction(hwndDlg, ptszTitle);
else
JabberFormSetInstruction(hwndDlg, TranslateTS(status));
@@ -241,16 +241,16 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA
int toHide[] = { IDC_FRAME_TEXT, IDC_FRAME, IDC_VSCROLL, 0 };
sttShowControls(hwndDlg, FALSE, toHide);
- LPCTSTR noteText = xmlGetText(xmlGetChild(commandNode, "note"));
+ LPCTSTR noteText = XmlGetText(XmlGetChild(commandNode, "note"));
JabberFormSetInstruction(hwndDlg, noteText ? noteText : TranslateTS(status));
}
// check actions
- HXML actionsNode = xmlGetChild(commandNode, "actions");
+ HXML actionsNode = XmlGetChild(commandNode, "actions");
if (actionsNode != NULL) {
- ShowDlgItem(hwndDlg, IDC_PREV, (xmlGetChild(actionsNode, "prev") != NULL) ? SW_SHOW : SW_HIDE);
- ShowDlgItem(hwndDlg, IDC_NEXT, (xmlGetChild(actionsNode, "next") != NULL) ? SW_SHOW : SW_HIDE);
- ShowDlgItem(hwndDlg, IDC_COMPLETE, (xmlGetChild(actionsNode, "complete") != NULL) ? SW_SHOW : SW_HIDE);
+ ShowDlgItem(hwndDlg, IDC_PREV, (XmlGetChild(actionsNode, "prev") != NULL) ? SW_SHOW : SW_HIDE);
+ ShowDlgItem(hwndDlg, IDC_NEXT, (XmlGetChild(actionsNode, "next") != NULL) ? SW_SHOW : SW_HIDE);
+ ShowDlgItem(hwndDlg, IDC_COMPLETE, (XmlGetChild(actionsNode, "complete") != NULL) ? SW_SHOW : SW_HIDE);
ShowDlgItem(hwndDlg, IDC_SUBMIT, SW_HIDE);
int toEnable[] = { IDC_PREV, IDC_NEXT, IDC_COMPLETE, 0 };
@@ -277,10 +277,10 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA
const TCHAR *code=NULL;
const TCHAR *description=NULL;
TCHAR buff[255];
- HXML errorNode = xmlGetChild(workNode , "error");
+ HXML errorNode = XmlGetChild(workNode , "error");
if (errorNode) {
- code = xmlGetAttrValue(errorNode, _T("code"));
- description = xmlGetText(errorNode);
+ code = XmlGetAttrValue(errorNode, _T("code"));
+ description = XmlGetText(errorNode);
}
mir_sntprintf(buff, TranslateT("Error %s %s"), code ? code : _T(""), description ? description : _T(""));
JabberFormSetInstruction(hwndDlg,buff);
@@ -291,29 +291,29 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA
int CJabberProto::AdHoc_SubmitCommandForm(HWND hwndDlg, JabberAdHocData* dat, TCHAR* action)
{
- HXML commandNode = xmlGetChild(dat->AdHocNode, "command");
- HXML xNode = xmlGetChild(commandNode, "x");
+ HXML commandNode = XmlGetChild(dat->AdHocNode, "command");
+ HXML xNode = XmlGetChild(commandNode, "x");
HXML dataNode = JabberFormGetData(GetDlgItem(hwndDlg, IDC_FRAME), xNode);
- LPCTSTR jid2 = xmlGetAttrValue(dat->AdHocNode, _T("from"));
+ LPCTSTR jid2 = XmlGetAttrValue(dat->AdHocNode, _T("from"));
XmlNodeIq iq(AddIQ(&CJabberProto::OnIqResult_CommandExecution, JABBER_IQ_TYPE_SET, jid2, 0, -1, hwndDlg));
HXML command = iq << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS);
- const TCHAR *sessionId = xmlGetAttrValue(commandNode, _T("sessionid"));
+ const TCHAR *sessionId = XmlGetAttrValue(commandNode, _T("sessionid"));
if (sessionId)
command << XATTR(_T("sessionid"), sessionId);
- const TCHAR *node = xmlGetAttrValue(commandNode, _T("node"));
+ const TCHAR *node = XmlGetAttrValue(commandNode, _T("node"));
if (node)
command << XATTR(_T("node"), node);
if (action)
command << XATTR(_T("action"), action);
- xmlAddChild(command, dataNode);
+ XmlAddChild(command, dataNode);
m_ThreadInfo->send(iq);
- xi.destroyNode(dataNode);
+ xmlDestroyNode(dataNode);
JabberFormSetInstruction(hwndDlg, TranslateT("In progress. Please Wait..."));
@@ -428,7 +428,7 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA
return dat->proto->AdHoc_SubmitCommandForm(hwndDlg, dat, NULL);
case IDCLOSE:
case IDCANCEL:
- xi.destroyNode(dat->AdHocNode); dat->AdHocNode = NULL;
+ xmlDestroyNode(dat->AdHocNode); dat->AdHocNode = NULL;
DestroyWindow(hwndDlg);
return TRUE;
}
@@ -498,8 +498,8 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA
dat->proto->m_hwndCommandWindow = NULL;
mir_free(dat->ResponderJID);
- xi.destroyNode(dat->CommandsNode);
- xi.destroyNode(dat->AdHocNode);
+ xmlDestroyNode(dat->CommandsNode);
+ xmlDestroyNode(dat->AdHocNode);
mir_free(dat);
dat = NULL;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
diff --git a/protocols/JabberG/src/jabber_agent.cpp b/protocols/JabberG/src/jabber_agent.cpp
index fde3e1c0ba..59d2cbf339 100644
--- a/protocols/JabberG/src/jabber_agent.cpp
+++ b/protocols/JabberG/src/jabber_agent.cpp
@@ -116,7 +116,7 @@ public:
virtual void OnDestroy()
{
- xi.destroyNode(m_agentRegIqNode);
+ xmlDestroyNode(m_agentRegIqNode);
JabberFormDestroyUI(GetDlgItem(m_hwnd, IDC_FRAME));
m_proto->m_hwndAgentRegInput = NULL;
EnableWindow(GetParent(m_hwnd), TRUE);
@@ -142,7 +142,7 @@ public:
HXML queryNode, xNode;
if ((m_agentRegIqNode = (HXML)lParam) == NULL) return TRUE;
- if ((queryNode = xmlGetChild(m_agentRegIqNode , "query")) == NULL) return TRUE;
+ if ((queryNode = XmlGetChild(m_agentRegIqNode , "query")) == NULL) return TRUE;
RECT rect;
@@ -153,9 +153,9 @@ public:
GetClientRect(GetDlgItem(m_hwnd, IDC_FRAME), &rect);
m_frameHeight = rect.bottom - rect.top;
- if ((xNode=xmlGetChild(queryNode , "x")) != NULL) {
+ if ((xNode=XmlGetChild(queryNode , "x")) != NULL) {
// use new jabber:x:data form
- if (LPCTSTR ptszInstr = xmlGetText( xmlGetChild(xNode, "instructions")))
+ if (LPCTSTR ptszInstr = XmlGetText( XmlGetChild(xNode, "instructions")))
JabberFormSetInstruction(m_hwnd, ptszInstr);
JabberFormCreateUI(hFrame, xNode, &m_formHeight /*dummy*/);
@@ -164,21 +164,21 @@ public:
// use old registration information form
HJFORMLAYOUT layout_info = JabberFormCreateLayout(hFrame);
for (int i=0; ; i++) {
- HXML n = xmlGetChild(queryNode ,i);
+ HXML n = XmlGetChild(queryNode ,i);
if (n == NULL)
break;
- if (xmlGetName(n)) {
- if (!mir_tstrcmp(xmlGetName(n), _T("instructions"))) {
- JabberFormSetInstruction(m_hwnd, xmlGetText(n));
+ if (XmlGetName(n)) {
+ if (!mir_tstrcmp(XmlGetName(n), _T("instructions"))) {
+ JabberFormSetInstruction(m_hwnd, XmlGetText(n));
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("key")) || !mir_tstrcmp(xmlGetName(n), _T("registered"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("key")) || !mir_tstrcmp(XmlGetName(n), _T("registered"))) {
// do nothing
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("password")))
- JabberFormAppendControl(hFrame, layout_info, JFORM_CTYPE_TEXT_PRIVATE, xmlGetName(n), xmlGetText(n));
+ else if (!mir_tstrcmp(XmlGetName(n), _T("password")))
+ JabberFormAppendControl(hFrame, layout_info, JFORM_CTYPE_TEXT_PRIVATE, XmlGetName(n), XmlGetText(n));
else // everything else is a normal text field
- JabberFormAppendControl(hFrame, layout_info, JFORM_CTYPE_TEXT_SINGLE, xmlGetName(n), xmlGetText(n));
+ JabberFormAppendControl(hFrame, layout_info, JFORM_CTYPE_TEXT_SINGLE, XmlGetName(n), XmlGetText(n));
} }
JabberFormLayoutControls(hFrame, layout_info, &m_formHeight);
mir_free(layout_info);
@@ -229,8 +229,8 @@ public:
const TCHAR *from;
if (m_agentRegIqNode == NULL) return;
- if ((from = xmlGetAttrValue(m_agentRegIqNode, _T("from"))) == NULL) return;
- if ((queryNode = xmlGetChild(m_agentRegIqNode , "query")) == NULL) return;
+ if ((from = XmlGetAttrValue(m_agentRegIqNode, _T("from"))) == NULL) return;
+ if ((queryNode = XmlGetChild(m_agentRegIqNode , "query")) == NULL) return;
HWND hFrame = GetDlgItem(m_hwnd, IDC_FRAME);
TCHAR *str2 = (TCHAR*)alloca(sizeof(TCHAR) * 128);
@@ -239,33 +239,33 @@ public:
XmlNodeIq iq( m_proto->AddIQ(&CJabberProto::OnIqResultSetRegister, JABBER_IQ_TYPE_SET, from));
HXML query = iq << XQUERY(JABBER_FEAT_REGISTER);
- if ((xNode = xmlGetChild(queryNode , "x")) != NULL) {
+ if ((xNode = XmlGetChild(queryNode , "x")) != NULL) {
// use new jabber:x:data form
HXML n = JabberFormGetData(hFrame, xNode);
- xmlAddChild(query, n);
- xi.destroyNode(n);
+ XmlAddChild(query, n);
+ xmlDestroyNode(n);
}
else {
// use old registration information form
for (int i=0; ; i++) {
- HXML n = xmlGetChild(queryNode ,i);
+ HXML n = XmlGetChild(queryNode ,i);
if (!n)
break;
- if (xmlGetName(n)) {
- if (!mir_tstrcmp(xmlGetName(n), _T("key"))) {
+ if (XmlGetName(n)) {
+ if (!mir_tstrcmp(XmlGetName(n), _T("key"))) {
// field that must be passed along with the registration
- if (xmlGetText(n))
- xmlAddChild(query, xmlGetName(n), xmlGetText(n));
+ if (XmlGetText(n))
+ XmlAddChild(query, XmlGetName(n), XmlGetText(n));
else
- xmlAddChild(query, xmlGetName(n));
+ XmlAddChild(query, XmlGetName(n));
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("registered")) || !mir_tstrcmp(xmlGetName(n), _T("instructions"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("registered")) || !mir_tstrcmp(XmlGetName(n), _T("instructions"))) {
// do nothing, we will skip these
}
else {
GetDlgItemText(hFrame, id, str2, 128);
- xmlAddChild(query, xmlGetName(n), str2);
+ XmlAddChild(query, XmlGetName(n), str2);
id++;
} } } }
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp
index f12dbd5c4b..b7d29783ac 100644
--- a/protocols/JabberG/src/jabber_archive.cpp
+++ b/protocols/JabberG/src/jabber_archive.cpp
@@ -52,24 +52,24 @@ void CJabberProto::RetrieveMessageArchive(MCONTACT hContact, JABBER_LIST_ITEM *p
void CJabberProto::OnIqResultGetCollectionList(HXML iqNode, CJabberIqInfo*)
{
- const TCHAR *to = xmlGetAttrValue(iqNode, _T("to"));
- if (to == NULL || mir_tstrcmp( xmlGetAttrValue(iqNode, _T("type")), _T("result")))
+ const TCHAR *to = XmlGetAttrValue(iqNode, _T("to"));
+ if (to == NULL || mir_tstrcmp( XmlGetAttrValue(iqNode, _T("type")), _T("result")))
return;
- HXML list = xmlGetChild(iqNode, "list");
- if (!list || mir_tstrcmp( xmlGetAttrValue(list, _T("xmlns")), JABBER_FEAT_ARCHIVE))
+ HXML list = XmlGetChild(iqNode, "list");
+ if (!list || mir_tstrcmp( XmlGetAttrValue(list, _T("xmlns")), JABBER_FEAT_ARCHIVE))
return;
MCONTACT hContact = NULL;
time_t tmLast = 0;
for (int nodeIdx = 1; ; nodeIdx++) {
- HXML itemNode = xmlGetNthChild(list, _T("chat"), nodeIdx);
+ HXML itemNode = XmlGetNthChild(list, _T("chat"), nodeIdx);
if (!itemNode)
break;
- const TCHAR* start = xmlGetAttrValue(itemNode, _T("start"));
- const TCHAR* with = xmlGetAttrValue(itemNode, _T("with"));
+ const TCHAR* start = XmlGetAttrValue(itemNode, _T("start"));
+ const TCHAR* with = XmlGetAttrValue(itemNode, _T("with"));
if (!start || !with)
continue;
@@ -246,15 +246,15 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei)
void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*)
{
- if ( mir_tstrcmp( xmlGetAttrValue(iqNode, _T("type")), _T("result")))
+ if ( mir_tstrcmp( XmlGetAttrValue(iqNode, _T("type")), _T("result")))
return;
- HXML chatNode = xmlGetChild(iqNode, "chat");
- if (!chatNode || mir_tstrcmp( xmlGetAttrValue(chatNode, _T("xmlns")), JABBER_FEAT_ARCHIVE))
+ HXML chatNode = XmlGetChild(iqNode, "chat");
+ if (!chatNode || mir_tstrcmp( XmlGetAttrValue(chatNode, _T("xmlns")), JABBER_FEAT_ARCHIVE))
return;
- const TCHAR* start = xmlGetAttrValue(chatNode, _T("start"));
- const TCHAR* with = xmlGetAttrValue(chatNode, _T("with"));
+ const TCHAR* start = XmlGetAttrValue(chatNode, _T("start"));
+ const TCHAR* with = XmlGetAttrValue(chatNode, _T("with"));
if (!start || !with)
return;
@@ -266,12 +266,12 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*)
_tzset();
for (int nodeIdx = 0; ; nodeIdx++) {
- HXML itemNode = xmlGetChild(chatNode, nodeIdx);
+ HXML itemNode = XmlGetChild(chatNode, nodeIdx);
if (!itemNode)
break;
int from;
- const TCHAR *itemName = xmlGetName(itemNode);
+ const TCHAR *itemName = XmlGetName(itemNode);
if (!mir_tstrcmp(itemName, _T("to")))
from = DBEF_SENT;
else if (!mir_tstrcmp(itemName, _T("from")))
@@ -279,12 +279,12 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*)
else
continue;
- HXML body = xmlGetChild(itemNode, "body");
+ HXML body = XmlGetChild(itemNode, "body");
if (!body)
continue;
- const TCHAR *tszBody = xmlGetText(body);
- const TCHAR *tszSecs = xmlGetAttrValue(itemNode, _T("secs"));
+ const TCHAR *tszBody = XmlGetText(body);
+ const TCHAR *tszSecs = XmlGetAttrValue(itemNode, _T("secs"));
if (!tszBody || !tszSecs)
continue;
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp
index fcde4046de..3ebd23db99 100644
--- a/protocols/JabberG/src/jabber_byte.cpp
+++ b/protocols/JabberG/src/jabber_byte.cpp
@@ -44,7 +44,7 @@ JABBER_BYTE_TRANSFER::~JABBER_BYTE_TRANSFER()
mir_free(iqId);
mir_free(sid);
- xi.destroyNode(iqNode);
+ xmlDestroyNode(iqNode);
// XEP-0065 proxy support
mir_free(szProxyHost);
@@ -58,15 +58,15 @@ void CJabberProto::IqResultProxyDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
JABBER_BYTE_TRANSFER *jbt = (JABBER_BYTE_TRANSFER *)pInfo->GetUserData();
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
- HXML queryNode = xmlGetChild(iqNode , "query");
+ HXML queryNode = XmlGetChild(iqNode , "query");
if (queryNode) {
- const TCHAR *queryXmlns = xmlGetAttrValue(queryNode, _T("xmlns"));
+ const TCHAR *queryXmlns = XmlGetAttrValue(queryNode, _T("xmlns"));
if (queryXmlns && !mir_tstrcmp(queryXmlns, JABBER_FEAT_BYTESTREAMS)) {
- HXML streamHostNode = xmlGetChild(queryNode , "streamhost");
+ HXML streamHostNode = XmlGetChild(queryNode , "streamhost");
if (streamHostNode) {
- const TCHAR *streamJid = xmlGetAttrValue(streamHostNode, _T("jid"));
- const TCHAR *streamHost = xmlGetAttrValue(streamHostNode, _T("host"));
- const TCHAR *streamPort = xmlGetAttrValue(streamHostNode, _T("port"));
+ const TCHAR *streamJid = XmlGetAttrValue(streamHostNode, _T("jid"));
+ const TCHAR *streamHost = XmlGetAttrValue(streamHostNode, _T("host"));
+ const TCHAR *streamPort = XmlGetAttrValue(streamHostNode, _T("port"));
if (streamJid && streamHost && streamPort) {
jbt->szProxyHost = mir_tstrdup(streamHost);
jbt->szProxyJid = mir_tstrdup(streamJid);
@@ -296,13 +296,13 @@ void CJabberProto::ByteInitiateResult(HXML iqNode, CJabberIqInfo *pInfo)
JABBER_BYTE_TRANSFER *jbt = (JABBER_BYTE_TRANSFER *)pInfo->GetUserData();
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
- HXML queryNode = xmlGetChild(iqNode , "query");
+ HXML queryNode = XmlGetChild(iqNode , "query");
if (queryNode) {
- const TCHAR *queryXmlns = xmlGetAttrValue(queryNode, _T("xmlns"));
+ const TCHAR *queryXmlns = XmlGetAttrValue(queryNode, _T("xmlns"));
if (queryXmlns && !mir_tstrcmp(queryXmlns, JABBER_FEAT_BYTESTREAMS)) {
- HXML streamHostNode = xmlGetChild(queryNode , "streamhost-used");
+ HXML streamHostNode = XmlGetChild(queryNode , "streamhost-used");
if (streamHostNode) {
- const TCHAR *streamJid = xmlGetAttrValue(streamHostNode, _T("jid"));
+ const TCHAR *streamJid = XmlGetAttrValue(streamHostNode, _T("jid"));
if (streamJid)
jbt->szStreamhostUsed = mir_tstrdup(streamJid);
} } } }
@@ -412,7 +412,7 @@ void CJabberProto::IqResultStreamActivate(HXML iqNode, CJabberIqInfo*)
if (item == NULL)
return;
- if (!mir_tstrcmp(xmlGetAttrValue(iqNode, _T("type")), _T("result")))
+ if (!mir_tstrcmp(XmlGetAttrValue(iqNode, _T("type")), _T("result")))
item->jbt->bStreamActivated = TRUE;
if (item->jbt->hProxyEvent)
@@ -600,26 +600,26 @@ void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt)
jbt->state = JBT_INIT;
if (iqNode = jbt->iqNode) {
- from = xmlGetAttrValue(iqNode, _T("from"));
- to = xmlGetAttrValue(iqNode, _T("to"));
- szId = xmlGetAttrValue(iqNode, _T("id"));
+ from = XmlGetAttrValue(iqNode, _T("from"));
+ to = XmlGetAttrValue(iqNode, _T("to"));
+ szId = XmlGetAttrValue(iqNode, _T("id"));
- queryNode = xmlGetChild(iqNode, "query");
+ queryNode = XmlGetChild(iqNode, "query");
if (queryNode)
- sid = xmlGetAttrValue(queryNode, _T("sid"));
+ sid = XmlGetAttrValue(queryNode, _T("sid"));
}
- if (szId && from && to && sid && (n = xmlGetChild(queryNode, "streamhost")) != NULL) {
+ if (szId && from && to && sid && (n = XmlGetChild(queryNode, "streamhost")) != NULL) {
jbt->iqId = mir_tstrdup(szId);
jbt->srcJID = mir_tstrdup(from);
jbt->dstJID = mir_tstrdup(to);
jbt->sid = mir_tstrdup(sid);
if ((buffer = (char*)mir_alloc(JABBER_NETWORK_BUFFER_SIZE))) {
- for (i = 1; (n = xmlGetNthChild(queryNode, _T("streamhost"), i)) != NULL; i++) {
- if ((szHost = xmlGetAttrValue(n, _T("host"))) != NULL &&
- (szPort = xmlGetAttrValue(n, _T("port"))) != NULL &&
- (str = xmlGetAttrValue(n, _T("jid"))) != NULL) {
+ for (i = 1; (n = XmlGetNthChild(queryNode, _T("streamhost"), i)) != NULL; i++) {
+ if ((szHost = XmlGetAttrValue(n, _T("host"))) != NULL &&
+ (szPort = XmlGetAttrValue(n, _T("port"))) != NULL &&
+ (str = XmlGetAttrValue(n, _T("jid"))) != NULL) {
port = (WORD)_ttoi(szPort);
replaceStrT(jbt->streamhostJID, str);
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp
index 6b0581032a..87f9036253 100644
--- a/protocols/JabberG/src/jabber_caps.cpp
+++ b/protocols/JabberG/src/jabber_caps.cpp
@@ -109,7 +109,7 @@ void CJabberProto::OnIqResultCapsDiscoInfoSI(HXML, CJabberIqInfo *pInfo)
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT && query) {
// XEP-0232 support
HXML xform;
- for (int i = 1; (xform = xmlGetNthChild(query, _T("x"), i)) != NULL; i++) {
+ for (int i = 1; (xform = XmlGetNthChild(query, _T("x"), i)) != NULL; i++) {
TCHAR *szFormTypeValue = XPath(xform, _T("field[@var='FORM_TYPE']/value"));
if (szFormTypeValue && !mir_tstrcmp(szFormTypeValue, _T("urn:xmpp:dataforms:softwareinfo"))) {
TCHAR *szTmp = XPath(xform, _T("field[@var='os']/value"));
@@ -142,8 +142,8 @@ void CJabberProto::OnIqResultCapsDiscoInfo(HXML, CJabberIqInfo *pInfo)
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT && query) {
JabberCapsBits jcbCaps = 0;
HXML feature;
- for (int i = 1; (feature = xmlGetNthChild(query, _T("feature"), i)) != NULL; i++) {
- const TCHAR *featureName = xmlGetAttrValue(feature, _T("var"));
+ for (int i = 1; (feature = XmlGetNthChild(query, _T("feature"), i)) != NULL; i++) {
+ const TCHAR *featureName = XmlGetAttrValue(feature, _T("var"));
if (!featureName)
continue;
diff --git a/protocols/JabberG/src/jabber_captcha.cpp b/protocols/JabberG/src/jabber_captcha.cpp
index c923fee4a1..17f37fc7f5 100644
--- a/protocols/JabberG/src/jabber_captcha.cpp
+++ b/protocols/JabberG/src/jabber_captcha.cpp
@@ -112,38 +112,38 @@ INT_PTR CALLBACK JabberCaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
bool CJabberProto::ProcessCaptcha(HXML node, HXML parentNode, ThreadData *info)
{
- HXML x = xmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
+ HXML x = XmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if (x == NULL)
return false;
- HXML y = xmlGetChildByTag(x, _T("field"), _T("var"), _T("from"));
+ HXML y = XmlGetChildByTag(x, _T("field"), _T("var"), _T("from"));
if (y == NULL)
return false;
- if ((y = xmlGetChild(y, "value")) == NULL)
+ if ((y = XmlGetChild(y, "value")) == NULL)
return false;
CAPTCHA_FORM_PARAMS param;
- param.fromjid = xmlGetText(y);
+ param.fromjid = XmlGetText(y);
- if ((y = xmlGetChildByTag(x, _T("field"), _T("var"), _T("sid"))) == NULL)
+ if ((y = XmlGetChildByTag(x, _T("field"), _T("var"), _T("sid"))) == NULL)
return false;
- if ((y = xmlGetChild(y, "value")) == NULL)
+ if ((y = XmlGetChild(y, "value")) == NULL)
return false;
- param.sid = xmlGetText(y);
+ param.sid = XmlGetText(y);
- if ((y = xmlGetChildByTag(x, _T("field"), _T("var"), _T("ocr"))) == NULL)
+ if ((y = XmlGetChildByTag(x, _T("field"), _T("var"), _T("ocr"))) == NULL)
return false;
- param.hint = xmlGetAttrValue (y, _T("label"));
+ param.hint = XmlGetAttrValue (y, _T("label"));
- param.from = xmlGetAttrValue(parentNode, _T("from"));
- param.to = xmlGetAttrValue(parentNode, _T("to"));
- param.challenge = xmlGetAttrValue(parentNode, _T("id"));
- HXML o = xmlGetChild(parentNode, "data");
- if (o == NULL || xmlGetText(o) == NULL)
+ param.from = XmlGetAttrValue(parentNode, _T("from"));
+ param.to = XmlGetAttrValue(parentNode, _T("to"));
+ param.challenge = XmlGetAttrValue(parentNode, _T("id"));
+ HXML o = XmlGetChild(parentNode, "data");
+ if (o == NULL || XmlGetText(o) == NULL)
return false;
unsigned bufferLen;
- ptrA buffer((char*)mir_base64_decode( _T2A(xmlGetText(o)), &bufferLen));
+ ptrA buffer((char*)mir_base64_decode( _T2A(XmlGetText(o)), &bufferLen));
if (buffer == NULL)
return false;
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index ee686bddb7..1381a7036d 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -259,7 +259,7 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const TCHAR *
{
int statusToSet = 0;
- const TCHAR *szReason = xmlGetText(reason);
+ const TCHAR *szReason = XmlGetText(reason);
if (szReason == NULL) {
if (nStatusCode == 322)
szReason = TranslateT("because room is now members-only");
@@ -347,7 +347,7 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, HXML reason)
GCDEST gcd = { m_szModuleName, item->jid, GC_EVENT_CONTROL };
GCEVENT gce = { sizeof(gce), &gcd };
gce.ptszUID = item->jid;
- gce.ptszText = xmlGetText(reason);
+ gce.ptszText = XmlGetText(reason);
CallServiceSync(MS_GC_EVENT, (code == 200) ? SESSION_TERMINATE : SESSION_OFFLINE, (LPARAM)&gce);
db_unset(HContactFromJID(item->jid), "CList", "Hidden");
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp
index 16de723cc1..15a5048d18 100644
--- a/protocols/JabberG/src/jabber_console.cpp
+++ b/protocols/JabberG/src/jabber_console.cpp
@@ -83,7 +83,7 @@ static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent);
void CJabberProto::OnConsoleProcessXml(HXML node, DWORD flags)
{
if (node && m_pDlgConsole) {
- if (xmlGetName(node)) {
+ if (XmlGetName(node)) {
if (FilterXml(node, flags)) {
StringBuf buf = {0};
sttAppendBufRaw(&buf, RTF_HEADER);
@@ -95,20 +95,20 @@ void CJabberProto::OnConsoleProcessXml(HXML node, DWORD flags)
}
}
else {
- for (int i=0; i < xmlGetChildCount(node); i++)
- OnConsoleProcessXml(xmlGetChild(node, i), flags);
+ for (int i=0; i < XmlGetChildCount(node); i++)
+ OnConsoleProcessXml(XmlGetChild(node, i), flags);
}
}
}
bool CJabberProto::RecursiveCheckFilter(HXML node, DWORD flags)
{
- for (int i = 0; i < xmlGetAttrCount(node); i++)
- if (JabberStrIStr(xmlGetAttr(node, i), m_filterInfo.pattern))
+ for (int i = 0; i < XmlGetAttrCount(node); i++)
+ if (JabberStrIStr(XmlGetAttr(node, i), m_filterInfo.pattern))
return true;
- for (int i = 0; i < xmlGetChildCount(node); i++)
- if (RecursiveCheckFilter(xmlGetChild(node, i), flags))
+ for (int i = 0; i < XmlGetChildCount(node); i++)
+ if (RecursiveCheckFilter(XmlGetChild(node, i), flags))
return true;
return false;
@@ -116,9 +116,9 @@ bool CJabberProto::RecursiveCheckFilter(HXML node, DWORD flags)
bool CJabberProto::FilterXml(HXML node, DWORD flags)
{
- if (!m_filterInfo.msg && !mir_tstrcmp(xmlGetName(node), _T("message"))) return false;
- if (!m_filterInfo.presence && !mir_tstrcmp(xmlGetName(node), _T("presence"))) return false;
- if (!m_filterInfo.iq && !mir_tstrcmp(xmlGetName(node), _T("iq"))) return false;
+ if (!m_filterInfo.msg && !mir_tstrcmp(XmlGetName(node), _T("message"))) return false;
+ if (!m_filterInfo.presence && !mir_tstrcmp(XmlGetName(node), _T("presence"))) return false;
+ if (!m_filterInfo.iq && !mir_tstrcmp(XmlGetName(node), _T("iq"))) return false;
if (m_filterInfo.type == TFilterInfo::T_OFF) return true;
mir_cslock lck(m_filterInfo.csPatternLock);
@@ -126,14 +126,14 @@ bool CJabberProto::FilterXml(HXML node, DWORD flags)
const TCHAR *attrValue;
switch (m_filterInfo.type) {
case TFilterInfo::T_JID:
- attrValue = xmlGetAttrValue(node, (flags & JCPF_OUT) ? _T("to") : _T("from"));
+ attrValue = XmlGetAttrValue(node, (flags & JCPF_OUT) ? _T("to") : _T("from"));
if (attrValue)
return JabberStrIStr(attrValue, m_filterInfo.pattern) != NULL;
break;
case TFilterInfo::T_XMLNS:
- if (xmlGetChildCount(node)) {
- attrValue = xmlGetAttrValue(xmlGetChild(node, 0), _T("xmlns"));
+ if (XmlGetChildCount(node)) {
+ attrValue = XmlGetAttrValue(XmlGetChild(node, 0), _T("xmlns"));
if (attrValue)
return JabberStrIStr(attrValue, m_filterInfo.pattern) != NULL;
}
@@ -202,10 +202,10 @@ static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent)
if (flags&JCPF_OUT) sttAppendBufRaw(buf, "\\highlight4 ");
sttAppendBufRaw(buf, "<");
sttAppendBufRaw(buf, RTF_BEGINTAGNAME);
- sttAppendBufW(buf, (TCHAR*)xmlGetName(node));
+ sttAppendBufW(buf, (TCHAR*)XmlGetName(node));
sttAppendBufRaw(buf, RTF_ENDTAGNAME);
- for (int i = 0; i < xmlGetAttrCount(node); i++) {
+ for (int i = 0; i < XmlGetAttrCount(node); i++) {
TCHAR *attr = (TCHAR*)xmlGetAttrName(node, i);
sttAppendBufRaw(buf, " ");
sttAppendBufRaw(buf, RTF_BEGINATTRNAME);
@@ -213,39 +213,39 @@ static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent)
sttAppendBufRaw(buf, RTF_ENDATTRNAME);
sttAppendBufRaw(buf, "=\"");
sttAppendBufRaw(buf, RTF_BEGINATTRVAL);
- sttAppendBufT(buf, (TCHAR*)xmlGetAttr(node, i));
+ sttAppendBufT(buf, (TCHAR*)XmlGetAttr(node, i));
sttAppendBufRaw(buf, "\"");
sttAppendBufRaw(buf, RTF_ENDATTRVAL);
}
- if (xmlGetChild(node) || xmlGetText(node)) {
+ if (XmlGetChild(node) || XmlGetText(node)) {
sttAppendBufRaw(buf, ">");
- if (xmlGetChild(node))
+ if (XmlGetChild(node))
sttAppendBufRaw(buf, RTF_ENDTAG);
}
- if (xmlGetText(node)) {
- if (xmlGetChildCount(node)) {
+ if (XmlGetText(node)) {
+ if (XmlGetChildCount(node)) {
sttAppendBufRaw(buf, RTF_BEGINTEXT);
char indentTextLevel[128];
mir_snprintf(indentTextLevel, _countof(indentTextLevel), RTF_TEXTINDENT_FMT, (int)((indent + 1) * 200));
sttAppendBufRaw(buf, indentTextLevel);
}
- sttAppendBufT(buf, xmlGetText(node));
- if (xmlGetChild(node))
+ sttAppendBufT(buf, XmlGetText(node));
+ if (XmlGetChild(node))
sttAppendBufRaw(buf, RTF_ENDTEXT);
}
- for (int i = 0; i < xmlGetChildCount(node); i++)
- sttRtfAppendXml(buf, xmlGetChild(node, i), flags & ~(JCPF_IN | JCPF_OUT), indent + 1);
+ for (int i = 0; i < XmlGetChildCount(node); i++)
+ sttRtfAppendXml(buf, XmlGetChild(node, i), flags & ~(JCPF_IN | JCPF_OUT), indent + 1);
- if (xmlGetChildCount(node) || xmlGetText(node)) {
+ if (XmlGetChildCount(node) || XmlGetText(node)) {
sttAppendBufRaw(buf, RTF_BEGINTAG);
sttAppendBufRaw(buf, indentLevel);
sttAppendBufRaw(buf, "</");
sttAppendBufRaw(buf, RTF_BEGINTAGNAME);
- sttAppendBufT(buf, xmlGetName(node));
+ sttAppendBufT(buf, XmlGetName(node));
sttAppendBufRaw(buf, RTF_ENDTAGNAME);
sttAppendBufRaw(buf, ">");
}
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp
index 99658d0a49..744d175452 100644
--- a/protocols/JabberG/src/jabber_disco.cpp
+++ b/protocols/JabberG/src/jabber_disco.cpp
@@ -174,17 +174,17 @@ void CJabberProto::OnIqResultServiceDiscoveryInfo(HXML iqNode, CJabberIqInfo *pI
return;
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
- HXML query = xmlGetChild(iqNode , "query");
+ HXML query = XmlGetChild(iqNode , "query");
if (query == NULL)
pNode->SetInfoRequestId(JABBER_DISCO_RESULT_ERROR);
else {
HXML feature;
int i;
- for (i = 1; (feature = xmlGetNthChild(query, _T("feature"), i)) != NULL; i++)
- pNode->AddFeature(xmlGetAttrValue(feature, _T("var")));
+ for (i = 1; (feature = XmlGetNthChild(query, _T("feature"), i)) != NULL; i++)
+ pNode->AddFeature(XmlGetAttrValue(feature, _T("var")));
HXML identity;
- for (i = 1; (identity = xmlGetNthChild(query, _T("identity"), i)) != NULL; i++)
- pNode->AddIdentity(xmlGetAttrValue(identity, _T("category")), xmlGetAttrValue(identity, _T("type")), xmlGetAttrValue(identity, _T("name")));
+ for (i = 1; (identity = XmlGetNthChild(query, _T("identity"), i)) != NULL; i++)
+ pNode->AddIdentity(XmlGetAttrValue(identity, _T("category")), XmlGetAttrValue(identity, _T("type")), XmlGetAttrValue(identity, _T("name")));
pNode->SetInfoRequestId(JABBER_DISCO_RESULT_OK);
pNode->SetInfoRequestErrorText(NULL);
@@ -192,7 +192,7 @@ void CJabberProto::OnIqResultServiceDiscoveryInfo(HXML iqNode, CJabberIqInfo *pI
}
else {
if (pInfo->GetIqType() == JABBER_IQ_TYPE_ERROR) {
- HXML errorNode = xmlGetChild(iqNode , "error");
+ HXML errorNode = XmlGetChild(iqNode , "error");
TCHAR *str = JabberErrorMsg(errorNode);
pNode->SetInfoRequestErrorText(str);
mir_free(str);
@@ -218,13 +218,13 @@ void CJabberProto::OnIqResultServiceDiscoveryItems(HXML iqNode, CJabberIqInfo *p
return;
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
- HXML query = xmlGetChild(iqNode , "query");
+ HXML query = XmlGetChild(iqNode , "query");
if (query == NULL)
pNode->SetItemsRequestId(JABBER_DISCO_RESULT_ERROR);
else {
HXML item;
- for (int i = 1; (item = xmlGetNthChild(query, _T("item"), i)) != NULL; i++)
- pNode->AddChildNode(xmlGetAttrValue(item, _T("jid")), xmlGetAttrValue(item, _T("node")), xmlGetAttrValue(item, _T("name")));
+ for (int i = 1; (item = XmlGetNthChild(query, _T("item"), i)) != NULL; i++)
+ pNode->AddChildNode(XmlGetAttrValue(item, _T("jid")), XmlGetAttrValue(item, _T("node")), XmlGetAttrValue(item, _T("name")));
pNode->SetItemsRequestId(JABBER_DISCO_RESULT_OK);
pNode->SetItemsRequestErrorText(NULL);
@@ -232,7 +232,7 @@ void CJabberProto::OnIqResultServiceDiscoveryItems(HXML iqNode, CJabberIqInfo *p
}
else {
if (pInfo->GetIqType() == JABBER_IQ_TYPE_ERROR) {
- HXML errorNode = xmlGetChild(iqNode , "error");
+ HXML errorNode = XmlGetChild(iqNode , "error");
TCHAR *str = JabberErrorMsg(errorNode);
pNode->SetItemsRequestErrorText(str);
mir_free(str);
@@ -257,12 +257,12 @@ void CJabberProto::OnIqResultServiceDiscoveryRootInfo(HXML iqNode, CJabberIqInfo
mir_cslockfull lck(m_SDManager.cs());
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
- HXML query = xmlGetChild(iqNode , "query");
+ HXML query = XmlGetChild(iqNode , "query");
if (query) {
HXML feature;
- for (int i = 1; (feature = xmlGetNthChild(query, _T("feature"), i)) != NULL; i++) {
- if (!mir_tstrcmp(xmlGetAttrValue(feature, _T("var")), (TCHAR *)pInfo->m_pUserData)) {
- CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(pInfo->GetReceiver(), xmlGetAttrValue(iqNode, _T("node")), NULL);
+ for (int i = 1; (feature = XmlGetNthChild(query, _T("feature"), i)) != NULL; i++) {
+ if (!mir_tstrcmp(XmlGetAttrValue(feature, _T("var")), (TCHAR *)pInfo->m_pUserData)) {
+ CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(pInfo->GetReceiver(), XmlGetAttrValue(iqNode, _T("node")), NULL);
SendBothRequests(pNode, NULL);
break;
} } } }
@@ -279,23 +279,23 @@ void CJabberProto::OnIqResultServiceDiscoveryRootItems(HXML iqNode, CJabberIqInf
XmlNode packet(NULL);
mir_cslockfull lck(m_SDManager.cs());
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
- HXML query = xmlGetChild(iqNode , "query");
+ HXML query = XmlGetChild(iqNode , "query");
if (query) {
HXML item;
- for (int i = 1; (item = xmlGetNthChild(query, _T("item"), i)) != NULL; i++) {
- const TCHAR *szJid = xmlGetAttrValue(item, _T("jid"));
- const TCHAR *szNode = xmlGetAttrValue(item, _T("node"));
+ for (int i = 1; (item = XmlGetNthChild(query, _T("item"), i)) != NULL; i++) {
+ const TCHAR *szJid = XmlGetAttrValue(item, _T("jid"));
+ const TCHAR *szNode = XmlGetAttrValue(item, _T("node"));
CJabberIqInfo *pNewInfo = AddIQ(&CJabberProto::OnIqResultServiceDiscoveryRootInfo, JABBER_IQ_TYPE_GET, szJid);
pNewInfo->m_pUserData = pInfo->m_pUserData;
pNewInfo->SetTimeout(30000);
XmlNodeIq iq(pNewInfo);
iq << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(_T("node"), szNode);
- xmlAddChild(packet, iq);
+ XmlAddChild(packet, iq);
} } }
lck.unlock();
- if (xmlGetChild(packet ,0))
+ if (XmlGetChild(packet ,0))
m_ThreadInfo->send(packet);
}
@@ -313,10 +313,10 @@ BOOL CJabberProto::SendInfoRequest(CJabberSDNode *pNode, HXML parent)
XmlNodeIq iq(pInfo);
HXML query = iq << XQUERY(JABBER_FEAT_DISCO_INFO);
if (pNode->GetNode())
- xmlAddAttr(query, _T("node"), pNode->GetNode());
+ XmlAddAttr(query, _T("node"), pNode->GetNode());
if (parent)
- xmlAddChild(parent, iq);
+ XmlAddChild(parent, iq);
else
m_ThreadInfo->send(iq);
}
@@ -343,10 +343,10 @@ BOOL CJabberProto::SendBothRequests(CJabberSDNode *pNode, HXML parent)
XmlNodeIq iq(pInfo);
HXML query = iq << XQUERY(JABBER_FEAT_DISCO_INFO);
if (pNode->GetNode())
- xmlAddAttr(query, _T("node"), pNode->GetNode());
+ XmlAddAttr(query, _T("node"), pNode->GetNode());
if (parent)
- xmlAddChild(parent, iq);
+ XmlAddChild(parent, iq);
else
m_ThreadInfo->send(iq);
}
@@ -360,10 +360,10 @@ BOOL CJabberProto::SendBothRequests(CJabberSDNode *pNode, HXML parent)
XmlNodeIq iq(pInfo);
HXML query = iq << XQUERY(JABBER_FEAT_DISCO_ITEMS);
if (pNode->GetNode())
- xmlAddAttr(query, _T("node"), pNode->GetNode());
+ XmlAddAttr(query, _T("node"), pNode->GetNode());
if (parent)
- xmlAddChild(parent, iq);
+ XmlAddChild(parent, iq);
else
m_ThreadInfo->send(iq);
}
@@ -909,7 +909,7 @@ void CJabberDlgDiscovery::btnRefresh_OnClick(CCtrlButton *)
}
lck.unlock();
- if (xmlGetChild(packet ,0))
+ if (XmlGetChild(packet ,0))
m_proto->m_ThreadInfo->send(packet);
}
@@ -1018,7 +1018,7 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
m_proto->SendInfoRequest(pNode, packet);
}
}
- if (xmlGetChild(packet, 0))
+ if (XmlGetChild(packet, 0))
m_proto->m_ThreadInfo->send(packet);
KillTimer(m_hwnd, AUTODISCO_TIMER);
@@ -1081,7 +1081,7 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
TreeList_MakeFakeParent(hItem, FALSE);
}
}
- if (xmlGetChild(packet))
+ if (XmlGetChild(packet))
m_proto->m_ThreadInfo->send(packet);
}
else if (pHeader->code == NM_CUSTOMDRAW) {
@@ -1282,7 +1282,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
TreeList_MakeFakeParent(hItem, FALSE);
}
}
- if (xmlGetChild(packet))
+ if (XmlGetChild(packet))
m_ThreadInfo->send(packet);
}
break;
@@ -1302,14 +1302,14 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
TreeList_MakeFakeParent(hNode, FALSE);
}
- if (xmlGetChildCount(packet) > 50) {
+ if (XmlGetChildCount(packet) > 50) {
m_ThreadInfo->send(packet);
packet = XmlNode(NULL);
}
}
}
- if (xmlGetChildCount(packet))
+ if (XmlGetChildCount(packet))
m_ThreadInfo->send(packet);
}
break;
diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp
index 511609003a..56aa85ce1c 100644
--- a/protocols/JabberG/src/jabber_form.cpp
+++ b/protocols/JabberG/src/jabber_form.cpp
@@ -440,7 +440,7 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp
TCHAR *labelStr, *valueStr;
RECT frameRect;
- if (xNode == NULL || xmlGetName(xNode) == NULL || mir_tstrcmp(xmlGetName(xNode), _T("x")) || hwndStatic == NULL)
+ if (xNode == NULL || XmlGetName(xNode) == NULL || mir_tstrcmp(XmlGetName(xNode), _T("x")) || hwndStatic == NULL)
return;
GetClientRect(hwndStatic, &frameRect);
@@ -456,47 +456,47 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp
layout_info.offset = 10;
layout_info.y_pos = bCompact ? 0 : 14;
for (int i = 0;; i++) {
- HXML n = xmlGetChild(xNode, i);
+ HXML n = XmlGetChild(xNode, i);
if (!n)
break;
- if (mir_tstrcmp(xmlGetName(n), _T("field")))
+ if (mir_tstrcmp(XmlGetName(n), _T("field")))
continue;
- varStr = xmlGetAttrValue(n, _T("var"));
- if ((typeName = xmlGetAttrValue(n, _T("type"))) == NULL)
+ varStr = XmlGetAttrValue(n, _T("var"));
+ if ((typeName = XmlGetAttrValue(n, _T("type"))) == NULL)
continue;
- if ((label = xmlGetAttrValue(n, _T("label"))) != NULL)
+ if ((label = XmlGetAttrValue(n, _T("label"))) != NULL)
labelStr = mir_tstrdup(label);
else
labelStr = mir_tstrdup(varStr);
TJabberFormControlType type = JabberFormTypeNameToId(typeName);
- if ((v = xmlGetChild(n, "value")) != NULL) {
- valueText = xmlGetText(v);
+ if ((v = XmlGetChild(n, "value")) != NULL) {
+ valueText = XmlGetText(v);
if (type != JFORM_CTYPE_TEXT_MULTI)
valueStr = mir_tstrdup(valueText);
else {
size_t size = 1;
for (int j = 0;; j++) {
- v = xmlGetChild(n, j);
+ v = XmlGetChild(n, j);
if (!v)
break;
- if (xmlGetName(v) && !mir_tstrcmp(xmlGetName(v), _T("value")) && xmlGetText(v))
- size += mir_tstrlen(xmlGetText(v)) + 2;
+ if (XmlGetName(v) && !mir_tstrcmp(XmlGetName(v), _T("value")) && XmlGetText(v))
+ size += mir_tstrlen(XmlGetText(v)) + 2;
}
valueStr = (TCHAR*)mir_alloc(sizeof(TCHAR)*size);
valueStr[0] = '\0';
for (int j = 0;; j++) {
- v = xmlGetChild(n, j);
+ v = XmlGetChild(n, j);
if (!v)
break;
- if (xmlGetName(v) && !mir_tstrcmp(xmlGetName(v), _T("value")) && xmlGetText(v)) {
+ if (XmlGetName(v) && !mir_tstrcmp(XmlGetName(v), _T("value")) && XmlGetText(v)) {
if (valueStr[0])
mir_tstrcat(valueStr, _T("\r\n"));
- mir_tstrcat(valueStr, xmlGetText(v));
+ mir_tstrcat(valueStr, XmlGetText(v));
}
}
}
@@ -510,44 +510,44 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp
if (type == JFORM_CTYPE_LIST_SINGLE) {
for (int j = 0;; j++) {
- HXML o = xmlGetChild(n, j);
+ HXML o = XmlGetChild(n, j);
if (o == NULL)
break;
- if (mir_tstrcmp(xmlGetName(o), _T("option")))
+ if (mir_tstrcmp(XmlGetName(o), _T("option")))
continue;
- if ((v = xmlGetChild(o, "value")) == NULL || xmlGetText(v) == NULL)
+ if ((v = XmlGetChild(o, "value")) == NULL || XmlGetText(v) == NULL)
continue;
- if ((str = xmlGetAttrValue(o, _T("label"))) == NULL)
- str = xmlGetText(v);
+ if ((str = XmlGetAttrValue(o, _T("label"))) == NULL)
+ str = XmlGetText(v);
if (str == NULL)
continue;
- bool selected = !mir_tstrcmp(valueText, xmlGetText(v));
+ bool selected = !mir_tstrcmp(valueText, XmlGetText(v));
JabberFormAddListItem(item, str, selected);
}
}
else if (type == JFORM_CTYPE_LIST_MULTI) {
for (int j = 0;; j++) {
- HXML o = xmlGetChild(n, j);
+ HXML o = XmlGetChild(n, j);
if (o == NULL)
break;
- if (mir_tstrcmp(xmlGetName(o), _T("option")))
+ if (mir_tstrcmp(XmlGetName(o), _T("option")))
continue;
- if ((v = xmlGetChild(o, "value")) == NULL || xmlGetText(v) == NULL)
+ if ((v = XmlGetChild(o, "value")) == NULL || XmlGetText(v) == NULL)
continue;
- if ((str = xmlGetAttrValue(o, _T("label"))) == NULL)
- str = xmlGetText(v);
+ if ((str = XmlGetAttrValue(o, _T("label"))) == NULL)
+ str = XmlGetText(v);
if (str == NULL)
continue;
bool selected = false;
for (int k = 0;; k++) {
- vs = xmlGetChild(n, k);
+ vs = XmlGetChild(n, k);
if (!vs)
break;
- if (!mir_tstrcmp(xmlGetName(vs), _T("value")) && !mir_tstrcmp(xmlGetText(vs), xmlGetText(v))) {
+ if (!mir_tstrcmp(XmlGetName(vs), _T("value")) && !mir_tstrcmp(XmlGetText(vs), XmlGetText(v))) {
selected = true;
break;
}
@@ -579,7 +579,7 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
const TCHAR *varName, *type, *fieldStr, *labelText, *str2;
TCHAR *p, *q, *str;
- if (xNode == NULL || xmlGetName(xNode) == NULL || mir_tstrcmp(xmlGetName(xNode), _T("x")) || hwndStatic == NULL)
+ if (xNode == NULL || XmlGetName(xNode) == NULL || mir_tstrcmp(XmlGetName(xNode), _T("x")) || hwndStatic == NULL)
return NULL;
hFrame = hwndStatic;
@@ -588,15 +588,15 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
x << XATTR(_T("xmlns"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("submit"));
for (int i = 0;; i++) {
- n = xmlGetChild(xNode, i);
+ n = XmlGetChild(xNode, i);
if (!n)
break;
fieldStr = NULL;
- if (mir_tstrcmp(xmlGetName(n), _T("field")))
+ if (mir_tstrcmp(XmlGetName(n), _T("field")))
continue;
- if ((varName = xmlGetAttrValue(n, _T("var"))) == NULL || (type = xmlGetAttrValue(n, _T("type"))) == NULL)
+ if ((varName = XmlGetAttrValue(n, _T("var"))) == NULL || (type = XmlGetAttrValue(n, _T("type"))) == NULL)
continue;
hCtrl = GetDlgItem(hFrame, id);
@@ -628,14 +628,14 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
GetDlgItemText(hFrame, id, str, len + 1);
v = NULL;
for (j = 0;; j++) {
- o = xmlGetChild(n, j);
+ o = XmlGetChild(n, j);
if (!o)
break;
- if (!mir_tstrcmp(xmlGetName(o), _T("option"))) {
- if ((v = xmlGetChild(o, "value")) != NULL && xmlGetText(v)) {
- if ((str2 = xmlGetAttrValue(o, _T("label"))) == NULL)
- str2 = xmlGetText(v);
+ if (!mir_tstrcmp(XmlGetName(o), _T("option"))) {
+ if ((v = XmlGetChild(o, "value")) != NULL && XmlGetText(v)) {
+ if ((str2 = XmlGetAttrValue(o, _T("label"))) == NULL)
+ str2 = XmlGetText(v);
if (!mir_tstrcmp(str2, str))
break;
}
@@ -643,7 +643,7 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
}
if (o)
- field << XCHILD(_T("value"), xmlGetText(v));
+ field << XCHILD(_T("value"), XmlGetText(v));
mir_free(str);
id++;
@@ -657,17 +657,17 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
if ((str = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR))) != NULL) {
SendMessage(hCtrl, LB_GETTEXT, j, (LPARAM)str);
for (k = 0;; k++) {
- o = xmlGetChild(n, k);
+ o = XmlGetChild(n, k);
if (!o)
break;
- if (xmlGetName(o) && !mir_tstrcmp(xmlGetName(o), _T("option"))) {
- if ((v = xmlGetChild(o, "value")) != NULL && xmlGetText(v)) {
- if ((labelText = xmlGetAttrValue(o, _T("label"))) == NULL)
- labelText = xmlGetText(v);
+ if (XmlGetName(o) && !mir_tstrcmp(XmlGetName(o), _T("option"))) {
+ if ((v = XmlGetChild(o, "value")) != NULL && XmlGetText(v)) {
+ if ((labelText = XmlGetAttrValue(o, _T("label"))) == NULL)
+ labelText = XmlGetText(v);
if (!mir_tstrcmp(labelText, str))
- field << XCHILD(_T("value"), xmlGetText(v));
+ field << XCHILD(_T("value"), XmlGetText(v));
}
}
}
@@ -678,9 +678,9 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
id++;
}
else if (!mir_tstrcmp(type, _T("fixed")) || !mir_tstrcmp(type, _T("hidden"))) {
- v = xmlGetChild(n, "value");
- if (v != NULL && xmlGetText(v) != NULL)
- field << XCHILD(_T("value"), xmlGetText(v));
+ v = XmlGetChild(n, "value");
+ if (v != NULL && XmlGetText(v) != NULL)
+ field << XCHILD(_T("value"), XmlGetText(v));
}
else { // everything else is considered "text-single" or "text-private"
len = GetWindowTextLength(GetDlgItem(hFrame, id));
@@ -692,7 +692,7 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
}
}
- return xi.copyNode(x);
+ return xmlCopyNode(x);
}
struct JABBER_FORM_INFO
@@ -724,17 +724,17 @@ static INT_PTR CALLBACK JabberFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
HXML n;
LONG frameExStyle;
// Set dialog title
- if (jfi->xNode != NULL && (n = xmlGetChild(jfi->xNode, _T("title"))) != NULL && xmlGetText(n) != NULL)
- SetWindowText(hwndDlg, xmlGetText(n));
+ if (jfi->xNode != NULL && (n = XmlGetChild(jfi->xNode, _T("title"))) != NULL && XmlGetText(n) != NULL)
+ SetWindowText(hwndDlg, XmlGetText(n));
else
SetWindowText(hwndDlg, TranslateTS(jfi->defTitle));
// Set instruction field
- if (jfi->xNode != NULL && (n = xmlGetChild(jfi->xNode, _T("instructions"))) != NULL && xmlGetText(n) != NULL)
- JabberFormSetInstruction(hwndDlg, xmlGetText(n));
+ if (jfi->xNode != NULL && (n = XmlGetChild(jfi->xNode, _T("instructions"))) != NULL && XmlGetText(n) != NULL)
+ JabberFormSetInstruction(hwndDlg, XmlGetText(n));
else {
- if (jfi->xNode != NULL && (n = xmlGetChild(jfi->xNode, _T("title"))) != NULL && xmlGetText(n) != NULL)
- JabberFormSetInstruction(hwndDlg, xmlGetText(n));
+ if (jfi->xNode != NULL && (n = XmlGetChild(jfi->xNode, _T("title"))) != NULL && XmlGetText(n) != NULL)
+ JabberFormSetInstruction(hwndDlg, XmlGetText(n));
else
JabberFormSetInstruction(hwndDlg, TranslateTS(jfi->defTitle));
}
@@ -826,7 +826,7 @@ static INT_PTR CALLBACK JabberFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
if (jfi != NULL) {
HXML n = JabberFormGetData(GetDlgItem(hwndDlg, IDC_FRAME), jfi->xNode);
(jfi->ppro->*(jfi->pfnSubmit))(n, jfi->userdata);
- xi.destroyNode(n);
+ xmlDestroyNode(n);
}
// fall through
case IDCANCEL:
@@ -859,7 +859,7 @@ void CJabberProto::FormCreateDialog(HXML xNode, TCHAR* defTitle, JABBER_FORM_SUB
JABBER_FORM_INFO *jfi = new JABBER_FORM_INFO;
memset(jfi, 0, sizeof(JABBER_FORM_INFO));
jfi->ppro = this;
- jfi->xNode = xi.copyNode(xNode);
+ jfi->xNode = xmlCopyNode(xNode);
if (defTitle)
_tcsncpy_s(jfi->defTitle, defTitle, _TRUNCATE);
jfi->pfnSubmit = pfnSubmit;
@@ -872,6 +872,6 @@ void CJabberProto::FormCreateDialog(HXML xNode, TCHAR* defTitle, JABBER_FORM_SUB
JABBER_FORM_INFO::~JABBER_FORM_INFO()
{
- xi.destroyNode(xNode);
+ xmlDestroyNode(xNode);
mir_free(userdata);
}
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp
index fbc4db5b45..41955dc4e5 100644
--- a/protocols/JabberG/src/jabber_ft.cpp
+++ b/protocols/JabberG/src/jabber_ft.cpp
@@ -130,17 +130,17 @@ void CJabberProto::OnFtSiResult(HXML iqNode, CJabberIqInfo *pInfo)
if (!ft) return;
if ((pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) && pInfo->m_szFrom && pInfo->m_szTo) {
- if ((siNode = xmlGetChild(iqNode , "si")) != NULL) {
+ if ((siNode = XmlGetChild(iqNode , "si")) != NULL) {
// fix for very smart clients, like gajim
BOOL bDirect = m_options.BsDirect;
BOOL bProxy = m_options.BsProxyManual;
- if ((featureNode = xmlGetChild(siNode , "feature")) != NULL) {
- if ((xNode = xmlGetChildByTag(featureNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS)) != NULL) {
- if ((fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("stream-method"))) != NULL) {
- if ((valueNode = xmlGetChild(fieldNode , "value")) != NULL && xmlGetText(valueNode) != NULL) {
- if ((bDirect || bProxy) && !mir_tstrcmp(xmlGetText(valueNode), JABBER_FEAT_BYTESTREAMS)) {
+ if ((featureNode = XmlGetChild(siNode , "feature")) != NULL) {
+ if ((xNode = XmlGetChildByTag(featureNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS)) != NULL) {
+ if ((fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("stream-method"))) != NULL) {
+ if ((valueNode = XmlGetChild(fieldNode , "value")) != NULL && XmlGetText(valueNode) != NULL) {
+ if ((bDirect || bProxy) && !mir_tstrcmp(XmlGetText(valueNode), JABBER_FEAT_BYTESTREAMS)) {
// Start Bytestream session
JABBER_BYTE_TRANSFER *jbt = new JABBER_BYTE_TRANSFER;
memset(jbt, 0, sizeof(JABBER_BYTE_TRANSFER));
@@ -154,7 +154,7 @@ void CJabberProto::OnFtSiResult(HXML iqNode, CJabberIqInfo *pInfo)
ft->jbt = jbt;
ForkThread((MyThreadFunc)&CJabberProto::ByteSendThread, jbt);
}
- else if (!mir_tstrcmp(xmlGetText(valueNode), JABBER_FEAT_IBB)) {
+ else if (!mir_tstrcmp(XmlGetText(valueNode), JABBER_FEAT_IBB)) {
JABBER_IBB_TRANSFER *jibb = (JABBER_IBB_TRANSFER *) mir_alloc(sizeof (JABBER_IBB_TRANSFER));
memset(jibb, 0, sizeof(JABBER_IBB_TRANSFER));
jibb->srcJID = mir_tstrdup(pInfo->m_szTo);
@@ -232,7 +232,7 @@ BOOL CJabberProto::FtIbbSend(int blocksize, filetransfer *ft)
while ((numRead = _read(fd, buffer, blocksize)) > 0) {
int iqId = SerialNext();
XmlNode msg(_T("message"));
- xmlAddAttr(msg, _T("to"), ft->jibb->dstJID);
+ XmlAddAttr(msg, _T("to"), ft->jibb->dstJID);
msg << XATTRID(iqId);
// let others send data too
@@ -300,21 +300,21 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode)
unsigned __int64 filesize;
if (!iqNode ||
- (from = xmlGetAttrValue(iqNode, _T("from"))) == NULL ||
- (str = xmlGetAttrValue(iqNode, _T("type"))) == NULL || mir_tstrcmp(str, _T("set")) ||
- (siNode = xmlGetChildByTag(iqNode, "si", "xmlns", JABBER_FEAT_SI)) == NULL)
+ (from = XmlGetAttrValue(iqNode, _T("from"))) == NULL ||
+ (str = XmlGetAttrValue(iqNode, _T("type"))) == NULL || mir_tstrcmp(str, _T("set")) ||
+ (siNode = XmlGetChildByTag(iqNode, "si", "xmlns", JABBER_FEAT_SI)) == NULL)
return;
- szId = xmlGetAttrValue(iqNode, _T("id"));
- if ((sid = xmlGetAttrValue(siNode, _T("id"))) != NULL &&
- (fileNode = xmlGetChildByTag(siNode, "file", "xmlns", JABBER_FEAT_SI_FT)) != NULL &&
- (filename = xmlGetAttrValue(fileNode, _T("name"))) != NULL &&
- (str = xmlGetAttrValue(fileNode, _T("size"))) != NULL) {
+ szId = XmlGetAttrValue(iqNode, _T("id"));
+ if ((sid = XmlGetAttrValue(siNode, _T("id"))) != NULL &&
+ (fileNode = XmlGetChildByTag(siNode, "file", "xmlns", JABBER_FEAT_SI_FT)) != NULL &&
+ (filename = XmlGetAttrValue(fileNode, _T("name"))) != NULL &&
+ (str = XmlGetAttrValue(fileNode, _T("size"))) != NULL) {
filesize = _ttoi64(str);
- if ((featureNode = xmlGetChildByTag(siNode, "feature", "xmlns", JABBER_FEAT_FEATURE_NEG)) != NULL &&
- (xNode = xmlGetChildByTag(featureNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS)) != NULL &&
- (fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("stream-method"))) != NULL) {
+ if ((featureNode = XmlGetChildByTag(siNode, "feature", "xmlns", JABBER_FEAT_FEATURE_NEG)) != NULL &&
+ (xNode = XmlGetChildByTag(featureNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS)) != NULL &&
+ (fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("stream-method"))) != NULL) {
BOOL bIbbOnly = m_options.BsOnlyIBB;
HXML optionNode = NULL;
@@ -322,13 +322,13 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode)
if (!bIbbOnly) {
for (i=0; ; i++) {
- optionNode = xmlGetChild(fieldNode ,i);
+ optionNode = XmlGetChild(fieldNode ,i);
if (!optionNode)
break;
- if (!mir_tstrcmp(xmlGetName(optionNode), _T("option"))) {
- if ((n = xmlGetChild(optionNode , "value")) != NULL && xmlGetText(n)) {
- if (!mir_tstrcmp(xmlGetText(n), JABBER_FEAT_BYTESTREAMS)) {
+ if (!mir_tstrcmp(XmlGetName(optionNode), _T("option"))) {
+ if ((n = XmlGetChild(optionNode , "value")) != NULL && XmlGetText(n)) {
+ if (!mir_tstrcmp(XmlGetText(n), JABBER_FEAT_BYTESTREAMS)) {
ftType = FT_BYTESTREAM;
break;
} } } } }
@@ -336,13 +336,13 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode)
// try IBB only if bytestreams support not found or BsOnlyIBB flag exists
if (bIbbOnly || !optionNode) {
for (i=0; ; i++) {
- optionNode = xmlGetChild(fieldNode ,i);
+ optionNode = XmlGetChild(fieldNode ,i);
if (!optionNode)
break;
- if (!mir_tstrcmp(xmlGetName(optionNode), _T("option"))) {
- if ((n = xmlGetChild(optionNode , "value")) != NULL && xmlGetText(n)) {
- if (!mir_tstrcmp(xmlGetText(n), JABBER_FEAT_IBB)) {
+ if (!mir_tstrcmp(XmlGetName(optionNode), _T("option"))) {
+ if ((n = XmlGetChild(optionNode , "value")) != NULL && XmlGetText(n)) {
+ if (!mir_tstrcmp(XmlGetText(n), JABBER_FEAT_IBB)) {
ftType = FT_IBB;
break;
} } } } }
@@ -366,8 +366,8 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode)
pre.timestamp = time(NULL);
pre.files.t = (TCHAR**)&filename;
pre.lParam = (LPARAM)ft;
- if ((n = xmlGetChild(fileNode , "desc")) != NULL)
- pre.descr.t = (TCHAR*)xmlGetText(n);
+ if ((n = XmlGetChild(fileNode , "desc")) != NULL)
+ pre.descr.t = (TCHAR*)XmlGetText(n);
ProtoChainRecvFile(ft->std.hContact, &pre);
return;
@@ -431,11 +431,11 @@ BOOL CJabberProto::FtHandleBytestreamRequest(HXML iqNode, CJabberIqInfo *pInfo)
const TCHAR *sid;
JABBER_LIST_ITEM *item;
- if ((sid = xmlGetAttrValue(queryNode, _T("sid"))) != NULL && (item = ListGetItemPtr(LIST_FTRECV, sid)) != NULL) {
+ if ((sid = XmlGetAttrValue(queryNode, _T("sid"))) != NULL && (item = ListGetItemPtr(LIST_FTRECV, sid)) != NULL) {
// Start Bytestream session
JABBER_BYTE_TRANSFER *jbt = new JABBER_BYTE_TRANSFER;
memset(jbt, 0, sizeof(JABBER_BYTE_TRANSFER));
- jbt->iqNode = xi.copyNode(iqNode);
+ jbt->iqNode = xmlCopyNode(iqNode);
jbt->pfnRecv = &CJabberProto::FtReceive;
jbt->pfnFinal = &CJabberProto::FtReceiveFinal;
jbt->ft = item->ft;
@@ -453,15 +453,15 @@ BOOL CJabberProto::FtHandleIbbRequest(HXML iqNode, BOOL bOpen)
{
if (iqNode == NULL) return FALSE;
- const TCHAR *id = xmlGetAttrValue(iqNode, _T("id"));
- const TCHAR *from = xmlGetAttrValue(iqNode, _T("from"));
- const TCHAR *to = xmlGetAttrValue(iqNode, _T("to"));
+ const TCHAR *id = XmlGetAttrValue(iqNode, _T("id"));
+ const TCHAR *from = XmlGetAttrValue(iqNode, _T("from"));
+ const TCHAR *to = XmlGetAttrValue(iqNode, _T("to"));
if (!id || !from || !to) return FALSE;
- HXML ibbNode = xmlGetChildByTag(iqNode, bOpen ? "open" : "close", "xmlns", JABBER_FEAT_IBB);
+ HXML ibbNode = XmlGetChildByTag(iqNode, bOpen ? "open" : "close", "xmlns", JABBER_FEAT_IBB);
if (!ibbNode) return FALSE;
- const TCHAR *sid = xmlGetAttrValue(ibbNode, _T("sid"));
+ const TCHAR *sid = XmlGetAttrValue(ibbNode, _T("sid"));
if (!sid) return FALSE;
// already closed?
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index fb1e164ece..6b38a3ee49 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -296,7 +296,7 @@ void CJabberProto::OnIqResultDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
SendMessage(hwndList, CB_RESETCONTENT, 0, 0);
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
- HXML query = xmlGetChild(iqNode, "query");
+ HXML query = XmlGetChild(iqNode, "query");
if (query == NULL) {
sttRoomListAppend(hwndList, RoomInfo::ROOM_FAIL,
TranslateT("Jabber Error"),
@@ -306,8 +306,8 @@ void CJabberProto::OnIqResultDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
else {
bool found = false;
HXML item;
- for (int i = 1; item = xmlGetNthChild(query, _T("item"), i); i++) {
- const TCHAR *jid = xmlGetAttrValue(item, _T("jid"));
+ for (int i = 1; item = XmlGetNthChild(query, _T("item"), i); i++) {
+ const TCHAR *jid = XmlGetAttrValue(item, _T("jid"));
TCHAR *name = NEWTSTR_ALLOCA(jid);
if (name) {
if (TCHAR *p = _tcschr(name, _T('@')))
@@ -317,7 +317,7 @@ void CJabberProto::OnIqResultDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
sttRoomListAppend(hwndList,
ListGetItemPtr(LIST_BOOKMARK, jid) ? RoomInfo::ROOM_BOOKMARK : RoomInfo::ROOM_DEFAULT,
- xmlGetAttrValue(item, _T("name")),
+ XmlGetAttrValue(item, _T("name")),
jid, name);
found = true;
@@ -332,7 +332,7 @@ void CJabberProto::OnIqResultDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
}
}
else if (pInfo->GetIqType() == JABBER_IQ_TYPE_ERROR) {
- HXML errorNode = xmlGetChild(iqNode, "error");
+ HXML errorNode = XmlGetChild(iqNode, "error");
TCHAR *str = JabberErrorMsg(errorNode);
sttRoomListAppend(hwndList, RoomInfo::ROOM_FAIL,
TranslateT("Jabber Error"),
@@ -770,11 +770,11 @@ static VOID CALLBACK JabberGroupchatChangeNickname(void* arg)
static int sttGetStatusCode(HXML node)
{
- HXML statusNode = xmlGetChild(node, "status");
+ HXML statusNode = XmlGetChild(node, "status");
if (statusNode == NULL)
return -1;
- const TCHAR *statusCode = xmlGetAttrValue(statusNode, _T("code"));
+ const TCHAR *statusCode = XmlGetAttrValue(statusNode, _T("code"));
if (statusCode == NULL)
return -1;
@@ -783,8 +783,8 @@ static int sttGetStatusCode(HXML node)
void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const TCHAR *oldNick, HXML itemNode)
{
- const TCHAR *jid = xmlGetAttrValue(itemNode, _T("jid"));
- const TCHAR *newNick = xmlGetAttrValue(itemNode, _T("nick"));
+ const TCHAR *jid = XmlGetAttrValue(itemNode, _T("jid"));
+ const TCHAR *newNick = XmlGetAttrValue(itemNode, _T("nick"));
if (newNick == NULL)
return;
@@ -822,8 +822,8 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
{
const TCHAR *from;
- if (!node || !xmlGetName(node) || mir_tstrcmp(xmlGetName(node), _T("presence"))) return;
- if ((from = xmlGetAttrValue(node, _T("from"))) == NULL) return;
+ if (!node || !XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("presence"))) return;
+ if ((from = XmlGetAttrValue(node, _T("from"))) == NULL) return;
const TCHAR *resource = _tcschr(from, '/');
if (resource == NULL || *++resource == '\0')
@@ -835,18 +835,18 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
pResourceStatus r(item->findResource(resource));
- HXML nNode = xmlGetChildByTag(node, "nick", "xmlns", JABBER_FEAT_NICK);
- const TCHAR *cnick = xmlGetText(nNode);
+ HXML nNode = XmlGetChildByTag(node, "nick", "xmlns", JABBER_FEAT_NICK);
+ const TCHAR *cnick = XmlGetText(nNode);
const TCHAR *nick = cnick ? cnick : (r && r->m_tszNick ? r->m_tszNick : resource);
// process custom nick change
if (cnick && r && r->m_tszNick && mir_tstrcmp(cnick, r->m_tszNick))
r->m_tszNick = mir_tstrdup(cnick);
- HXML xNode = xmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_MUC_USER);
- HXML itemNode = xmlGetChild(xNode, "item");
+ HXML xNode = XmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_MUC_USER);
+ HXML itemNode = XmlGetChild(xNode, "item");
- const TCHAR *type = xmlGetAttrValue(node, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(node, _T("type"));
// entering room or a usual room presence
if (type == NULL || !mir_tstrcmp(type, _T("available"))) {
@@ -858,7 +858,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
// Update status of room participant
int status = ID_STATUS_ONLINE;
- LPCTSTR ptszShow = xmlGetText(xmlGetChild(node, "show"));
+ LPCTSTR ptszShow = XmlGetText(XmlGetChild(node, "show"));
if (ptszShow) {
if (!mir_tstrcmp(ptszShow, _T("away"))) status = ID_STATUS_AWAY;
else if (!mir_tstrcmp(ptszShow, _T("xa"))) status = ID_STATUS_NA;
@@ -866,10 +866,10 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
else if (!mir_tstrcmp(ptszShow, _T("chat"))) status = ID_STATUS_FREECHAT;
}
- LPCTSTR str = xmlGetText(xmlGetChild(node, "status"));
+ LPCTSTR str = XmlGetText(XmlGetChild(node, "status"));
char priority = 0;
- if (LPCTSTR ptszPriority = xmlGetText(xmlGetChild(node, "priority")))
+ if (LPCTSTR ptszPriority = XmlGetText(XmlGetChild(node, "priority")))
priority = (char)_ttoi(ptszPriority);
bool bStatusChanged = false, bRoomCreated = false, bAffiliationChanged = false, bRoleChanged = false;
@@ -887,14 +887,14 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
JABBER_GC_AFFILIATION affiliation = r->m_affiliation;
JABBER_GC_ROLE role = r->m_role;
- if ((str = xmlGetAttrValue(itemNode, _T("affiliation"))) != NULL) {
+ if ((str = XmlGetAttrValue(itemNode, _T("affiliation"))) != NULL) {
if (!mir_tstrcmp(str, _T("owner"))) affiliation = AFFILIATION_OWNER;
else if (!mir_tstrcmp(str, _T("admin"))) affiliation = AFFILIATION_ADMIN;
else if (!mir_tstrcmp(str, _T("member"))) affiliation = AFFILIATION_MEMBER;
else if (!mir_tstrcmp(str, _T("none"))) affiliation = AFFILIATION_NONE;
else if (!mir_tstrcmp(str, _T("outcast"))) affiliation = AFFILIATION_OUTCAST;
}
- if ((str = xmlGetAttrValue(itemNode, _T("role"))) != NULL) {
+ if ((str = XmlGetAttrValue(itemNode, _T("role"))) != NULL) {
if (!mir_tstrcmp(str, _T("moderator"))) role = ROLE_MODERATOR;
else if (!mir_tstrcmp(str, _T("participant"))) role = ROLE_PARTICIPANT;
else if (!mir_tstrcmp(str, _T("visitor"))) role = ROLE_VISITOR;
@@ -917,7 +917,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
bRoleChanged = true;
}
- if (str = xmlGetAttrValue(itemNode, _T("jid")))
+ if (str = XmlGetAttrValue(itemNode, _T("jid")))
r->m_tszRealJid = mir_tstrdup(str);
}
}
@@ -942,8 +942,8 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
// Check <created/>
if (bRoomCreated) {
- HXML n = xmlGetChild(node, "created");
- if (n != NULL && (str = xmlGetAttrValue(n, _T("xmlns"))) != NULL && !mir_tstrcmp(str, JABBER_FEAT_MUC_OWNER))
+ HXML n = XmlGetChild(node, "created");
+ if (n != NULL && (str = XmlGetAttrValue(n, _T("xmlns"))) != NULL && !mir_tstrcmp(str, JABBER_FEAT_MUC_OWNER))
// A new room just created by me
// Request room config
m_ThreadInfo->send(
@@ -956,8 +956,8 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
else if (!mir_tstrcmp(type, _T("unavailable"))) {
const TCHAR *str = 0;
if (xNode != NULL && item->nick != NULL) {
- HXML reasonNode = xmlGetChild(itemNode, "reason");
- str = xmlGetAttrValue(itemNode, _T("jid"));
+ HXML reasonNode = XmlGetChild(itemNode, "reason");
+ str = XmlGetAttrValue(itemNode, _T("jid"));
int iStatus = sttGetStatusCode(xNode);
if (iStatus == 301 && r != NULL)
@@ -991,7 +991,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
}
}
- HXML statusNode = xmlGetChild(node, "status");
+ HXML statusNode = XmlGetChild(node, "status");
GcLogUpdateMemberStatus(item, resource, nick, str, GC_EVENT_PART, statusNode);
ListRemoveResource(LIST_CHATROOM, from);
@@ -1003,7 +1003,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
// processing room errors
else if (!mir_tstrcmp(type, _T("error"))) {
int errorCode = 0;
- HXML errorNode = xmlGetChild(node, "error");
+ HXML errorNode = XmlGetChild(node, "error");
ptrT str(JabberErrorMsg(errorNode, &errorCode));
if (errorCode == JABBER_ERROR_CONFLICT) {
@@ -1035,11 +1035,11 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
JABBER_LIST_ITEM *item;
CMString imgLink;
- if (!xmlGetName(node) || mir_tstrcmp(xmlGetName(node), _T("message"))) return;
- if ((from = xmlGetAttrValue(node, _T("from"))) == NULL) return;
+ if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("message"))) return;
+ if ((from = XmlGetAttrValue(node, _T("from"))) == NULL) return;
if ((item = ListGetItemPtr(LIST_CHATROOM, from)) == NULL) return;
- if ((type = xmlGetAttrValue(node, _T("type"))) == NULL) return;
+ if ((type = XmlGetAttrValue(node, _T("type"))) == NULL) return;
if (!mir_tstrcmp(type, _T("error")))
return;
@@ -1051,15 +1051,15 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
if (resource != NULL && *++resource == '\0')
resource = NULL;
- if ((n = xmlGetChild(node, "subject")) != NULL) {
- msgText = xmlGetText(n);
+ if ((n = XmlGetChild(node, "subject")) != NULL) {
+ msgText = XmlGetText(n);
if (msgText == NULL || msgText[0] == '\0')
return;
gcd.iType = GC_EVENT_TOPIC;
- if (resource == NULL && (m = xmlGetChild(node, "body")) != NULL) {
- const TCHAR *tmpnick = xmlGetText(m);
+ if (resource == NULL && (m = XmlGetChild(node, "body")) != NULL) {
+ const TCHAR *tmpnick = XmlGetText(m);
if (tmpnick == NULL || *tmpnick == 0)
return;
@@ -1076,11 +1076,11 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
else {
imgLink = ExtractImage(node);
- if ((n = xmlGetChildByTag(node, "body", "xml:lang", m_tszSelectedLang)) == NULL)
- if ((n = xmlGetChild(node, "body")) == NULL)
+ if ((n = XmlGetChildByTag(node, "body", "xml:lang", m_tszSelectedLang)) == NULL)
+ if ((n = XmlGetChild(node, "body")) == NULL)
return;
- msgText = xmlGetText(n);
+ msgText = XmlGetText(n);
if (msgText == NULL)
return;
@@ -1097,8 +1097,8 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
time_t msgTime = 0;
if (!JabberReadXep203delay(node, msgTime)) {
- HXML xDelay = xmlGetChildByTag(node, "x", "xmlns", _T("jabber:x:delay"));
- if (xDelay && (p = xmlGetAttrValue(xDelay, _T("stamp"))) != NULL)
+ HXML xDelay = XmlGetChildByTag(node, "x", "xmlns", _T("jabber:x:delay"));
+ if (xDelay && (p = XmlGetAttrValue(xDelay, _T("stamp"))) != NULL)
msgTime = JabberIsoToUnixTime(p);
}
diff --git a/protocols/JabberG/src/jabber_ibb.cpp b/protocols/JabberG/src/jabber_ibb.cpp
index 61094fb023..8177cd4942 100644
--- a/protocols/JabberG/src/jabber_ibb.cpp
+++ b/protocols/JabberG/src/jabber_ibb.cpp
@@ -52,10 +52,10 @@ BOOL CJabberProto::OnFtHandleIbbIq(HXML iqNode, CJabberIqInfo *pInfo)
FtHandleIbbRequest(iqNode, FALSE);
else if (!mir_tstrcmp(pInfo->GetChildNodeName(), _T("data"))) {
BOOL bOk = FALSE;
- const TCHAR *sid = xmlGetAttrValue(pInfo->GetChildNode(), _T("sid"));
- const TCHAR *seq = xmlGetAttrValue(pInfo->GetChildNode(), _T("seq"));
- if (sid && seq && xmlGetText(pInfo->GetChildNode()))
- bOk = OnIbbRecvdData(xmlGetText(pInfo->GetChildNode()), sid, seq);
+ const TCHAR *sid = XmlGetAttrValue(pInfo->GetChildNode(), _T("sid"));
+ const TCHAR *seq = XmlGetAttrValue(pInfo->GetChildNode(), _T("seq"));
+ if (sid && seq && XmlGetText(pInfo->GetChildNode()))
+ bOk = OnIbbRecvdData(XmlGetText(pInfo->GetChildNode()), sid, seq);
if (bOk)
m_ThreadInfo->send( XmlNodeIq(_T("result"), pInfo));
diff --git a/protocols/JabberG/src/jabber_iq.cpp b/protocols/JabberG/src/jabber_iq.cpp
index 5669757ee9..34d35a7fc4 100644
--- a/protocols/JabberG/src/jabber_iq.cpp
+++ b/protocols/JabberG/src/jabber_iq.cpp
@@ -240,7 +240,7 @@ bool CJabberIqManager::HandleIq(int nIqId, HXML pNode)
if (nIqId == -1 || pNode == NULL)
return false;
- const TCHAR *szType = xmlGetAttrValue(pNode, _T("type"));
+ const TCHAR *szType = XmlGetAttrValue(pNode, _T("type"));
if (!szType)
return false;
@@ -260,24 +260,24 @@ bool CJabberIqManager::HandleIq(int nIqId, HXML pNode)
pInfo->m_nIqType = nIqType;
if (nIqType == JABBER_IQ_TYPE_RESULT) {
if (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_CHILD_TAG_NODE)
- pInfo->m_pChildNode = xmlGetChild(pNode , 0);
+ pInfo->m_pChildNode = XmlGetChild(pNode , 0);
if (pInfo->m_pChildNode && (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_CHILD_TAG_NAME))
- pInfo->m_szChildTagName = (TCHAR*)xmlGetName(pInfo->m_pChildNode);
+ pInfo->m_szChildTagName = (TCHAR*)XmlGetName(pInfo->m_pChildNode);
if (pInfo->m_pChildNode && (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_CHILD_TAG_XMLNS))
- pInfo->m_szChildTagXmlns = (TCHAR*)xmlGetAttrValue(pNode, _T("xmlns"));
+ pInfo->m_szChildTagXmlns = (TCHAR*)XmlGetAttrValue(pNode, _T("xmlns"));
}
if (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_TO)
- pInfo->m_szTo = (TCHAR*)xmlGetAttrValue(pNode, _T("to"));
+ pInfo->m_szTo = (TCHAR*)XmlGetAttrValue(pNode, _T("to"));
if (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_FROM)
- pInfo->m_szFrom = (TCHAR*)xmlGetAttrValue(pNode, _T("from"));
+ pInfo->m_szFrom = (TCHAR*)XmlGetAttrValue(pNode, _T("from"));
if (pInfo->m_szFrom && (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_HCONTACT))
pInfo->m_hContact = ppro->HContactFromJID(pInfo->m_szFrom, 3);
if (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_ID_STR)
- pInfo->m_szId = (TCHAR*)xmlGetAttrValue(pNode, _T("id"));
+ pInfo->m_szId = (TCHAR*)XmlGetAttrValue(pNode, _T("id"));
(ppro->*(pInfo->m_pHandler))(pNode, pInfo);
delete pInfo;
@@ -291,7 +291,7 @@ bool CJabberIqManager::HandleIqPermanent(HXML pNode)
for (int i = 0; i < m_arHandlers.getCount(); i++) {
CJabberIqPermanentInfo &pInfo = m_arHandlers[i];
// have to get all data here, in the loop, because there's always possibility that previous handler modified it
- const TCHAR *szType = xmlGetAttrValue(pNode, _T("type"));
+ const TCHAR *szType = XmlGetAttrValue(pNode, _T("type"));
if (!szType)
return FALSE;
@@ -307,12 +307,12 @@ bool CJabberIqManager::HandleIqPermanent(HXML pNode)
if (!(pInfo.m_nIqTypes & iqInfo.m_nIqType))
continue;
- HXML pFirstChild = xmlGetChild(pNode , 0);
- if (!pFirstChild || !xmlGetName(pFirstChild))
+ HXML pFirstChild = XmlGetChild(pNode , 0);
+ if (!pFirstChild || !XmlGetName(pFirstChild))
return FALSE;
- const TCHAR *szTagName = xmlGetName(pFirstChild);
- const TCHAR *szXmlns = xmlGetAttrValue(pFirstChild, _T("xmlns"));
+ const TCHAR *szTagName = XmlGetName(pFirstChild);
+ const TCHAR *szXmlns = XmlGetAttrValue(pFirstChild, _T("xmlns"));
if ((!pInfo.m_szXmlns || (szXmlns && !mir_tstrcmp(pInfo.m_szXmlns, szXmlns))) &&
(!pInfo.m_szTag || !mir_tstrcmp(pInfo.m_szTag, szTagName)))
@@ -321,14 +321,14 @@ bool CJabberIqManager::HandleIqPermanent(HXML pNode)
iqInfo.m_pChildNode = pFirstChild;
iqInfo.m_szChildTagName = (TCHAR*)szTagName;
iqInfo.m_szChildTagXmlns = (TCHAR*)szXmlns;
- iqInfo.m_szId = (TCHAR*)xmlGetAttrValue(pNode, _T("id"));
+ iqInfo.m_szId = (TCHAR*)XmlGetAttrValue(pNode, _T("id"));
iqInfo.m_pUserData = pInfo.m_pUserData;
if (pInfo.m_dwParamsToParse & JABBER_IQ_PARSE_TO)
- iqInfo.m_szTo = (TCHAR*)xmlGetAttrValue(pNode, _T("to"));
+ iqInfo.m_szTo = (TCHAR*)XmlGetAttrValue(pNode, _T("to"));
if (pInfo.m_dwParamsToParse & JABBER_IQ_PARSE_FROM)
- iqInfo.m_szFrom = (TCHAR*)xmlGetAttrValue(pNode, _T("from"));
+ iqInfo.m_szFrom = (TCHAR*)XmlGetAttrValue(pNode, _T("from"));
if ((pInfo.m_dwParamsToParse & JABBER_IQ_PARSE_HCONTACT) && (iqInfo.m_szFrom))
iqInfo.m_hContact = ppro->HContactFromJID(iqInfo.m_szFrom, 3);
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index 909f05f939..5afce7aaa9 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -476,7 +476,7 @@ BOOL CJabberProto::OnIqRequestAvatar(HXML, CJabberIqInfo *pInfo)
BOOL CJabberProto::OnSiRequest(HXML node, CJabberIqInfo *pInfo)
{
- const TCHAR *szProfile = xmlGetAttrValue(pInfo->GetChildNode(), _T("profile"));
+ const TCHAR *szProfile = XmlGetAttrValue(pInfo->GetChildNode(), _T("profile"));
if (szProfile && !mir_tstrcmp(szProfile, JABBER_FEAT_SI_FT))
FtHandleSiRequest(node);
@@ -528,29 +528,29 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo)
MCONTACT hContact = NULL;
const TCHAR *jid, *str;
- debugLogA("<iq/> Got roster push, query has %d children", xmlGetChildCount(queryNode));
+ debugLogA("<iq/> Got roster push, query has %d children", XmlGetChildCount(queryNode));
for (int i = 0;; i++) {
- HXML itemNode = xmlGetChild(queryNode, i);
+ HXML itemNode = XmlGetChild(queryNode, i);
if (!itemNode)
break;
- if (mir_tstrcmp(xmlGetName(itemNode), _T("item")) != 0)
+ if (mir_tstrcmp(XmlGetName(itemNode), _T("item")) != 0)
continue;
- if ((jid = xmlGetAttrValue(itemNode, _T("jid"))) == NULL)
+ if ((jid = XmlGetAttrValue(itemNode, _T("jid"))) == NULL)
continue;
- if ((str = xmlGetAttrValue(itemNode, _T("subscription"))) == NULL)
+ if ((str = XmlGetAttrValue(itemNode, _T("subscription"))) == NULL)
continue;
// we will not add new account when subscription=remove
if (!mir_tstrcmp(str, _T("to")) || !mir_tstrcmp(str, _T("both")) || !mir_tstrcmp(str, _T("from")) || !mir_tstrcmp(str, _T("none"))) {
- const TCHAR *name = xmlGetAttrValue(itemNode, _T("name"));
+ const TCHAR *name = XmlGetAttrValue(itemNode, _T("name"));
ptrT nick((name != NULL) ? mir_tstrdup(name) : JabberNickFromJID(jid));
if (nick != NULL) {
if ((item = ListAdd(LIST_ROSTER, jid)) != NULL) {
replaceStrT(item->nick, nick);
- HXML groupNode = xmlGetChild(itemNode, "group");
- replaceStrT(item->group, xmlGetText(groupNode));
+ HXML groupNode = XmlGetChild(itemNode, "group");
+ replaceStrT(item->group, XmlGetText(groupNode));
if ((hContact = HContactFromJID(jid, 0)) == NULL) {
// Received roster has a new JID.
@@ -614,14 +614,14 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo)
if (!pInfo->GetFrom() || !pInfo->GetHContact())
return TRUE;
- HXML n = xmlGetChild(pInfo->GetChildNode(), "url");
- if (!n || !xmlGetText(n))
+ HXML n = XmlGetChild(pInfo->GetChildNode(), "url");
+ if (!n || !XmlGetText(n))
return TRUE;
if (m_options.BsOnlyIBB) {
// reject
XmlNodeIq iq(_T("error"), pInfo);
- HXML e = xmlAddChild(iq, _T("error"), _T("File transfer refused")); xmlAddAttr(e, _T("code"), 406);
+ HXML e = XmlAddChild(iq, _T("error"), _T("File transfer refused")); XmlAddAttr(e, _T("code"), 406);
m_ThreadInfo->send(iq);
return TRUE;
}
@@ -636,7 +636,7 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo)
ft->httpPath = NULL;
// Parse the URL
- TCHAR *str = (TCHAR*)xmlGetText(n); // URL of the file to get
+ TCHAR *str = (TCHAR*)XmlGetText(n); // URL of the file to get
if (!_tcsnicmp(str, _T("http://"), 7)) {
TCHAR *p = str + 7, *q;
if ((q = _tcschr(p, '/')) != NULL) {
@@ -660,8 +660,8 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo)
TCHAR *desc = NULL;
debugLogA("Host=%s Port=%d Path=%s", ft->httpHostName, ft->httpPort, ft->httpPath);
- if ((n = xmlGetChild(pInfo->GetChildNode(), "desc")) != NULL)
- desc = (TCHAR*)xmlGetText(n);
+ if ((n = XmlGetChild(pInfo->GetChildNode(), "desc")) != NULL)
+ desc = (TCHAR*)XmlGetText(n);
TCHAR *str2;
debugLog(_T("description = %s"), desc);
@@ -685,7 +685,7 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo)
else {
// reject
XmlNodeIq iq(_T("error"), pInfo);
- HXML e = xmlAddChild(iq, _T("error"), _T("File transfer refused")); xmlAddAttr(e, _T("code"), 406);
+ HXML e = XmlAddChild(iq, _T("error"), _T("File transfer refused")); XmlAddAttr(e, _T("code"), 406);
m_ThreadInfo->send(iq);
delete ft;
}
@@ -697,7 +697,7 @@ BOOL CJabberProto::OnHandleDiscoInfoRequest(HXML iqNode, CJabberIqInfo *pInfo)
if (!pInfo->GetChildNode())
return TRUE;
- const TCHAR *szNode = xmlGetAttrValue(pInfo->GetChildNode(), _T("node"));
+ const TCHAR *szNode = XmlGetAttrValue(pInfo->GetChildNode(), _T("node"));
// caps hack
if (m_clientCapsManager.HandleInfoRequest(iqNode, pInfo, szNode))
return TRUE;
@@ -720,7 +720,7 @@ BOOL CJabberProto::OnHandleDiscoItemsRequest(HXML iqNode, CJabberIqInfo *pInfo)
return TRUE;
// ad-hoc commands check:
- const TCHAR *szNode = xmlGetAttrValue(pInfo->GetChildNode(), _T("node"));
+ const TCHAR *szNode = XmlGetAttrValue(pInfo->GetChildNode(), _T("node"));
if (szNode && m_adhocManager.HandleItemsRequest(iqNode, pInfo, szNode))
return TRUE;
@@ -728,7 +728,7 @@ BOOL CJabberProto::OnHandleDiscoItemsRequest(HXML iqNode, CJabberIqInfo *pInfo)
XmlNodeIq iq(_T("result"), pInfo);
HXML resultQuery = iq << XQUERY(JABBER_FEAT_DISCO_ITEMS);
if (szNode)
- xmlAddAttr(resultQuery, _T("node"), szNode);
+ XmlAddAttr(resultQuery, _T("node"), szNode);
if (!szNode && m_options.EnableRemoteControl)
resultQuery << XCHILD(_T("item")) << XATTR(_T("jid"), m_ThreadInfo->fullJID)
@@ -763,13 +763,13 @@ BOOL CJabberProto::OnIqHttpAuth(HXML node, CJabberIqInfo *pInfo)
if (!node || !pInfo->GetChildNode() || !pInfo->GetFrom() || !pInfo->GetIdStr())
return TRUE;
- HXML pConfirm = xmlGetChild(node, "confirm");
+ HXML pConfirm = XmlGetChild(node, "confirm");
if (!pConfirm)
return TRUE;
- const TCHAR *szId = xmlGetAttrValue(pConfirm, _T("id"));
- const TCHAR *szMethod = xmlGetAttrValue(pConfirm, _T("method"));
- const TCHAR *szUrl = xmlGetAttrValue(pConfirm, _T("url"));
+ const TCHAR *szId = XmlGetAttrValue(pConfirm, _T("id"));
+ const TCHAR *szMethod = XmlGetAttrValue(pConfirm, _T("method"));
+ const TCHAR *szUrl = XmlGetAttrValue(pConfirm, _T("url"));
if (!szId || !szMethod || !szUrl)
return TRUE;
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index 3e1b65b3f0..9326a4264b 100644
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -34,20 +34,20 @@ void CJabberProto::OnIqResultServerDiscoInfo(HXML iqNode, CJabberIqInfo*)
if (iqNode == NULL)
return;
- const TCHAR *type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
if ( mir_tstrcmp(type, _T("result")))
return;
- HXML query = xmlGetChildByTag(iqNode, "query", "xmlns", JABBER_FEAT_DISCO_INFO);
+ HXML query = XmlGetChildByTag(iqNode, "query", "xmlns", JABBER_FEAT_DISCO_INFO);
if (query == NULL)
return;
HXML identity;
- for (int i = 1; (identity = xmlGetNthChild(query, _T("identity"), i)) != NULL; i++) {
+ for (int i = 1; (identity = XmlGetNthChild(query, _T("identity"), i)) != NULL; i++) {
JABBER_DISCO_FIELD tmp = {
- xmlGetAttrValue(identity, _T("category")),
- xmlGetAttrValue(identity, _T("type")),
- xmlGetAttrValue(identity, _T("name")) };
+ XmlGetAttrValue(identity, _T("category")),
+ XmlGetAttrValue(identity, _T("type")),
+ XmlGetAttrValue(identity, _T("name")) };
if (!mir_tstrcmp(tmp.category, _T("pubsub")) && !mir_tstrcmp(tmp.type, _T("pep"))) {
m_bPepSupported = true;
@@ -62,8 +62,8 @@ void CJabberProto::OnIqResultServerDiscoInfo(HXML iqNode, CJabberIqInfo*)
if (m_ThreadInfo) {
HXML feature;
- for (int i = 1; (feature = xmlGetNthChild(query, _T("feature"), i)) != NULL; i++) {
- const TCHAR *featureName = xmlGetAttrValue(feature, _T("var"));
+ for (int i = 1; (feature = XmlGetNthChild(query, _T("feature"), i)) != NULL; i++) {
+ const TCHAR *featureName = XmlGetAttrValue(feature, _T("var"));
if (!featureName)
continue;
@@ -208,21 +208,21 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo*)
HXML queryNode;
const TCHAR *type;
- if ((type = xmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
- if ((queryNode = xmlGetChild(iqNode, "query")) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
+ if ((queryNode = XmlGetChild(iqNode, "query")) == NULL) return;
if (!mir_tstrcmp(type, _T("result"))) {
XmlNodeIq iq(AddIQ(&CJabberProto::OnIqResultSetAuth, JABBER_IQ_TYPE_SET));
HXML query = iq << XQUERY(_T("jabber:iq:auth"));
query << XCHILD(_T("username"), m_ThreadInfo->conn.username);
- if (xmlGetChild(queryNode, "digest") != NULL && m_ThreadInfo->szStreamId) {
+ if (XmlGetChild(queryNode, "digest") != NULL && m_ThreadInfo->szStreamId) {
JabberShaStrBuf buf;
T2Utf str(m_ThreadInfo->conn.password);
char text[200];
mir_snprintf(text, _countof(text), "%s%s", m_ThreadInfo->szStreamId, str);
query << XCHILD(_T("digest"), _A2T(JabberSha1(text, buf)));
}
- else if (xmlGetChild(queryNode, "password") != NULL)
+ else if (XmlGetChild(queryNode, "password") != NULL)
query << XCHILD(_T("password"), m_ThreadInfo->conn.password);
else {
debugLogA("No known authentication mechanism accepted by the server.");
@@ -230,7 +230,7 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo*)
return;
}
- if (xmlGetChild(queryNode , "resource") != NULL)
+ if (XmlGetChild(queryNode , "resource") != NULL)
query << XCHILD(_T("resource"), m_ThreadInfo->resource);
m_ThreadInfo->send(iq);
@@ -252,7 +252,7 @@ void CJabberProto::OnIqResultSetAuth(HXML iqNode, CJabberIqInfo*)
// RECVED: authentication result
// ACTION: if successfully logged in, continue by requesting roster list and set my initial status
debugLogA("<iq/> iqIdSetAuth");
- if ((type = xmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
if (!mir_tstrcmp(type, _T("result"))) {
ptrT tszNick(getTStringA("Nick"));
@@ -341,13 +341,13 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
return;
}
- HXML queryNode = xmlGetChild(iqNode , "query");
+ HXML queryNode = XmlGetChild(iqNode , "query");
if (queryNode == NULL) {
mir_free(szGroupDelimeter);
return;
}
- if (mir_tstrcmp(xmlGetAttrValue(queryNode, _T("xmlns")), JABBER_FEAT_IQ_ROSTER)) {
+ if (mir_tstrcmp(XmlGetAttrValue(queryNode, _T("xmlns")), JABBER_FEAT_IQ_ROSTER)) {
mir_free(szGroupDelimeter);
return;
}
@@ -363,14 +363,14 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
for (int i=0; ; i++) {
BOOL bIsTransport=FALSE;
- HXML itemNode = xmlGetChild(queryNode ,i);
+ HXML itemNode = XmlGetChild(queryNode ,i);
if (!itemNode)
break;
- if (mir_tstrcmp(xmlGetName(itemNode), _T("item")))
+ if (mir_tstrcmp(XmlGetName(itemNode), _T("item")))
continue;
- const TCHAR *str = xmlGetAttrValue(itemNode, _T("subscription"));
+ const TCHAR *str = XmlGetAttrValue(itemNode, _T("subscription"));
JABBER_SUBSCRIPTION sub;
if (str == NULL) sub = SUB_NONE;
@@ -379,13 +379,13 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
else if (!mir_tstrcmp(str, _T("from"))) sub = SUB_FROM;
else sub = SUB_NONE;
- const TCHAR *jid = xmlGetAttrValue(itemNode, _T("jid"));
+ const TCHAR *jid = XmlGetAttrValue(itemNode, _T("jid"));
if (jid == NULL)
continue;
if (_tcschr(jid, '@') == NULL)
bIsTransport = TRUE;
- const TCHAR *name = xmlGetAttrValue(itemNode, _T("name"));
+ const TCHAR *name = XmlGetAttrValue(itemNode, _T("name"));
TCHAR *nick = (name != NULL) ? mir_tstrdup(name) : JabberNickFromJID(jid);
if (nick == NULL)
continue;
@@ -395,8 +395,8 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
mir_free(item->nick); item->nick = nick;
- HXML groupNode = xmlGetChild(itemNode , "group");
- replaceStrT(item->group, xmlGetText(groupNode));
+ HXML groupNode = XmlGetChild(itemNode , "group");
+ replaceStrT(item->group, XmlGetText(groupNode));
// check group delimiters:
if (item->group && szGroupDelimeter) {
@@ -472,7 +472,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
setByte(hContact, "IsTransport", FALSE);
}
- const TCHAR *imagepath = xmlGetAttrValue(itemNode, _T("vz:img"));
+ const TCHAR *imagepath = XmlGetAttrValue(itemNode, _T("vz:img"));
if (imagepath)
httpavatars->insert(new JABBER_HTTP_AVATARS(imagepath, hContact));
}
@@ -524,16 +524,16 @@ void CJabberProto::OnIqResultGetRegister(HXML iqNode, CJabberIqInfo*)
HXML queryNode;
const TCHAR *type;
- if ((type = xmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
- if ((queryNode = xmlGetChild(iqNode , "query")) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
+ if ((queryNode = XmlGetChild(iqNode , "query")) == NULL) return;
if (!mir_tstrcmp(type, _T("result"))) {
if (m_hwndAgentRegInput)
- SendMessage(m_hwndAgentRegInput, WM_JABBER_REGINPUT_ACTIVATE, 1 /*success*/, (LPARAM)xi.copyNode(iqNode));
+ SendMessage(m_hwndAgentRegInput, WM_JABBER_REGINPUT_ACTIVATE, 1 /*success*/, (LPARAM)xmlCopyNode(iqNode));
}
else if (!mir_tstrcmp(type, _T("error"))) {
if (m_hwndAgentRegInput) {
- HXML errorNode = xmlGetChild(iqNode , "error");
+ HXML errorNode = XmlGetChild(iqNode , "error");
TCHAR *str = JabberErrorMsg(errorNode);
SendMessage(m_hwndAgentRegInput, WM_JABBER_REGINPUT_ACTIVATE, 0 /*error*/, (LPARAM)str);
mir_free(str);
@@ -546,8 +546,8 @@ void CJabberProto::OnIqResultSetRegister(HXML iqNode, CJabberIqInfo*)
debugLogA("<iq/> iqIdSetRegister");
const TCHAR *type, *from;
- if ((type = xmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
- if ((from = xmlGetAttrValue(iqNode, _T("from"))) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
+ if ((from = XmlGetAttrValue(iqNode, _T("from"))) == NULL) return;
if (!mir_tstrcmp(type, _T("result"))) {
MCONTACT hContact = HContactFromJID(from);
@@ -559,7 +559,7 @@ void CJabberProto::OnIqResultSetRegister(HXML iqNode, CJabberIqInfo*)
}
else if (!mir_tstrcmp(type, _T("error"))) {
if (m_hwndRegProgress) {
- HXML errorNode = xmlGetChild(iqNode , "error");
+ HXML errorNode = XmlGetChild(iqNode , "error");
TCHAR *str = JabberErrorMsg(errorNode);
SendMessage(m_hwndRegProgress, WM_JABBER_REGDLG_UPDATE, 100, (LPARAM)str);
mir_free(str);
@@ -574,8 +574,8 @@ void CJabberProto::OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasP
if (hasPhoto)
return;
- HXML o = xmlGetChild(n, "BINVAL");
- LPCTSTR ptszBinval = xmlGetText(o);
+ HXML o = XmlGetChild(n, "BINVAL");
+ LPCTSTR ptszBinval = XmlGetText(o);
if (o == NULL || ptszBinval == NULL)
return;
@@ -636,11 +636,11 @@ void CJabberProto::OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasP
static TCHAR* sttGetText(HXML node, char* tag)
{
- HXML n = xmlGetChild(node , tag);
+ HXML n = XmlGetChild(node , tag);
if (n == NULL)
return NULL;
- return (TCHAR*)xmlGetText(n);
+ return (TCHAR*)XmlGetText(n);
}
void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
@@ -652,14 +652,14 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
DBVARIANT dbv;
debugLogA("<iq/> iqIdGetVcard");
- if ((type = xmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
- if ((jid = xmlGetAttrValue(iqNode, _T("from"))) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
+ if ((jid = XmlGetAttrValue(iqNode, _T("from"))) == NULL) return;
int id = JabberGetPacketID(iqNode);
if (id == m_nJabberSearchID) {
m_nJabberSearchID = -1;
- if ((vCardNode = xmlGetChild(iqNode , "vCard")) != NULL) {
+ if ((vCardNode = XmlGetChild(iqNode , "vCard")) != NULL) {
if (!mir_tstrcmp(type, _T("result"))) {
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
@@ -708,45 +708,45 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
hasOrgname = false, hasOrgunit = false, hasRole = false, hasTitle = false, hasDesc = false, hasPhoto = false;
int nEmail = 0, nPhone = 0, nYear, nMonth, nDay;
- if ((vCardNode = xmlGetChild(iqNode , "vCard")) != NULL) {
+ if ((vCardNode = XmlGetChild(iqNode , "vCard")) != NULL) {
for (int i=0; ; i++) {
- n = xmlGetChild(vCardNode ,i);
+ n = XmlGetChild(vCardNode ,i);
if (!n)
break;
- if (xmlGetName(n) == NULL) continue;
- if (!mir_tstrcmp(xmlGetName(n), _T("FN"))) {
- if (xmlGetText(n) != NULL) {
+ if (XmlGetName(n) == NULL) continue;
+ if (!mir_tstrcmp(XmlGetName(n), _T("FN"))) {
+ if (XmlGetText(n) != NULL) {
hasFn = true;
- setTString(hContact, "FullName", xmlGetText(n));
+ setTString(hContact, "FullName", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("NICKNAME"))) {
- if (xmlGetText(n) != NULL) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("NICKNAME"))) {
+ if (XmlGetText(n) != NULL) {
hasNick = true;
- setTString(hContact, "Nick", xmlGetText(n));
+ setTString(hContact, "Nick", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("N"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("N"))) {
// First/Last name
if (!hasGiven && !hasFamily && !hasMiddle) {
- if ((m=xmlGetChild(n, "GIVEN")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "GIVEN")) != NULL && XmlGetText(m) != NULL) {
hasGiven = true;
- setTString(hContact, "FirstName", xmlGetText(m));
+ setTString(hContact, "FirstName", XmlGetText(m));
}
- if ((m=xmlGetChild(n, "FAMILY")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "FAMILY")) != NULL && XmlGetText(m) != NULL) {
hasFamily = true;
- setTString(hContact, "LastName", xmlGetText(m));
+ setTString(hContact, "LastName", XmlGetText(m));
}
- if ((m=xmlGetChild(n, "MIDDLE")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "MIDDLE")) != NULL && XmlGetText(m) != NULL) {
hasMiddle = true;
- setTString(hContact, "MiddleName", xmlGetText(m));
+ setTString(hContact, "MiddleName", XmlGetText(m));
} }
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("EMAIL"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("EMAIL"))) {
// E-mail address(es)
- if ((m=xmlGetChild(n, "USERID")) == NULL) // Some bad client put e-mail directly in <EMAIL/> instead of <USERID/>
+ if ((m=XmlGetChild(n, "USERID")) == NULL) // Some bad client put e-mail directly in <EMAIL/> instead of <USERID/>
m = n;
- if (xmlGetText(m) != NULL) {
+ if (XmlGetText(m) != NULL) {
char text[100];
if (hContact != NULL) {
if (nEmail == 0)
@@ -755,25 +755,25 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
mir_snprintf(text, _countof(text), "e-mail%d", nEmail - 1);
}
else mir_snprintf(text, _countof(text), "e-mail%d", nEmail);
- setTString(hContact, text, xmlGetText(m));
+ setTString(hContact, text, XmlGetText(m));
if (hContact == NULL) {
mir_snprintf(text, _countof(text), "e-mailFlag%d", nEmail);
int nFlag = 0;
- if (xmlGetChild(n, "HOME") != NULL) nFlag |= JABBER_VCEMAIL_HOME;
- if (xmlGetChild(n, "WORK") != NULL) nFlag |= JABBER_VCEMAIL_WORK;
- if (xmlGetChild(n, "INTERNET") != NULL) nFlag |= JABBER_VCEMAIL_INTERNET;
- if (xmlGetChild(n, "X400") != NULL) nFlag |= JABBER_VCEMAIL_X400;
+ if (XmlGetChild(n, "HOME") != NULL) nFlag |= JABBER_VCEMAIL_HOME;
+ if (XmlGetChild(n, "WORK") != NULL) nFlag |= JABBER_VCEMAIL_WORK;
+ if (XmlGetChild(n, "INTERNET") != NULL) nFlag |= JABBER_VCEMAIL_INTERNET;
+ if (XmlGetChild(n, "X400") != NULL) nFlag |= JABBER_VCEMAIL_X400;
setWord(text, nFlag);
}
nEmail++;
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("BDAY"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("BDAY"))) {
// Birthday
- if (!hasBday && xmlGetText(n) != NULL) {
+ if (!hasBday && XmlGetText(n) != NULL) {
if (hContact != NULL) {
- if (_stscanf(xmlGetText(n), _T("%d-%d-%d"), &nYear, &nMonth, &nDay) == 3) {
+ if (_stscanf(XmlGetText(n), _T("%d-%d-%d"), &nYear, &nMonth, &nDay) == 3) {
hasBday = true;
setWord(hContact, "BirthYear", (WORD)nYear);
setByte(hContact, "BirthMonth", (BYTE) nMonth);
@@ -790,202 +790,202 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
}
else {
hasBday = true;
- setTString("BirthDate", xmlGetText(n));
+ setTString("BirthDate", XmlGetText(n));
} }
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("GENDER"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("GENDER"))) {
// Gender
- if (!hasGender && xmlGetText(n) != NULL) {
+ if (!hasGender && XmlGetText(n) != NULL) {
if (hContact != NULL) {
- if (xmlGetText(n)[0] && strchr("mMfF", xmlGetText(n)[0]) != NULL) {
+ if (XmlGetText(n)[0] && strchr("mMfF", XmlGetText(n)[0]) != NULL) {
hasGender = true;
- setByte(hContact, "Gender", (BYTE) toupper(xmlGetText(n)[0]));
+ setByte(hContact, "Gender", (BYTE) toupper(XmlGetText(n)[0]));
}
}
else {
hasGender = true;
- setTString("GenderString", xmlGetText(n));
+ setTString("GenderString", XmlGetText(n));
} }
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("ADR"))) {
- if (!hasHome && xmlGetChild(n, "HOME") != NULL) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("ADR"))) {
+ if (!hasHome && XmlGetChild(n, "HOME") != NULL) {
// Home address
hasHome = true;
- if ((m=xmlGetChild(n, "STREET")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "STREET")) != NULL && XmlGetText(m) != NULL) {
hasHomeStreet = true;
if (hContact != NULL) {
- if ((o=xmlGetChild(n, "EXTADR")) != NULL && xmlGetText(o) != NULL)
- mir_sntprintf(text, _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
- else if ((o=xmlGetChild(n, "EXTADD")) != NULL && xmlGetText(o) != NULL)
- mir_sntprintf(text, _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
+ if ((o=XmlGetChild(n, "EXTADR")) != NULL && XmlGetText(o) != NULL)
+ mir_sntprintf(text, _T("%s\r\n%s"), XmlGetText(m), XmlGetText(o));
+ else if ((o=XmlGetChild(n, "EXTADD")) != NULL && XmlGetText(o) != NULL)
+ mir_sntprintf(text, _T("%s\r\n%s"), XmlGetText(m), XmlGetText(o));
else
- _tcsncpy_s(text, xmlGetText(m), _TRUNCATE);
+ _tcsncpy_s(text, XmlGetText(m), _TRUNCATE);
text[_countof(text)-1] = '\0';
setTString(hContact, "Street", text);
}
else {
- setTString(hContact, "Street", xmlGetText(m));
- if ((m=xmlGetChild(n, "EXTADR")) == NULL)
- m = xmlGetChild(n, "EXTADD");
- if (m != NULL && xmlGetText(m) != NULL) {
+ setTString(hContact, "Street", XmlGetText(m));
+ if ((m=XmlGetChild(n, "EXTADR")) == NULL)
+ m = XmlGetChild(n, "EXTADD");
+ if (m != NULL && XmlGetText(m) != NULL) {
hasHomeStreet2 = true;
- setTString(hContact, "Street2", xmlGetText(m));
+ setTString(hContact, "Street2", XmlGetText(m));
} } }
- if ((m=xmlGetChild(n, "LOCALITY")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "LOCALITY")) != NULL && XmlGetText(m) != NULL) {
hasHomeLocality = true;
- setTString(hContact, "City", xmlGetText(m));
+ setTString(hContact, "City", XmlGetText(m));
}
- if ((m=xmlGetChild(n, "REGION")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "REGION")) != NULL && XmlGetText(m) != NULL) {
hasHomeRegion = true;
- setTString(hContact, "State", xmlGetText(m));
+ setTString(hContact, "State", XmlGetText(m));
}
- if ((m=xmlGetChild(n, "PCODE")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "PCODE")) != NULL && XmlGetText(m) != NULL) {
hasHomePcode = true;
- setTString(hContact, "ZIP", xmlGetText(m));
+ setTString(hContact, "ZIP", XmlGetText(m));
}
- if ((m=xmlGetChild(n, "CTRY")) == NULL || xmlGetText(m) == NULL) // Some bad client use <COUNTRY/> instead of <CTRY/>
- m = xmlGetChild(n, "COUNTRY");
- if (m != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "CTRY")) == NULL || XmlGetText(m) == NULL) // Some bad client use <COUNTRY/> instead of <CTRY/>
+ m = XmlGetChild(n, "COUNTRY");
+ if (m != NULL && XmlGetText(m) != NULL) {
hasHomeCtry = true;
- setTString(hContact, "Country", xmlGetText(m));
+ setTString(hContact, "Country", XmlGetText(m));
} }
- if (!hasWork && xmlGetChild(n, "WORK") != NULL) {
+ if (!hasWork && XmlGetChild(n, "WORK") != NULL) {
// Work address
hasWork = true;
- if ((m=xmlGetChild(n, "STREET")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "STREET")) != NULL && XmlGetText(m) != NULL) {
hasWorkStreet = true;
if (hContact != NULL) {
- if ((o=xmlGetChild(n, "EXTADR")) != NULL && xmlGetText(o) != NULL)
- mir_sntprintf(text, _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
- else if ((o=xmlGetChild(n, "EXTADD")) != NULL && xmlGetText(o) != NULL)
- mir_sntprintf(text, _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
+ if ((o=XmlGetChild(n, "EXTADR")) != NULL && XmlGetText(o) != NULL)
+ mir_sntprintf(text, _T("%s\r\n%s"), XmlGetText(m), XmlGetText(o));
+ else if ((o=XmlGetChild(n, "EXTADD")) != NULL && XmlGetText(o) != NULL)
+ mir_sntprintf(text, _T("%s\r\n%s"), XmlGetText(m), XmlGetText(o));
else
- _tcsncpy_s(text, xmlGetText(m), _TRUNCATE);
+ _tcsncpy_s(text, XmlGetText(m), _TRUNCATE);
text[_countof(text)-1] = '\0';
setTString(hContact, "CompanyStreet", text);
}
else {
- setTString(hContact, "CompanyStreet", xmlGetText(m));
- if ((m=xmlGetChild(n, "EXTADR")) == NULL)
- m = xmlGetChild(n, "EXTADD");
- if (m != NULL && xmlGetText(m) != NULL) {
+ setTString(hContact, "CompanyStreet", XmlGetText(m));
+ if ((m=XmlGetChild(n, "EXTADR")) == NULL)
+ m = XmlGetChild(n, "EXTADD");
+ if (m != NULL && XmlGetText(m) != NULL) {
hasWorkStreet2 = true;
- setTString(hContact, "CompanyStreet2", xmlGetText(m));
+ setTString(hContact, "CompanyStreet2", XmlGetText(m));
} } }
- if ((m=xmlGetChild(n, "LOCALITY")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "LOCALITY")) != NULL && XmlGetText(m) != NULL) {
hasWorkLocality = true;
- setTString(hContact, "CompanyCity", xmlGetText(m));
+ setTString(hContact, "CompanyCity", XmlGetText(m));
}
- if ((m=xmlGetChild(n, "REGION")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "REGION")) != NULL && XmlGetText(m) != NULL) {
hasWorkRegion = true;
- setTString(hContact, "CompanyState", xmlGetText(m));
+ setTString(hContact, "CompanyState", XmlGetText(m));
}
- if ((m=xmlGetChild(n, "PCODE")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "PCODE")) != NULL && XmlGetText(m) != NULL) {
hasWorkPcode = true;
- setTString(hContact, "CompanyZIP", xmlGetText(m));
+ setTString(hContact, "CompanyZIP", XmlGetText(m));
}
- if ((m=xmlGetChild(n, "CTRY")) == NULL || xmlGetText(m) == NULL) // Some bad client use <COUNTRY/> instead of <CTRY/>
- m = xmlGetChild(n, "COUNTRY");
- if (m != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "CTRY")) == NULL || XmlGetText(m) == NULL) // Some bad client use <COUNTRY/> instead of <CTRY/>
+ m = XmlGetChild(n, "COUNTRY");
+ if (m != NULL && XmlGetText(m) != NULL) {
hasWorkCtry = true;
- setTString(hContact, "CompanyCountry", xmlGetText(m));
+ setTString(hContact, "CompanyCountry", XmlGetText(m));
} }
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("TEL"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("TEL"))) {
// Telephone/Fax/Cellular
- if ((m=xmlGetChild(n, "NUMBER")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "NUMBER")) != NULL && XmlGetText(m) != NULL) {
if (hContact != NULL) {
- if (!hasFax && xmlGetChild(n, "FAX") != NULL) {
+ if (!hasFax && XmlGetChild(n, "FAX") != NULL) {
hasFax = true;
- setTString(hContact, "Fax", xmlGetText(m));
+ setTString(hContact, "Fax", XmlGetText(m));
}
- else if (!hasCell && xmlGetChild(n, "CELL") != NULL) {
+ else if (!hasCell && XmlGetChild(n, "CELL") != NULL) {
hasCell = true;
- setTString(hContact, "Cellular", xmlGetText(m));
+ setTString(hContact, "Cellular", XmlGetText(m));
}
else if (!hasPhone &&
- (xmlGetChild(n, "HOME") != NULL || xmlGetChild(n, "WORK") != NULL || xmlGetChild(n, "VOICE") != NULL ||
- (xmlGetChild(n, "FAX") == NULL &&
- xmlGetChild(n, "PAGER") == NULL &&
- xmlGetChild(n, "MSG") == NULL &&
- xmlGetChild(n, "CELL") == NULL &&
- xmlGetChild(n, "VIDEO") == NULL &&
- xmlGetChild(n, "BBS") == NULL &&
- xmlGetChild(n, "MODEM") == NULL &&
- xmlGetChild(n, "ISDN") == NULL &&
- xmlGetChild(n, "PCS") == NULL)))
+ (XmlGetChild(n, "HOME") != NULL || XmlGetChild(n, "WORK") != NULL || XmlGetChild(n, "VOICE") != NULL ||
+ (XmlGetChild(n, "FAX") == NULL &&
+ XmlGetChild(n, "PAGER") == NULL &&
+ XmlGetChild(n, "MSG") == NULL &&
+ XmlGetChild(n, "CELL") == NULL &&
+ XmlGetChild(n, "VIDEO") == NULL &&
+ XmlGetChild(n, "BBS") == NULL &&
+ XmlGetChild(n, "MODEM") == NULL &&
+ XmlGetChild(n, "ISDN") == NULL &&
+ XmlGetChild(n, "PCS") == NULL)))
{
hasPhone = true;
- setTString(hContact, "Phone", xmlGetText(m));
+ setTString(hContact, "Phone", XmlGetText(m));
}
}
else {
char text[100];
mir_snprintf(text, _countof(text), "Phone%d", nPhone);
- setTString(text, xmlGetText(m));
+ setTString(text, XmlGetText(m));
mir_snprintf(text, _countof(text), "PhoneFlag%d", nPhone);
int nFlag = 0;
- if (xmlGetChild(n, "HOME") != NULL) nFlag |= JABBER_VCTEL_HOME;
- if (xmlGetChild(n, "WORK") != NULL) nFlag |= JABBER_VCTEL_WORK;
- if (xmlGetChild(n, "VOICE") != NULL) nFlag |= JABBER_VCTEL_VOICE;
- if (xmlGetChild(n, "FAX") != NULL) nFlag |= JABBER_VCTEL_FAX;
- if (xmlGetChild(n, "PAGER") != NULL) nFlag |= JABBER_VCTEL_PAGER;
- if (xmlGetChild(n, "MSG") != NULL) nFlag |= JABBER_VCTEL_MSG;
- if (xmlGetChild(n, "CELL") != NULL) nFlag |= JABBER_VCTEL_CELL;
- if (xmlGetChild(n, "VIDEO") != NULL) nFlag |= JABBER_VCTEL_VIDEO;
- if (xmlGetChild(n, "BBS") != NULL) nFlag |= JABBER_VCTEL_BBS;
- if (xmlGetChild(n, "MODEM") != NULL) nFlag |= JABBER_VCTEL_MODEM;
- if (xmlGetChild(n, "ISDN") != NULL) nFlag |= JABBER_VCTEL_ISDN;
- if (xmlGetChild(n, "PCS") != NULL) nFlag |= JABBER_VCTEL_PCS;
+ if (XmlGetChild(n, "HOME") != NULL) nFlag |= JABBER_VCTEL_HOME;
+ if (XmlGetChild(n, "WORK") != NULL) nFlag |= JABBER_VCTEL_WORK;
+ if (XmlGetChild(n, "VOICE") != NULL) nFlag |= JABBER_VCTEL_VOICE;
+ if (XmlGetChild(n, "FAX") != NULL) nFlag |= JABBER_VCTEL_FAX;
+ if (XmlGetChild(n, "PAGER") != NULL) nFlag |= JABBER_VCTEL_PAGER;
+ if (XmlGetChild(n, "MSG") != NULL) nFlag |= JABBER_VCTEL_MSG;
+ if (XmlGetChild(n, "CELL") != NULL) nFlag |= JABBER_VCTEL_CELL;
+ if (XmlGetChild(n, "VIDEO") != NULL) nFlag |= JABBER_VCTEL_VIDEO;
+ if (XmlGetChild(n, "BBS") != NULL) nFlag |= JABBER_VCTEL_BBS;
+ if (XmlGetChild(n, "MODEM") != NULL) nFlag |= JABBER_VCTEL_MODEM;
+ if (XmlGetChild(n, "ISDN") != NULL) nFlag |= JABBER_VCTEL_ISDN;
+ if (XmlGetChild(n, "PCS") != NULL) nFlag |= JABBER_VCTEL_PCS;
setWord(text, nFlag);
nPhone++;
}
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("URL"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("URL"))) {
// Homepage
- if (!hasUrl && xmlGetText(n) != NULL) {
+ if (!hasUrl && XmlGetText(n) != NULL) {
hasUrl = true;
- setTString(hContact, "Homepage", xmlGetText(n));
+ setTString(hContact, "Homepage", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("ORG"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("ORG"))) {
if (!hasOrgname && !hasOrgunit) {
- if ((m = xmlGetChild(n, "ORGNAME")) != NULL && xmlGetText(m) != NULL) {
+ if ((m = XmlGetChild(n, "ORGNAME")) != NULL && XmlGetText(m) != NULL) {
hasOrgname = true;
- setTString(hContact, "Company", xmlGetText(m));
+ setTString(hContact, "Company", XmlGetText(m));
}
- if ((m = xmlGetChild(n, "ORGUNIT")) != NULL && xmlGetText(m) != NULL) { // The real vCard can have multiple <ORGUNIT/> but we will only display the first one
+ if ((m = XmlGetChild(n, "ORGUNIT")) != NULL && XmlGetText(m) != NULL) { // The real vCard can have multiple <ORGUNIT/> but we will only display the first one
hasOrgunit = true;
- setTString(hContact, "CompanyDepartment", xmlGetText(m));
+ setTString(hContact, "CompanyDepartment", XmlGetText(m));
}
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("ROLE"))) {
- if (!hasRole && xmlGetText(n) != NULL) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("ROLE"))) {
+ if (!hasRole && XmlGetText(n) != NULL) {
hasRole = true;
- setTString(hContact, "Role", xmlGetText(n));
+ setTString(hContact, "Role", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("TITLE"))) {
- if (!hasTitle && xmlGetText(n) != NULL) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("TITLE"))) {
+ if (!hasTitle && XmlGetText(n) != NULL) {
hasTitle = true;
- setTString(hContact, "CompanyPosition", xmlGetText(n));
+ setTString(hContact, "CompanyPosition", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("DESC"))) {
- if (!hasDesc && xmlGetText(n) != NULL) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("DESC"))) {
+ if (!hasDesc && XmlGetText(n) != NULL) {
hasDesc = true;
- CMString tszMemo(xmlGetText(n));
+ CMString tszMemo(XmlGetText(n));
tszMemo.Replace(_T("\n"), _T("\r\n"));
setTString(hContact, "About", tszMemo);
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("PHOTO")))
+ else if (!mir_tstrcmp(XmlGetName(n), _T("PHOTO")))
OnIqResultGetVcardPhoto(n, hContact, hasPhoto);
} }
@@ -1118,7 +1118,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
void CJabberProto::OnIqResultSetVcard(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> iqIdSetVcard");
- if (xmlGetAttrValue(iqNode, _T("type")))
+ if (XmlGetAttrValue(iqNode, _T("type")))
WindowList_Broadcast(m_hWindowList, WM_JABBER_REFRESH_VCARD, 0, 0);
}
@@ -1129,38 +1129,38 @@ void CJabberProto::OnIqResultSetSearch(HXML iqNode, CJabberIqInfo*)
int id;
debugLogA("<iq/> iqIdGetSearch");
- if ((type = xmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
if ((id = JabberGetPacketID(iqNode)) == -1) return;
if (!mir_tstrcmp(type, _T("result"))) {
- if ((queryNode = xmlGetChild(iqNode, "query")) == NULL)
+ if ((queryNode = XmlGetChild(iqNode, "query")) == NULL)
return;
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
for (int i = 0;; i++) {
- HXML itemNode = xmlGetChild(queryNode, i);
+ HXML itemNode = XmlGetChild(queryNode, i);
if (!itemNode)
break;
- if (!mir_tstrcmp(xmlGetName(itemNode), _T("item"))) {
- if ((jid = xmlGetAttrValue(itemNode, _T("jid"))) != NULL) {
+ if (!mir_tstrcmp(XmlGetName(itemNode), _T("item"))) {
+ if ((jid = XmlGetAttrValue(itemNode, _T("jid"))) != NULL) {
psr.id.t = (TCHAR*)jid;
debugLog(_T("Result jid = %s"), jid);
- if ((n = xmlGetChild(itemNode, "nick")) != NULL && xmlGetText(n) != NULL)
- psr.nick.t = (TCHAR*)xmlGetText(n);
+ if ((n = XmlGetChild(itemNode, "nick")) != NULL && XmlGetText(n) != NULL)
+ psr.nick.t = (TCHAR*)XmlGetText(n);
else
psr.nick.t = _T("");
- if ((n = xmlGetChild(itemNode, "first")) != NULL && xmlGetText(n) != NULL)
- psr.firstName.t = (TCHAR*)xmlGetText(n);
+ if ((n = XmlGetChild(itemNode, "first")) != NULL && XmlGetText(n) != NULL)
+ psr.firstName.t = (TCHAR*)XmlGetText(n);
else
psr.firstName.t = _T("");
- if ((n = xmlGetChild(itemNode, "last")) != NULL && xmlGetText(n) != NULL)
- psr.lastName.t = (TCHAR*)xmlGetText(n);
+ if ((n = XmlGetChild(itemNode, "last")) != NULL && XmlGetText(n) != NULL)
+ psr.lastName.t = (TCHAR*)XmlGetText(n);
else
psr.lastName.t = _T("");
- if ((n = xmlGetChild(itemNode, "email")) != NULL && xmlGetText(n) != NULL)
- psr.email.t = (TCHAR*)xmlGetText(n);
+ if ((n = XmlGetChild(itemNode, "email")) != NULL && XmlGetText(n) != NULL)
+ psr.email.t = (TCHAR*)XmlGetText(n);
else
psr.email.t = _T("");
psr.flags = PSR_TCHAR;
@@ -1180,7 +1180,7 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*)
HXML queryNode;
debugLogA("<iq/> iqIdGetExtSearch");
- const TCHAR *type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
@@ -1189,13 +1189,13 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*)
return;
if (!mir_tstrcmp(type, _T("result"))) {
- if ((queryNode=xmlGetChild(iqNode , "query")) == NULL) return;
- if ((queryNode=xmlGetChild(queryNode , "x")) == NULL) return;
+ if ((queryNode=XmlGetChild(iqNode , "query")) == NULL) return;
+ if ((queryNode=XmlGetChild(queryNode , "x")) == NULL) return;
for (int i=0; ; i++) {
- HXML itemNode = xmlGetChild(queryNode ,i);
+ HXML itemNode = XmlGetChild(queryNode ,i);
if (!itemNode)
break;
- if (mir_tstrcmp(xmlGetName(itemNode), _T("item")))
+ if (mir_tstrcmp(XmlGetName(itemNode), _T("item")))
continue;
PROTOSEARCHRESULT psr = { 0 };
@@ -1203,35 +1203,35 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*)
psr.flags = PSR_TCHAR;
for (int j=0; ; j++) {
- HXML fieldNode = xmlGetChild(itemNode ,j);
+ HXML fieldNode = XmlGetChild(itemNode ,j);
if (!fieldNode)
break;
- if (mir_tstrcmp(xmlGetName(fieldNode), _T("field")))
+ if (mir_tstrcmp(XmlGetName(fieldNode), _T("field")))
continue;
- const TCHAR *fieldName = xmlGetAttrValue(fieldNode, _T("var"));
+ const TCHAR *fieldName = XmlGetAttrValue(fieldNode, _T("var"));
if (fieldName == NULL)
continue;
- HXML n = xmlGetChild(fieldNode , "value");
+ HXML n = XmlGetChild(fieldNode , "value");
if (n == NULL)
continue;
if (!mir_tstrcmp(fieldName, _T("jid"))) {
- psr.id.t = (TCHAR*)xmlGetText(n);
+ psr.id.t = (TCHAR*)XmlGetText(n);
debugLog(_T("Result jid = %s"), psr.id.t);
}
else if (!mir_tstrcmp(fieldName, _T("nickname")))
- psr.nick.t = (xmlGetText(n) != NULL) ? (TCHAR*)xmlGetText(n) : _T("");
+ psr.nick.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : _T("");
else if (!mir_tstrcmp(fieldName, _T("fn")))
- psr.firstName.t = (xmlGetText(n) != NULL) ? (TCHAR*)xmlGetText(n) : _T("");
+ psr.firstName.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : _T("");
else if (!mir_tstrcmp(fieldName, _T("given")))
- psr.firstName.t = (xmlGetText(n) != NULL) ? (TCHAR*)xmlGetText(n) : _T("");
+ psr.firstName.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : _T("");
else if (!mir_tstrcmp(fieldName, _T("family")))
- psr.lastName.t = (xmlGetText(n) != NULL) ? (TCHAR*)xmlGetText(n) : _T("");
+ psr.lastName.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : _T("");
else if (!mir_tstrcmp(fieldName, _T("email")))
- psr.email.t = (xmlGetText(n) != NULL) ? (TCHAR*)xmlGetText(n) : _T("");
+ psr.email.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : _T("");
}
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&psr);
@@ -1247,7 +1247,7 @@ void CJabberProto::OnIqResultSetPassword(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> iqIdSetPassword");
- const TCHAR *type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
@@ -1263,7 +1263,7 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> OnIqResultGetVCardAvatar");
- const TCHAR *from = xmlGetAttrValue(iqNode, _T("from"));
+ const TCHAR *from = XmlGetAttrValue(iqNode, _T("from"));
if (from == NULL)
return;
@@ -1272,15 +1272,15 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*)
return;
const TCHAR *type;
- if ((type = xmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
if (mir_tstrcmp(type, _T("result"))) return;
- HXML vCard = xmlGetChild(iqNode , "vCard");
+ HXML vCard = XmlGetChild(iqNode , "vCard");
if (vCard == NULL) return;
- vCard = xmlGetChild(vCard , "PHOTO");
+ vCard = XmlGetChild(vCard , "PHOTO");
if (vCard == NULL) return;
- if (xmlGetChildCount(vCard) == 0) {
+ if (XmlGetChildCount(vCard) == 0) {
delSetting(hContact, "AvatarHash");
if ( ptrT( getTStringA(hContact, "AvatarSaved")) != NULL) {
delSetting(hContact, "AvatarSaved");
@@ -1289,8 +1289,8 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*)
return;
}
- const TCHAR *mimeType = xmlGetText( xmlGetChild(vCard , "TYPE"));
- HXML n = xmlGetChild(vCard , "BINVAL");
+ const TCHAR *mimeType = XmlGetText( XmlGetChild(vCard , "TYPE"));
+ HXML n = XmlGetChild(vCard , "BINVAL");
if (n == NULL)
return;
@@ -1304,7 +1304,7 @@ void CJabberProto::OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo*)
debugLogA("<iq/> iqIdResultGetClientAvatar");
- const TCHAR *from = xmlGetAttrValue(iqNode, _T("from"));
+ const TCHAR *from = XmlGetAttrValue(iqNode, _T("from"));
if (from == NULL)
return;
MCONTACT hContact = HContactFromJID(from);
@@ -1312,17 +1312,17 @@ void CJabberProto::OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo*)
return;
HXML n = NULL;
- if ((type = xmlGetAttrValue(iqNode, _T("type"))) != NULL && !mir_tstrcmp(type, _T("result"))) {
- HXML queryNode = xmlGetChild(iqNode , "query");
+ if ((type = XmlGetAttrValue(iqNode, _T("type"))) != NULL && !mir_tstrcmp(type, _T("result"))) {
+ HXML queryNode = XmlGetChild(iqNode , "query");
if (queryNode != NULL) {
- const TCHAR *xmlns = xmlGetAttrValue(queryNode, _T("xmlns"));
+ const TCHAR *xmlns = XmlGetAttrValue(queryNode, _T("xmlns"));
if (!mir_tstrcmp(xmlns, JABBER_FEAT_AVATAR))
- n = xmlGetChild(queryNode , "data");
+ n = XmlGetChild(queryNode , "data");
}
}
if (n != NULL) {
- OnIqResultGotAvatar(hContact, n, xmlGetAttrValue(n, _T("mimetype")));
+ OnIqResultGotAvatar(hContact, n, XmlGetAttrValue(n, _T("mimetype")));
return;
}
@@ -1342,7 +1342,7 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> iqIdResultGetServerAvatar");
- const TCHAR *from = xmlGetAttrValue(iqNode, _T("from"));
+ const TCHAR *from = XmlGetAttrValue(iqNode, _T("from"));
if (from == NULL)
return;
@@ -1351,18 +1351,18 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo*)
return;
HXML n = NULL;
- const TCHAR *type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
if (!mir_tstrcmp(type, _T("result"))) {
- HXML queryNode = xmlGetChild(iqNode , "query");
+ HXML queryNode = XmlGetChild(iqNode , "query");
if (queryNode != NULL) {
- const TCHAR *xmlns = xmlGetAttrValue(queryNode, _T("xmlns"));
+ const TCHAR *xmlns = XmlGetAttrValue(queryNode, _T("xmlns"));
if (!mir_tstrcmp(xmlns, JABBER_FEAT_SERVER_AVATAR))
- n = xmlGetChild(queryNode, "data");
+ n = XmlGetChild(queryNode, "data");
}
}
if (n != NULL) {
- OnIqResultGotAvatar(hContact, n, xmlGetAttrValue(n, _T("mimetype")));
+ OnIqResultGotAvatar(hContact, n, XmlGetAttrValue(n, _T("mimetype")));
return;
}
@@ -1382,7 +1382,7 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo*)
void CJabberProto::OnIqResultGotAvatar(MCONTACT hContact, HXML n, const TCHAR *mimeType)
{
unsigned resultLen;
- ptrA body((char*)mir_base64_decode( _T2A(xmlGetText(n)), &resultLen));
+ ptrA body((char*)mir_base64_decode( _T2A(XmlGetText(n)), &resultLen));
if (body == NULL)
return;
@@ -1443,7 +1443,7 @@ void CJabberProto::OnIqResultDiscoBookmarks(HXML iqNode, CJabberIqInfo*)
// RECVED: list of bookmarks
// ACTION: refresh bookmarks dialog
debugLogA("<iq/> iqIdGetBookmarks");
- const TCHAR *type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
@@ -1458,24 +1458,24 @@ void CJabberProto::OnIqResultDiscoBookmarks(HXML iqNode, CJabberIqInfo*)
ListRemoveList(LIST_BOOKMARK);
HXML itemNode;
- for (int i = 0; itemNode = xmlGetChild(storageNode, i); i++) {
- if (LPCTSTR name = xmlGetName(itemNode)) {
- if (!mir_tstrcmp(name, _T("conference")) && (jid = xmlGetAttrValue(itemNode, _T("jid")))) {
+ for (int i = 0; itemNode = XmlGetChild(storageNode, i); i++) {
+ if (LPCTSTR name = XmlGetName(itemNode)) {
+ if (!mir_tstrcmp(name, _T("conference")) && (jid = XmlGetAttrValue(itemNode, _T("jid")))) {
JABBER_LIST_ITEM *item = ListAdd(LIST_BOOKMARK, jid);
- item->name = mir_tstrdup(xmlGetAttrValue(itemNode, _T("name")));
+ item->name = mir_tstrdup(XmlGetAttrValue(itemNode, _T("name")));
item->type = mir_tstrdup(_T("conference"));
item->bUseResource = TRUE;
item->nick = mir_tstrdup(XPathT(itemNode, "nick"));
item->password = mir_tstrdup(XPathT(itemNode, "password"));
- const TCHAR *autoJ = xmlGetAttrValue(itemNode, _T("autojoin"));
+ const TCHAR *autoJ = XmlGetAttrValue(itemNode, _T("autojoin"));
if (autoJ != NULL)
item->bAutoJoin = (!mir_tstrcmp(autoJ, _T("true")) || !mir_tstrcmp(autoJ, _T("1"))) ? true : false;
}
- else if (!mir_tstrcmp(name, _T("url")) && (jid = xmlGetAttrValue(itemNode, _T("url")))) {
+ else if (!mir_tstrcmp(name, _T("url")) && (jid = XmlGetAttrValue(itemNode, _T("url")))) {
JABBER_LIST_ITEM *item = ListAdd(LIST_BOOKMARK, jid);
item->bUseResource = TRUE;
- item->name = mir_tstrdup(xmlGetAttrValue(itemNode, _T("name")));
+ item->name = mir_tstrdup(XmlGetAttrValue(itemNode, _T("name")));
item->type = mir_tstrdup(_T("url"));
}
}
@@ -1533,7 +1533,7 @@ void CJabberProto::OnIqResultSetBookmarks(HXML iqNode, CJabberIqInfo*)
debugLogA("<iq/> iqIdSetBookmarks");
- const TCHAR *type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
@@ -1541,7 +1541,7 @@ void CJabberProto::OnIqResultSetBookmarks(HXML iqNode, CJabberIqInfo*)
UI_SAFE_NOTIFY(m_pDlgBookmarks, WM_JABBER_REFRESH);
}
else if (!mir_tstrcmp(type, _T("error"))) {
- HXML errorNode = xmlGetChild(iqNode, "error");
+ HXML errorNode = XmlGetChild(iqNode, "error");
TCHAR *str = JabberErrorMsg(errorNode);
MessageBox(NULL, str, TranslateT("Jabber Bookmarks Error"), MB_OK | MB_SETFOREGROUND);
mir_free(str);
diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp
index b66a55cf5b..cd982c3515 100644
--- a/protocols/JabberG/src/jabber_iqid_muc.cpp
+++ b/protocols/JabberG/src/jabber_iqid_muc.cpp
@@ -32,7 +32,7 @@ void CJabberProto::SetMucConfig(HXML node, void *from)
if (m_ThreadInfo && from) {
XmlNodeIq iq(_T("set"), SerialNext(), (TCHAR*)from);
HXML query = iq << XQUERY(JABBER_FEAT_MUC_OWNER);
- xmlAddChild(query, node);
+ XmlAddChild(query, node);
m_ThreadInfo->send(iq);
}
}
@@ -42,21 +42,21 @@ void CJabberProto::SetMucConfig(HXML node, void *from)
void CJabberProto::OnIqResultGetMuc(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> iqIdGetMuc");
- LPCTSTR type = xmlGetAttrValue(iqNode, _T("type"));
+ LPCTSTR type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
- LPCTSTR from = xmlGetAttrValue(iqNode, _T("from"));
+ LPCTSTR from = XmlGetAttrValue(iqNode, _T("from"));
if (from == NULL)
return;
if (!mir_tstrcmp(type, _T("result"))) {
- HXML queryNode = xmlGetChild(iqNode , _T("query"));
+ HXML queryNode = XmlGetChild(iqNode , _T("query"));
if (queryNode != NULL) {
- LPCTSTR str = xmlGetAttrValue(queryNode, _T("xmlns"));
+ LPCTSTR str = XmlGetAttrValue(queryNode, _T("xmlns"));
if (!mir_tstrcmp(str, JABBER_FEAT_MUC_OWNER)) {
- HXML xNode = xmlGetChild(queryNode , _T("x"));
+ HXML xNode = XmlGetChild(queryNode , _T("x"));
if (xNode != NULL) {
- str = xmlGetAttrValue(xNode, _T("xmlns"));
+ str = XmlGetAttrValue(xNode, _T("xmlns"));
if (!mir_tstrcmp(str, JABBER_FEAT_DATA_FORMS))
//LaunchForm(xNode);
FormCreateDialog(xNode, _T("Jabber Conference Room Configuration"), &CJabberProto::SetMucConfig, mir_tstrdup(from));
@@ -99,30 +99,30 @@ static void sttFillJidList(HWND hwndDlg)
TCHAR tszItemText[ JABBER_MAX_JID_LEN + 256 ];
HXML iqNode = jidListInfo->iqNode;
if (iqNode != NULL) {
- LPCTSTR from = xmlGetAttrValue(iqNode, _T("from"));
+ LPCTSTR from = XmlGetAttrValue(iqNode, _T("from"));
if (from != NULL) {
- HXML queryNode = xmlGetChild(iqNode , _T("query"));
+ HXML queryNode = XmlGetChild(iqNode , _T("query"));
if (queryNode != NULL) {
lvi.mask = LVIF_TEXT | LVIF_PARAM;
lvi.iSubItem = 0;
lvi.iItem = 0;
for (int i=0; ; i++) {
- HXML itemNode = xmlGetChild(queryNode ,i);
+ HXML itemNode = XmlGetChild(queryNode ,i);
if (!itemNode)
break;
- LPCTSTR jid = xmlGetAttrValue(itemNode, _T("jid"));
+ LPCTSTR jid = XmlGetAttrValue(itemNode, _T("jid"));
if (jid != NULL) {
lvi.pszText = (TCHAR*)jid;
if (jidListInfo->type == MUC_BANLIST) {
- LPCTSTR reason = xmlGetText(xmlGetChild(itemNode , _T("reason")));
+ LPCTSTR reason = XmlGetText(XmlGetChild(itemNode , _T("reason")));
if (reason != NULL) {
mir_sntprintf(tszItemText, _countof(tszItemText), _T("%s (%s)") , jid, reason);
lvi.pszText = tszItemText;
}
}
else if (jidListInfo->type == MUC_VOICELIST || jidListInfo->type == MUC_MODERATORLIST) {
- LPCTSTR nick = xmlGetAttrValue(itemNode, _T("nick"));
+ LPCTSTR nick = XmlGetAttrValue(itemNode, _T("nick"));
if (nick != NULL) {
mir_sntprintf(tszItemText, _countof(tszItemText), _T("%s (%s)") , nick, jid);
lvi.pszText = tszItemText;
@@ -252,10 +252,10 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w
if ((dat=(JABBER_MUC_JIDLIST_INFO *) lParam) != NULL) {
HXML iqNode = dat->iqNode;
if (iqNode != NULL) {
- LPCTSTR from = xmlGetAttrValue(iqNode, _T("from"));
+ LPCTSTR from = XmlGetAttrValue(iqNode, _T("from"));
if (from != NULL) {
dat->roomJid = mir_tstrdup(from);
- HXML queryNode = xmlGetChild(iqNode , _T("query"));
+ HXML queryNode = XmlGetChild(iqNode , _T("query"));
if (queryNode != NULL) {
TCHAR *localFrom = mir_tstrdup(from);
mir_sntprintf(title, _countof(title), TranslateT("%s, %d items (%s)"),
@@ -265,7 +265,7 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w
(dat->type == MUC_BANLIST) ? TranslateT("Ban List") :
(dat->type == MUC_ADMINLIST) ? TranslateT("Admin List") :
(dat->type == MUC_OWNERLIST) ? TranslateT("Owner List") :
- TranslateT("JID List"), xmlGetChildCount(queryNode), localFrom);
+ TranslateT("JID List"), XmlGetChildCount(queryNode), localFrom);
mir_free(localFrom);
}
}
@@ -449,11 +449,11 @@ static void CALLBACK JabberMucJidListCreateDialogApcProc(void* param)
if (iqNode == NULL)
return;
- LPCTSTR from = xmlGetAttrValue(iqNode, _T("from"));
+ LPCTSTR from = XmlGetAttrValue(iqNode, _T("from"));
if (from == NULL)
return;
- HXML queryNode = xmlGetChild(iqNode , _T("query"));
+ HXML queryNode = XmlGetChild(iqNode , _T("query"));
if (queryNode == NULL)
return;
@@ -492,7 +492,7 @@ static void CALLBACK JabberMucJidListCreateDialogApcProc(void* param)
void CJabberProto::OnIqResultMucGetJidList(HXML iqNode, JABBER_MUC_JIDLIST_TYPE listType)
{
- LPCTSTR type = xmlGetAttrValue(iqNode, _T("type"));
+ LPCTSTR type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
@@ -502,7 +502,7 @@ void CJabberProto::OnIqResultMucGetJidList(HXML iqNode, JABBER_MUC_JIDLIST_TYPE
jidListInfo->type = listType;
jidListInfo->ppro = this;
jidListInfo->roomJid = NULL; // Set in the dialog procedure
- if ((jidListInfo->iqNode = xi.copyNode(iqNode)) != NULL)
+ if ((jidListInfo->iqNode = xmlCopyNode(iqNode)) != NULL)
CallFunctionAsync(JabberMucJidListCreateDialogApcProc, jidListInfo);
else
mir_free(jidListInfo);
@@ -550,7 +550,7 @@ void CJabberProto::OnIqResultMucGetOwnerList(HXML iqNode, CJabberIqInfo *)
JABBER_MUC_JIDLIST_INFO::~JABBER_MUC_JIDLIST_INFO()
{
- xi.destroyNode(iqNode);
+ xmlDestroyNode(iqNode);
mir_free(roomJid);
}
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index 727f31b3a4..bc8841eeee 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -556,9 +556,9 @@ INT_PTR __cdecl CJabberProto::OnMenuTransportLogin(WPARAM hContact, LPARAM)
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrT(getTStringA(hContact, "jid")));
if (item != NULL) {
- XmlNode p(_T("presence")); xmlAddAttr(p, _T("to"), item->jid);
+ XmlNode p(_T("presence")); XmlAddAttr(p, _T("to"), item->jid);
if (item->getTemp()->m_iStatus == ID_STATUS_ONLINE)
- xmlAddAttr(p, _T("type"), _T("unavailable"));
+ XmlAddAttr(p, _T("type"), _T("unavailable"));
m_ThreadInfo->send(p);
}
return 0;
diff --git a/protocols/JabberG/src/jabber_message_handlers.cpp b/protocols/JabberG/src/jabber_message_handlers.cpp
index 77e900c76e..df87b2aade 100644
--- a/protocols/JabberG/src/jabber_message_handlers.cpp
+++ b/protocols/JabberG/src/jabber_message_handlers.cpp
@@ -42,9 +42,9 @@ BOOL CJabberProto::OnMessageError(HXML node, ThreadData*, CJabberMessageInfo* pI
}
else {
TCHAR buf[512];
- HXML bodyNode = xmlGetChild(node, "body");
+ HXML bodyNode = XmlGetChild(node, "body");
if (bodyNode)
- mir_sntprintf(buf, _T("%s:\n%s\n%s"), pInfo->GetFrom(), xmlGetText(bodyNode), szErrText);
+ mir_sntprintf(buf, _T("%s:\n%s\n%s"), pInfo->GetFrom(), XmlGetText(bodyNode), szErrText);
else
mir_sntprintf(buf, _T("%s:\n%s"), pInfo->GetFrom(), szErrText);
@@ -58,10 +58,10 @@ BOOL CJabberProto::OnMessageError(HXML node, ThreadData*, CJabberMessageInfo* pI
BOOL CJabberProto::OnMessageIbb(HXML, ThreadData*, CJabberMessageInfo* pInfo)
{
BOOL bOk = FALSE;
- const TCHAR *sid = xmlGetAttrValue(pInfo->GetChildNode(), _T("sid"));
- const TCHAR *seq = xmlGetAttrValue(pInfo->GetChildNode(), _T("seq"));
- if (sid && seq && xmlGetText(pInfo->GetChildNode()))
- bOk = OnIbbRecvdData(xmlGetText(pInfo->GetChildNode()), sid, seq);
+ const TCHAR *sid = XmlGetAttrValue(pInfo->GetChildNode(), _T("sid"));
+ const TCHAR *seq = XmlGetAttrValue(pInfo->GetChildNode(), _T("seq"));
+ if (sid && seq && XmlGetText(pInfo->GetChildNode()))
+ bOk = OnIbbRecvdData(XmlGetText(pInfo->GetChildNode()), sid, seq);
return TRUE;
}
@@ -82,7 +82,7 @@ BOOL CJabberProto::OnMessageGroupchat(HXML node, ThreadData*, CJabberMessageInfo
else {
// TCHAR *conference = NEWTSTR_ALLOCA(from);
// if (TCHAR *s = _tcschr(conference, _T('/'))) *s = 0;
-// XmlNode p("presence"); xmlAddAttr(p, "to", conference); xmlAddAttr(p, "type", "unavailable");
+// XmlNode p("presence"); XmlAddAttr(p, "to", conference); XmlAddAttr(p, "type", "unavailable");
// info->send(p);
}
return TRUE;
diff --git a/protocols/JabberG/src/jabber_message_manager.cpp b/protocols/JabberG/src/jabber_message_manager.cpp
index 4709b1dea1..cffaaaef41 100644
--- a/protocols/JabberG/src/jabber_message_manager.cpp
+++ b/protocols/JabberG/src/jabber_message_manager.cpp
@@ -57,7 +57,7 @@ bool CJabberMessageManager::HandleMessagePermanent(HXML node, ThreadData *pThrea
// have to get all data here, in the loop, because there's always possibility that previous handler modified it
CJabberMessageInfo messageInfo;
- LPCTSTR szType = xmlGetAttrValue(node, _T("type"));
+ LPCTSTR szType = XmlGetAttrValue(node, _T("type"));
if (szType) {
if (!mir_tstrcmpi(szType, _T("normal")))
messageInfo.m_nMessageType = JABBER_MESSAGE_TYPE_NORMAL;
@@ -75,12 +75,12 @@ bool CJabberMessageManager::HandleMessagePermanent(HXML node, ThreadData *pThrea
else messageInfo.m_nMessageType = JABBER_MESSAGE_TYPE_NORMAL;
if (pInfo.m_nMessageTypes & messageInfo.m_nMessageType) {
- for (int i = xmlGetChildCount(node) - 1; i >= 0; i--) {
+ for (int i = XmlGetChildCount(node) - 1; i >= 0; i--) {
// enumerate all children and see whether this node suits handler criteria
- HXML child = xmlGetChild(node, i);
+ HXML child = XmlGetChild(node, i);
- LPCTSTR szTagName = xmlGetName(child);
- LPCTSTR szXmlns = xmlGetAttrValue(child, _T("xmlns"));
+ LPCTSTR szTagName = XmlGetName(child);
+ LPCTSTR szXmlns = XmlGetAttrValue(child, _T("xmlns"));
if ((!pInfo.m_szXmlns || (szXmlns && !mir_tstrcmp(pInfo.m_szXmlns, szXmlns))) && (!pInfo.m_szTag || !mir_tstrcmp(pInfo.m_szTag, szTagName))) {
// node suits handler criteria, call the handler
@@ -88,13 +88,13 @@ bool CJabberMessageManager::HandleMessagePermanent(HXML node, ThreadData *pThrea
messageInfo.m_szChildTagName = szTagName;
messageInfo.m_szChildTagXmlns = szXmlns;
messageInfo.m_pUserData = pInfo.m_pUserData;
- messageInfo.m_szFrom = xmlGetAttrValue(node, _T("from")); // is necessary for ppro->debugLogA() below, that's why we must parse it even if JABBER_MESSAGE_PARSE_FROM flag is not set
+ messageInfo.m_szFrom = XmlGetAttrValue(node, _T("from")); // is necessary for ppro->debugLogA() below, that's why we must parse it even if JABBER_MESSAGE_PARSE_FROM flag is not set
if (pInfo.m_dwParamsToParse & JABBER_MESSAGE_PARSE_ID_STR)
- messageInfo.m_szId = xmlGetAttrValue(node, _T("id"));
+ messageInfo.m_szId = XmlGetAttrValue(node, _T("id"));
if (pInfo.m_dwParamsToParse & JABBER_IQ_PARSE_TO)
- messageInfo.m_szTo = xmlGetAttrValue(node, _T("to"));
+ messageInfo.m_szTo = XmlGetAttrValue(node, _T("to"));
if (pInfo.m_dwParamsToParse & JABBER_MESSAGE_PARSE_HCONTACT)
messageInfo.m_hContact = ppro->HContactFromJID(messageInfo.m_szFrom, 3);
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index e0961c2a9f..bf376b217d 100644
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -506,10 +506,10 @@ CMString CJabberProto::ExtractImage(HXML node)
LPCTSTR src;
CMString link;
- if ((nHtml = xmlGetChild(node, "html")) != NULL &&
- (nBody = xmlGetChild(nHtml, "body")) != NULL &&
- (nImg = xmlGetChild(nBody, "img")) != NULL &&
- (src = xmlGetAttrValue(nImg, _T("src"))) != NULL) {
+ if ((nHtml = XmlGetChild(node, "html")) != NULL &&
+ (nBody = XmlGetChild(nHtml, "body")) != NULL &&
+ (nImg = XmlGetChild(nBody, "img")) != NULL &&
+ (src = XmlGetAttrValue(nImg, _T("src"))) != NULL) {
CMString strSrc(src);
if (strSrc.Left(11).Compare(L"data:image/") == 0) {
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp
index a6800722c8..5b35fe871b 100644
--- a/protocols/JabberG/src/jabber_notes.cpp
+++ b/protocols/JabberG/src/jabber_notes.cpp
@@ -137,10 +137,10 @@ void CNoteList::LoadXml(HXML hXml)
destroy();
m_bIsModified = false;
- int count = xmlGetChildCount(hXml);
+ int count = XmlGetChildCount(hXml);
for (int i=0; i < count; i++)
{
- CNoteItem *pNote = new CNoteItem(xi.getChild(hXml, i));
+ CNoteItem *pNote = new CNoteItem(xmlGetChild(hXml, i));
if (pNote->IsNotEmpty())
insert(pNote);
else
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index f521cdcbfe..88a03769e6 100644
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -706,12 +706,12 @@ private:
m_cbServer.ResetContent();
if (node) {
for (int i=0; ; i++) {
- HXML n = xmlGetChild(node, i);
+ HXML n = XmlGetChild(node, i);
if (!n)
break;
- if (!mir_tstrcmp(xmlGetName(n), _T("item")))
- if (const TCHAR *jid = xmlGetAttrValue(n, _T("jid")))
+ if (!mir_tstrcmp(XmlGetName(n), _T("item")))
+ if (const TCHAR *jid = XmlGetAttrValue(n, _T("jid")))
if (m_cbServer.FindString(jid, -1, true) == CB_ERR)
m_cbServer.AddString(jid);
}
@@ -743,7 +743,7 @@ private:
TCHAR *buf = mir_a2t(result->pData);
XmlNode node(buf, NULL, NULL);
if (node) {
- HXML queryNode = xmlGetChild(node, _T("query"));
+ HXML queryNode = XmlGetChild(node, _T("query"));
SendMessage(hwnd, WM_JABBER_REFRESH, 0, (LPARAM)queryNode);
bIsError = false;
}
@@ -995,21 +995,21 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
HWND hList = GetDlgItem(rrud.hwndDlg, IDC_ROSTER);
if (rrud.bRRAction == RRA_FILLLIST) {
_RosterListClear(rrud.hwndDlg);
- HXML query = xmlGetChild(node , "query");
+ HXML query = XmlGetChild(node , "query");
if (query == NULL) return;
int i = 1;
while (TRUE) {
- HXML item = xmlGetNthChild(query, _T("item"), i++);
+ HXML item = XmlGetNthChild(query, _T("item"), i++);
if (item == NULL)
break;
- const TCHAR *jid = xmlGetAttrValue(item, _T("jid"));
+ const TCHAR *jid = XmlGetAttrValue(item, _T("jid"));
if (jid == NULL)
continue;
- const TCHAR *name = xmlGetAttrValue(item, _T("name"));
- const TCHAR *subscription = xmlGetAttrValue(item, _T("subscription"));
- const TCHAR *group = xmlGetText( xmlGetChild(item, "group"));
+ const TCHAR *name = XmlGetAttrValue(item, _T("name"));
+ const TCHAR *subscription = XmlGetAttrValue(item, _T("subscription"));
+ const TCHAR *group = XmlGetText( XmlGetChild(item, "group"));
_RosterInsertListItem(hList, jid, name, group, subscription, TRUE);
}
@@ -1043,7 +1043,7 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
if (rrud.bRRAction == RRA_SYNCROSTER) {
SetDlgItemText(rrud.hwndDlg, IDC_UPLOAD, TranslateT("Uploading..."));
- HXML queryRoster = xmlGetChild(node , "query");
+ HXML queryRoster = XmlGetChild(node , "query");
if (!queryRoster)
return;
@@ -1062,7 +1062,7 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
ListView_GetItemText(hList, index, 1, name, _countof(name));
ListView_GetItemText(hList, index, 2, group, _countof(group));
ListView_GetItemText(hList, index, 3, subscr, _countof(subscr));
- HXML itemRoster = xmlGetChildByTag(queryRoster, "item", "jid", jid);
+ HXML itemRoster = XmlGetChildByTag(queryRoster, "item", "jid", jid);
BOOL bRemove = !ListView_GetCheckState(hList,index);
if (itemRoster && bRemove) {
//delete item
@@ -1072,16 +1072,16 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
else if (!bRemove) {
BOOL bPushed = itemRoster ? TRUE : FALSE;
if (!bPushed) {
- const TCHAR *rosterName = xmlGetAttrValue(itemRoster, _T("name"));
+ const TCHAR *rosterName = XmlGetAttrValue(itemRoster, _T("name"));
if ((rosterName != NULL || name[0]!=0) && mir_tstrcmpi(rosterName,name))
bPushed=TRUE;
if (!bPushed) {
- rosterName = xmlGetAttrValue(itemRoster, _T("subscription"));
+ rosterName = XmlGetAttrValue(itemRoster, _T("subscription"));
if ((rosterName != NULL || subscr[0]!=0) && mir_tstrcmpi(rosterName,subscr))
bPushed=TRUE;
}
if (!bPushed) {
- const TCHAR *rosterGroup = xmlGetText( xmlGetChild(itemRoster, "group"));
+ const TCHAR *rosterGroup = XmlGetText( XmlGetChild(itemRoster, "group"));
if ((rosterGroup != NULL || group[0]!=0) && mir_tstrcmpi(rosterGroup,group))
bPushed=TRUE;
}
@@ -1231,9 +1231,9 @@ void CJabberProto::_RosterExportToFile(HWND hwndDlg)
char header[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?mso-application progid=\"Excel.Sheet\"?>\n";
fwrite(header, 1, sizeof(header) - 1 /* for zero terminator */, fp);
- TCHAR *xtmp = xi.toString(root, NULL);
+ TCHAR *xtmp = xmlToString(root, NULL);
fputs(T2Utf(xtmp), fp);
- xi.freeMem(xtmp);
+ xmlFree(xtmp);
fclose(fp);
}
@@ -1275,17 +1275,17 @@ void CJabberProto::_RosterImportFromFile(HWND hwndDlg)
int nBytesProcessed = 0;
XmlNode node(newBuf, &nBytesProcessed, NULL);
if (node) {
- HXML Workbook = xmlGetChild(node, _T("Workbook"));
+ HXML Workbook = XmlGetChild(node, _T("Workbook"));
if (Workbook) {
- HXML Worksheet = xmlGetChild(Workbook , "Worksheet");
+ HXML Worksheet = XmlGetChild(Workbook , "Worksheet");
if (Worksheet) {
- HXML Table = xmlGetChild(Worksheet , "Table");
+ HXML Table = XmlGetChild(Worksheet , "Table");
if (Table) {
int index=1;
HWND hList=GetDlgItem(hwndDlg, IDC_ROSTER);
while (TRUE)
{
- HXML Row = xmlGetNthChild(Table, _T("Row"), index++);
+ HXML Row = XmlGetNthChild(Table, _T("Row"), index++);
if (!Row)
break;
@@ -1294,36 +1294,36 @@ void CJabberProto::_RosterImportFromFile(HWND hwndDlg)
const TCHAR *name=NULL;
const TCHAR *group=NULL;
const TCHAR *subscr=NULL;
- HXML Cell = xmlGetNthChild(Row, _T("Cell"), 1);
- HXML Data = (Cell) ? xmlGetChild(Cell , "Data") : XmlNode();
+ HXML Cell = XmlGetNthChild(Row, _T("Cell"), 1);
+ HXML Data = (Cell) ? XmlGetChild(Cell , "Data") : XmlNode();
if (Data)
{
- if (!mir_tstrcmpi(xmlGetText(Data),_T("+"))) bAdd=TRUE;
- else if (mir_tstrcmpi(xmlGetText(Data),_T("-"))) continue;
+ if (!mir_tstrcmpi(XmlGetText(Data),_T("+"))) bAdd=TRUE;
+ else if (mir_tstrcmpi(XmlGetText(Data),_T("-"))) continue;
- Cell = xmlGetNthChild(Row, _T("Cell"),2);
- if (Cell) Data=xmlGetChild(Cell , "Data");
+ Cell = XmlGetNthChild(Row, _T("Cell"),2);
+ if (Cell) Data=XmlGetChild(Cell , "Data");
else Data = NULL;
if (Data)
{
- jid=xmlGetText(Data);
+ jid=XmlGetText(Data);
if (!jid || mir_tstrlen(jid)==0) continue;
}
- Cell=xmlGetNthChild(Row,_T("Cell"),3);
- if (Cell) Data=xmlGetChild(Cell , "Data");
+ Cell=XmlGetNthChild(Row,_T("Cell"),3);
+ if (Cell) Data=XmlGetChild(Cell , "Data");
else Data = NULL;
- if (Data) name=xmlGetText(Data);
+ if (Data) name=XmlGetText(Data);
- Cell=xmlGetNthChild(Row,_T("Cell"),4);
- if (Cell) Data=xmlGetChild(Cell , "Data");
+ Cell=XmlGetNthChild(Row,_T("Cell"),4);
+ if (Cell) Data=XmlGetChild(Cell , "Data");
else Data = NULL;
- if (Data) group=xmlGetText(Data);
+ if (Data) group=XmlGetText(Data);
- Cell=xmlGetNthChild(Row,_T("Cell"),5);
- if (Cell) Data=xmlGetChild(Cell , "Data");
+ Cell=XmlGetNthChild(Row,_T("Cell"),5);
+ if (Cell) Data=XmlGetChild(Cell , "Data");
else Data = NULL;
- if (Data) subscr=xmlGetText(Data);
+ if (Data) subscr=XmlGetText(Data);
}
_RosterInsertListItem(hList,jid,name,group,subscr,bAdd);
} } } } }
@@ -2059,12 +2059,12 @@ void CJabberDlgAccMgrUI::RefreshServers(HXML node)
m_cbServer.ResetContent();
if (node) {
for (int i = 0;; i++) {
- HXML n = xmlGetChild(node, i);
+ HXML n = XmlGetChild(node, i);
if (!n)
break;
- if (!mir_tstrcmp(xmlGetName(n), _T("item")))
- if (const TCHAR *jid = xmlGetAttrValue(n, _T("jid")))
+ if (!mir_tstrcmp(XmlGetName(n), _T("item")))
+ if (const TCHAR *jid = XmlGetAttrValue(n, _T("jid")))
if (m_cbServer.FindString(jid, -1, true) == CB_ERR)
m_cbServer.AddString(jid);
}
@@ -2094,7 +2094,7 @@ void CJabberDlgAccMgrUI::QueryServerListThread(void *arg)
TCHAR *ptszText = mir_a2t(result->pData);
XmlNode node(ptszText, NULL, NULL);
if (node) {
- HXML queryNode = xmlGetChild(node, _T("query"));
+ HXML queryNode = XmlGetChild(node, _T("query"));
if (queryNode && IsWindow(hwnd)) {
SendMessage(hwnd, WM_JABBER_REFRESH, 0, (LPARAM)queryNode);
bIsError = false;
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp
index 2a8a556305..e7863ca056 100644
--- a/protocols/JabberG/src/jabber_privacy.cpp
+++ b/protocols/JabberG/src/jabber_privacy.cpp
@@ -73,20 +73,20 @@ void CJabberProto::OnIqResultPrivacyList(HXML iqNode, CJabberIqInfo*)
if (iqNode == NULL)
return;
- const TCHAR *type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
if ( mir_tstrcmp(type, _T("result")))
return;
- HXML query = xmlGetChild(iqNode , "query");
+ HXML query = XmlGetChild(iqNode , "query");
if (query == NULL)
return;
- HXML list = xmlGetChild(query, "list");
+ HXML list = XmlGetChild(query, "list");
if (list == NULL)
return;
- TCHAR *szListName = (TCHAR*)xmlGetAttrValue(list, _T("name"));
+ TCHAR *szListName = (TCHAR*)XmlGetAttrValue(list, _T("name"));
if (!szListName)
return;
@@ -100,8 +100,8 @@ void CJabberProto::OnIqResultPrivacyList(HXML iqNode, CJabberIqInfo*)
}
HXML item;
- for (int i = 1; (item = xmlGetNthChild(list, _T("item"), i)) != NULL; i++) {
- const TCHAR *itemType = xmlGetAttrValue(item, _T("type"));
+ for (int i = 1; (item = XmlGetNthChild(list, _T("item"), i)) != NULL; i++) {
+ const TCHAR *itemType = XmlGetAttrValue(item, _T("type"));
PrivacyListRuleType nItemType = Else;
if (itemType) {
if (!mir_tstrcmpi(itemType, _T("jid")))
@@ -112,26 +112,26 @@ void CJabberProto::OnIqResultPrivacyList(HXML iqNode, CJabberIqInfo*)
nItemType = Subscription;
}
- const TCHAR *itemValue = xmlGetAttrValue(item, _T("value"));
+ const TCHAR *itemValue = XmlGetAttrValue(item, _T("value"));
- const TCHAR *itemAction = xmlGetAttrValue(item, _T("action"));
+ const TCHAR *itemAction = XmlGetAttrValue(item, _T("action"));
BOOL bAllow = TRUE;
if (itemAction && !mir_tstrcmpi(itemAction, _T("deny")))
bAllow = FALSE;
- const TCHAR *itemOrder = xmlGetAttrValue(item, _T("order"));
+ const TCHAR *itemOrder = XmlGetAttrValue(item, _T("order"));
DWORD dwOrder = 0;
if (itemOrder)
dwOrder = _ttoi(itemOrder);
DWORD dwPackets = 0;
- if (xmlGetChild(item , "message"))
+ if (XmlGetChild(item , "message"))
dwPackets |= JABBER_PL_RULE_TYPE_MESSAGE;
- if (xmlGetChild(item , "presence-in"))
+ if (XmlGetChild(item , "presence-in"))
dwPackets |= JABBER_PL_RULE_TYPE_PRESENCE_IN;
- if (xmlGetChild(item , "presence-out"))
+ if (XmlGetChild(item , "presence-out"))
dwPackets |= JABBER_PL_RULE_TYPE_PRESENCE_OUT;
- if (xmlGetChild(item , "iq"))
+ if (XmlGetChild(item , "iq"))
dwPackets |= JABBER_PL_RULE_TYPE_IQ;
pList->AddRule(nItemType, itemValue, bAllow, dwOrder, dwPackets);
}
@@ -179,7 +179,7 @@ void CJabberProto::OnIqResultPrivacyListActive(HXML iqNode, CJabberIqInfo *pInfo
if (iqNode == NULL)
return;
- const TCHAR *type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
@@ -214,7 +214,7 @@ void CJabberProto::OnIqResultPrivacyListDefault(HXML iqNode, CJabberIqInfo *pInf
if (iqNode == NULL)
return;
- const TCHAR *type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
@@ -247,7 +247,7 @@ void CJabberProto::OnIqResultPrivacyLists(HXML iqNode, CJabberIqInfo *pInfo)
if (pInfo->m_nIqType != JABBER_IQ_TYPE_RESULT)
return;
- HXML query = xmlGetChild(iqNode, "query");
+ HXML query = XmlGetChild(iqNode, "query");
if (query == NULL)
return;
@@ -258,11 +258,11 @@ void CJabberProto::OnIqResultPrivacyLists(HXML iqNode, CJabberIqInfo *pInfo)
m_privacyListManager.RemoveAllLists();
for (int i = 1; ; i++) {
- HXML list = xmlGetNthChild(query, _T("list"), i);
+ HXML list = XmlGetNthChild(query, _T("list"), i);
if (list == NULL)
break;
- const TCHAR *listName = xmlGetAttrValue(list, _T("name"));
+ const TCHAR *listName = XmlGetAttrValue(list, _T("name"));
if (listName) {
m_privacyListManager.AddList((TCHAR*)listName);
@@ -275,15 +275,15 @@ void CJabberProto::OnIqResultPrivacyLists(HXML iqNode, CJabberIqInfo *pInfo)
}
const TCHAR *szName = NULL;
- HXML node = xmlGetChild(query , "active");
+ HXML node = XmlGetChild(query , "active");
if (node)
- szName = xmlGetAttrValue(node, _T("name"));
+ szName = XmlGetAttrValue(node, _T("name"));
m_privacyListManager.SetActiveListName(szName);
szName = NULL;
- node = xmlGetChild(query , "default");
+ node = XmlGetChild(query , "default");
if (node)
- szName = xmlGetAttrValue(node, _T("name"));
+ szName = XmlGetAttrValue(node, _T("name"));
m_privacyListManager.SetDefaultListName(szName);
}
UI_SAFE_NOTIFY(m_pDlgPrivacyLists, WM_JABBER_REFRESH);
@@ -1687,7 +1687,7 @@ void CJabberDlgPrivacyLists::btnSetDefault_OnClick(CCtrlButton *)
HXML query = iq << XQUERY(JABBER_FEAT_PRIVACY_LISTS);
HXML defaultTag = query << XCHILD(_T("default"));
if (pList)
- xmlAddAttr(defaultTag, _T("name"), pList->GetListName());
+ XmlAddAttr(defaultTag, _T("name"), pList->GetListName());
lck.unlock();
SetStatusText(TranslateT(JABBER_PL_BUSY_MSG));
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 3ea5af5ddf..b314175b67 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -981,7 +981,7 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
else
msgType = _T("chat");
- XmlNode m(_T("message")); xmlAddAttr(m, _T("type"), msgType);
+ XmlNode m(_T("message")); XmlAddAttr(m, _T("type"), msgType);
if (!isEncrypted)
m << XCHILD(_T("body"), msg);
else {
@@ -1013,17 +1013,17 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
!m_options.MsgAck || !getByte(hContact, "MsgAck", TRUE))
{
if (!mir_tstrcmp(msgType, _T("groupchat")))
- xmlAddAttr(m, _T("to"), szClientJid);
+ XmlAddAttr(m, _T("to"), szClientJid);
else {
id = SerialNext();
- xmlAddAttr(m, _T("to"), szClientJid); xmlAddAttrID(m, id);
+ XmlAddAttr(m, _T("to"), szClientJid); XmlAddAttrID(m, id);
}
m_ThreadInfo->send(m);
ForkThread(&CJabberProto::SendMessageAckThread, new TFakeAckParams(hContact, 0, id));
}
else {
- xmlAddAttr(m, _T("to"), szClientJid); xmlAddAttrID(m, id);
+ XmlAddAttr(m, _T("to"), szClientJid); XmlAddAttrID(m, id);
// message receipts XEP priority
if (jcb & JABBER_CAPS_MESSAGE_RECEIPTS)
@@ -1250,7 +1250,7 @@ int __cdecl CJabberProto::UserIsTyping(MCONTACT hContact, int type)
if (jcb & JABBER_RESOURCE_CAPS_ERROR)
jcb = JABBER_RESOURCE_CAPS_NONE;
- XmlNode m(_T("message")); xmlAddAttr(m, _T("to"), szClientJid);
+ XmlNode m(_T("message")); XmlAddAttr(m, _T("to"), szClientJid);
if (jcb & JABBER_CAPS_CHATSTATES) {
m << XATTR(_T("type"), _T("chat")) << XATTRID(SerialNext());
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index 6e11c3c324..eb347895b9 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -58,7 +58,7 @@ BOOL CJabberProto::HandleAdhocCommandRequest(HXML iqNode, CJabberIqInfo *pInfo)
return TRUE;
}
- const TCHAR *szNode = xmlGetAttrValue(pInfo->GetChildNode(), _T("node"));
+ const TCHAR *szNode = XmlGetAttrValue(pInfo->GetChildNode(), _T("node"));
if (!szNode)
return TRUE;
@@ -154,7 +154,7 @@ BOOL CJabberAdhocManager::HandleCommandRequest(HXML iqNode, CJabberIqInfo *pInfo
return FALSE;
}
- const TCHAR *szSessionId = xmlGetAttrValue(commandNode, _T("sessionid"));
+ const TCHAR *szSessionId = XmlGetAttrValue(commandNode, _T("sessionid"));
CJabberAdhocSession* pSession = NULL;
if (szSessionId) {
@@ -333,15 +333,15 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc
if (pSession->GetStage() == 1) {
// result form here
HXML commandNode = pInfo->GetChildNode();
- HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
+ HXML xNode = XmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if (!xNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
- HXML fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("status")), valueNode;
+ HXML fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("status")), valueNode;
if (!fieldNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
- LPCTSTR ptszValue = xmlGetText( xmlGetChild(fieldNode , "value"));
+ LPCTSTR ptszValue = XmlGetText( XmlGetChild(fieldNode , "value"));
if (ptszValue == NULL)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
@@ -358,18 +358,18 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc
int priority = -9999;
- fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("status-priority"));
- if (fieldNode && (valueNode = xmlGetChild(fieldNode , "value")))
- if (ptszValue = xmlGetText(valueNode))
+ fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("status-priority"));
+ if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
+ if (ptszValue = XmlGetText(valueNode))
priority = _ttoi(ptszValue);
if (priority >= -128 && priority <= 127)
setWord("Priority", (WORD)priority);
const TCHAR *szStatusMessage = NULL;
- fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("status-message"));
- if (fieldNode && (valueNode = xmlGetChild(fieldNode , "value")))
- szStatusMessage = xmlGetText(valueNode);
+ fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("status-message"));
+ if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
+ szStatusMessage = XmlGetText(valueNode);
// skip f...ng away dialog
int nNoDlg = db_get_b(NULL, "SRAway", StatusModeToDbSetting(status, "NoDlg"), 0);
@@ -377,9 +377,9 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc
db_set_ts(NULL, "SRAway", StatusModeToDbSetting(status, "Msg"), szStatusMessage ? szStatusMessage : _T(""));
- fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("status-global"));
- if (fieldNode && (valueNode = xmlGetChild(fieldNode , "value"))) {
- if ((ptszValue = xmlGetText(valueNode)) != NULL && _ttoi(ptszValue))
+ fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("status-global"));
+ if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value"))) {
+ if ((ptszValue = XmlGetText(valueNode)) != NULL && _ttoi(ptszValue))
CallService(MS_CLIST_SETSTATUSMODE, status, NULL);
else
CallProtoService(m_szModuleName, PS_SETSTATUS, status, NULL);
@@ -434,26 +434,26 @@ int CJabberProto::AdhocOptionsHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
if (pSession->GetStage() == 1) {
// result form here
HXML commandNode = pInfo->GetChildNode();
- HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
+ HXML xNode = XmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if (!xNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
// Automatically Accept File Transfers
- HXML fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("auto-files")), valueNode;
- if (fieldNode && (valueNode = xmlGetChild(fieldNode , "value")))
- if (xmlGetText(valueNode))
- db_set_b(NULL, "SRFile", "AutoAccept", (BYTE)_ttoi(xmlGetText(valueNode)));
+ HXML fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("auto-files")), valueNode;
+ if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
+ if (XmlGetText(valueNode))
+ db_set_b(NULL, "SRFile", "AutoAccept", (BYTE)_ttoi(XmlGetText(valueNode)));
// Use sounds
- fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("sounds"));
- if (fieldNode && (valueNode = xmlGetChild(fieldNode , "value")))
- if (xmlGetText(valueNode))
- db_set_b(NULL, "Skin", "UseSound", (BYTE)_ttoi(xmlGetText(valueNode)));
+ fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("sounds"));
+ if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
+ if (XmlGetText(valueNode))
+ db_set_b(NULL, "Skin", "UseSound", (BYTE)_ttoi(XmlGetText(valueNode)));
// Disable remote controlling
- fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("enable-rc"));
- if (fieldNode && (valueNode = xmlGetChild(fieldNode , "value")))
- if (xmlGetText(valueNode) && _ttoi(xmlGetText(valueNode)))
+ fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("enable-rc"));
+ if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
+ if (XmlGetText(valueNode) && _ttoi(XmlGetText(valueNode)))
m_options.EnableRemoteControl = 0;
return JABBER_ADHOC_HANDLER_STATUS_COMPLETED;
@@ -535,16 +535,16 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
if (pSession->GetStage() == 1) {
// result form here
HXML commandNode = pInfo->GetChildNode();
- HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
+ HXML xNode = XmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if (!xNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
BOOL bRemoveCListEvents = TRUE;
// remove clist events
- HXML fieldNode = xmlGetChildByTag(xNode,"field", "var", _T("remove-clist-events")), valueNode;
- if (fieldNode && (valueNode = xmlGetChild(fieldNode , "value")))
- if (xmlGetText(valueNode) && !_ttoi(xmlGetText(valueNode)))
+ HXML fieldNode = XmlGetChildByTag(xNode,"field", "var", _T("remove-clist-events")), valueNode;
+ if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
+ if (XmlGetText(valueNode) && !_ttoi(XmlGetText(valueNode)))
bRemoveCListEvents = FALSE;
m_options.RcMarkMessagesAsRead = bRemoveCListEvents ? 1 : 0;
@@ -674,16 +674,16 @@ int CJabberProto::AdhocQuitMirandaHandler(HXML, CJabberIqInfo *pInfo, CJabberAdh
if (pSession->GetStage() == 1) {
// result form here
HXML commandNode = pInfo->GetChildNode();
- HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
+ HXML xNode = XmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if (!xNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
HXML fieldNode, valueNode;
// I Agree checkbox
- fieldNode = xmlGetChildByTag(xNode,"field", "var", _T("allow-shutdown"));
- if (fieldNode && (valueNode = xmlGetChild(fieldNode , "value")))
- if (xmlGetText(valueNode) && _ttoi(xmlGetText(valueNode)))
+ fieldNode = XmlGetChildByTag(xNode,"field", "var", _T("allow-shutdown"));
+ if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
+ if (XmlGetText(valueNode) && _ttoi(XmlGetText(valueNode)))
CallFunctionAsync(JabberQuitMirandaIMThread, 0);
return JABBER_ADHOC_HANDLER_STATUS_COMPLETED;
@@ -754,17 +754,17 @@ int CJabberProto::AdhocLeaveGroupchatsHandler(HXML, CJabberIqInfo *pInfo, CJabbe
if (pSession->GetStage() == 1) {
// result form here
HXML commandNode = pInfo->GetChildNode();
- HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
+ HXML xNode = XmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if (!xNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
// Groupchat list here:
- HXML fieldNode = xmlGetChildByTag(xNode,"field", "var", _T("groupchats"));
+ HXML fieldNode = XmlGetChildByTag(xNode,"field", "var", _T("groupchats"));
if (fieldNode) {
- for (i=0; i < xmlGetChildCount(fieldNode); i++) {
- HXML valueNode = xmlGetChild(fieldNode, i);
- if (valueNode && xmlGetName(valueNode) && xmlGetText(valueNode) && !mir_tstrcmp(xmlGetName(valueNode), _T("value"))) {
- JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_CHATROOM, xmlGetText(valueNode));
+ for (i=0; i < XmlGetChildCount(fieldNode); i++) {
+ HXML valueNode = XmlGetChild(fieldNode, i);
+ if (valueNode && XmlGetName(valueNode) && XmlGetText(valueNode) && !mir_tstrcmp(XmlGetName(valueNode), _T("value"))) {
+ JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_CHATROOM, XmlGetText(valueNode));
if (item)
GcQuit(item, 0, NULL);
}
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp
index 87fcc15b21..d05e00da66 100644
--- a/protocols/JabberG/src/jabber_search.cpp
+++ b/protocols/JabberG/src/jabber_search.cpp
@@ -137,38 +137,38 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*)
if (!searchHandleDlg)
return;
- LPCTSTR type = xmlGetAttrValue(iqNode, _T("type"));
+ LPCTSTR type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
if (!mir_tstrcmp(type, _T("result"))) {
- HXML queryNode = xmlGetNthChild(iqNode, _T("query"), 1);
- HXML xNode = xmlGetChildByTag(queryNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
+ HXML queryNode = XmlGetNthChild(iqNode, _T("query"), 1);
+ HXML xNode = XmlGetChildByTag(queryNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
ShowWindow(searchHandleDlg, SW_HIDE);
if (xNode) {
//1. Form
- PostMessage(searchHandleDlg, WM_USER + 11, (WPARAM)xi.copyNode(xNode), 0);
- HXML xcNode = xmlGetNthChild(xNode, _T("instructions"), 1);
+ PostMessage(searchHandleDlg, WM_USER + 11, (WPARAM)xmlCopyNode(xNode), 0);
+ HXML xcNode = XmlGetNthChild(xNode, _T("instructions"), 1);
if (xcNode)
- SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, xmlGetText(xcNode));
+ SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, XmlGetText(xcNode));
}
else {
int Order = 0;
for (int i = 0;; i++) {
- HXML chNode = xmlGetChild(queryNode, i);
+ HXML chNode = XmlGetChild(queryNode, i);
if (!chNode)
break;
- if (!mir_tstrcmpi(xmlGetName(chNode), _T("instructions")) && xmlGetText(chNode))
- SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, TranslateTS(xmlGetText(chNode)));
- else if (xmlGetName(chNode)) {
+ if (!mir_tstrcmpi(XmlGetName(chNode), _T("instructions")) && XmlGetText(chNode))
+ SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, TranslateTS(XmlGetText(chNode)));
+ else if (XmlGetName(chNode)) {
Data *MyData = (Data*)malloc(sizeof(Data));
memset(MyData, 0, sizeof(Data));
- MyData->Label = mir_tstrdup(xmlGetName(chNode));
- MyData->Var = mir_tstrdup(xmlGetName(chNode));
- MyData->defValue = mir_tstrdup(xmlGetText(chNode));
+ MyData->Label = mir_tstrdup(XmlGetName(chNode));
+ MyData->Var = mir_tstrdup(XmlGetName(chNode));
+ MyData->defValue = mir_tstrdup(XmlGetText(chNode));
MyData->Order = Order;
if (MyData->defValue) MyData->bReadOnly = TRUE;
PostMessage(searchHandleDlg, WM_USER + 10, FALSE, (LPARAM)MyData);
@@ -177,7 +177,7 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*)
}
}
- const TCHAR *szFrom = xmlGetAttrValue(iqNode, _T("from"));
+ const TCHAR *szFrom = XmlGetAttrValue(iqNode, _T("from"));
if (szFrom)
SearchAddToRecent(szFrom, searchHandleDlg);
PostMessage(searchHandleDlg, WM_USER + 10, 0, 0);
@@ -187,10 +187,10 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*)
const TCHAR *code = NULL;
const TCHAR *description = NULL;
TCHAR buff[255];
- HXML errorNode = xmlGetChild(iqNode, "error");
+ HXML errorNode = XmlGetChild(iqNode, "error");
if (errorNode) {
- code = xmlGetAttrValue(errorNode, _T("code"));
- description = xmlGetText(errorNode);
+ code = XmlGetAttrValue(errorNode, _T("code"));
+ description = XmlGetText(errorNode);
}
mir_sntprintf(buff, TranslateT("Error %s %s\r\nPlease select other server"), code ? code : _T(""), description ? description : _T(""));
SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, buff);
@@ -307,23 +307,23 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
U_TCHAR_MAP mColumnsNames(10);
LIST<void> SearchResults(2);
- if (((id = JabberGetPacketID(iqNode)) == -1) || ((type = xmlGetAttrValue(iqNode, _T("type"))) == NULL)) {
+ if (((id = JabberGetPacketID(iqNode)) == -1) || ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL)) {
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
return;
}
if (!mir_tstrcmp(type, _T("result"))) {
- HXML queryNode = xmlGetNthChild(iqNode, _T("query"), 1);
- HXML xNode = xmlGetChildByTag(queryNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
+ HXML queryNode = XmlGetNthChild(iqNode, _T("query"), 1);
+ HXML xNode = XmlGetChildByTag(queryNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if (xNode) {
//1. Form search results info
- HXML reportNode = xmlGetNthChild(xNode, _T("reported"), 1);
+ HXML reportNode = XmlGetNthChild(xNode, _T("reported"), 1);
if (reportNode) {
int i = 1;
- while (HXML fieldNode = xmlGetNthChild(reportNode, _T("field"), i++)) {
- TCHAR *var = (TCHAR*)xmlGetAttrValue(fieldNode, _T("var"));
+ while (HXML fieldNode = XmlGetNthChild(reportNode, _T("field"), i++)) {
+ TCHAR *var = (TCHAR*)XmlGetAttrValue(fieldNode, _T("var"));
if (var) {
- TCHAR *Label = (TCHAR*)xmlGetAttrValue(fieldNode, _T("label"));
+ TCHAR *Label = (TCHAR*)XmlGetAttrValue(fieldNode, _T("label"));
mColumnsNames.insert(var, (Label != NULL) ? Label : var);
}
}
@@ -331,12 +331,12 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
int i = 1;
HXML itemNode;
- while (itemNode = xmlGetNthChild(xNode, _T("item"), i++)) {
+ while (itemNode = XmlGetNthChild(xNode, _T("item"), i++)) {
U_TCHAR_MAP *pUserColumn = new U_TCHAR_MAP(10);
int j = 1;
- while (HXML fieldNode = xmlGetNthChild(itemNode, _T("field"), j++)) {
- if (TCHAR* var = (TCHAR*)xmlGetAttrValue(fieldNode, _T("var"))) {
- if (TCHAR* Text = (TCHAR*)xmlGetText(xmlGetChild(fieldNode, _T("value")))) {
+ while (HXML fieldNode = XmlGetNthChild(itemNode, _T("field"), j++)) {
+ if (TCHAR* var = (TCHAR*)XmlGetAttrValue(fieldNode, _T("var"))) {
+ if (TCHAR* Text = (TCHAR*)XmlGetText(XmlGetChild(fieldNode, _T("value")))) {
if (!mColumnsNames[var])
mColumnsNames.insert(var, var);
pUserColumn->insert(var, Text);
@@ -350,23 +350,23 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
else {
//2. Field list search results info
int i = 1;
- while (HXML itemNode = xmlGetNthChild(queryNode, _T("item"), i++)) {
+ while (HXML itemNode = XmlGetNthChild(queryNode, _T("item"), i++)) {
U_TCHAR_MAP *pUserColumn = new U_TCHAR_MAP(10);
- TCHAR *jid = (TCHAR*)xmlGetAttrValue(itemNode, _T("jid"));
+ TCHAR *jid = (TCHAR*)XmlGetAttrValue(itemNode, _T("jid"));
TCHAR *keyReturned;
mColumnsNames.insertCopyKey(_T("jid"), _T("jid"), &keyReturned, CopyKey, DestroyKey);
mColumnsNames.insert(_T("jid"), keyReturned);
pUserColumn->insertCopyKey(_T("jid"), jid, NULL, CopyKey, DestroyKey);
for (int j = 0;; j++) {
- HXML child = xmlGetChild(itemNode, j);
+ HXML child = XmlGetChild(itemNode, j);
if (!child)
break;
- const TCHAR *szColumnName = xmlGetName(child);
+ const TCHAR *szColumnName = XmlGetName(child);
if (szColumnName) {
- LPCTSTR ptszChild = xmlGetText(child);
+ LPCTSTR ptszChild = XmlGetText(child);
if (ptszChild && *ptszChild) {
mColumnsNames.insertCopyKey((TCHAR*)szColumnName, _T(""), &keyReturned, CopyKey, DestroyKey);
mColumnsNames.insert((TCHAR*)szColumnName, keyReturned);
@@ -383,10 +383,10 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
const TCHAR *code = NULL;
const TCHAR *description = NULL;
TCHAR buff[255];
- HXML errorNode = xmlGetChild(iqNode, "error");
+ HXML errorNode = XmlGetChild(iqNode, "error");
if (errorNode) {
- code = xmlGetAttrValue(errorNode, _T("code"));
- description = xmlGetText(errorNode);
+ code = XmlGetAttrValue(errorNode, _T("code"));
+ description = XmlGetText(errorNode);
}
mir_sntprintf(buff, TranslateT("Error %s %s\r\nTry to specify more detailed"), code ? code : _T(""), description ? description : _T(""));
@@ -432,7 +432,7 @@ static void JabberSearchFreeData(HWND hwndDlg, JabberSearchData * dat)
else EnumChildWindows(GetDlgItem(hwndDlg, IDC_FRAME), DeleteChildWindowsProc, 0);
if (dat->xNode)
- xi.destroyNode(dat->xNode);
+ xmlDestroyNode(dat->xNode);
SendDlgItemMessage(hwndDlg, IDC_FRAME, WM_SETFONT, (WPARAM)SendMessage(hwndDlg, WM_GETFONT, 0, 0), 0);
dat->nJSInfCount = 0;
@@ -758,15 +758,15 @@ HWND __cdecl CJabberProto::SearchAdvanced(HWND hwndDlg)
if (dat->fSearchRequestIsXForm) {
fRequestNotEmpty = TRUE;
HXML n = JabberFormGetData(GetDlgItem(hwndDlg, IDC_FRAME), dat->xNode);
- xmlAddChild(query, n);
- xi.destroyNode(n);
+ XmlAddChild(query, n);
+ xmlDestroyNode(n);
}
else { //and Simple fields: XEP-0055 Example 3
for (int i = 0; i < dat->nJSInfCount; i++) {
TCHAR szFieldValue[100];
GetWindowText(dat->pJSInf[i].hwndValueItem, szFieldValue, _countof(szFieldValue));
if (szFieldValue[0] != 0) {
- xmlAddChild(query, dat->pJSInf[i].szFieldName, szFieldValue);
+ XmlAddChild(query, dat->pJSInf[i].szFieldName, szFieldValue);
fRequestNotEmpty = TRUE;
}
}
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index f22f0299ed..e02a190684 100644
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -193,18 +193,18 @@ void CJabberProto::xmlStreamInitializeNow(ThreadData *info)
m_szXmlStreamToBeInitialized = NULL;
}
- HXML n = xi.createNode(_T("xml"), NULL, 1) << XATTR(_T("version"), _T("1.0")) << XATTR(_T("encoding"), _T("UTF-8"));
+ HXML n = xmlCreateNode(_T("xml"), NULL, 1) << XATTR(_T("version"), _T("1.0")) << XATTR(_T("encoding"), _T("UTF-8"));
HXML stream = n << XCHILDNS(_T("stream:stream"), _T("jabber:client")) << XATTR(_T("to"), _A2T(info->conn.server))
<< XATTR(_T("xmlns:stream"), _T("http://etherx.jabber.org/streams"));
if (m_tszSelectedLang)
- xmlAddAttr(stream, _T("xml:lang"), m_tszSelectedLang);
+ XmlAddAttr(stream, _T("xml:lang"), m_tszSelectedLang);
if (!m_options.Disable3920auth)
- xmlAddAttr(stream, _T("version"), _T("1.0"));
+ XmlAddAttr(stream, _T("version"), _T("1.0"));
- LPTSTR xmlQuery = xi.toString(n, NULL);
+ LPTSTR xmlQuery = xmlToString(n, NULL);
T2Utf buf(xmlQuery);
int bufLen = (int)mir_strlen(buf);
if (bufLen > 2) {
@@ -213,8 +213,8 @@ void CJabberProto::xmlStreamInitializeNow(ThreadData *info)
}
info->send(buf, bufLen);
- xi.freeMem(xmlQuery);
- xi.destroyNode(n);
+ xmlFree(xmlQuery);
+ xmlDestroyNode(n);
}
void CJabberProto::ServerThread(JABBER_CONN_DATA *param)
@@ -461,9 +461,9 @@ recvRest:
debugLogA("bytesParsed = %d", bytesParsed);
if (root) tag = NULL;
- if (xmlGetName(root) == NULL) {
+ if (XmlGetName(root) == NULL) {
for (int i = 0;; i++) {
- HXML n = xmlGetChild(root, i);
+ HXML n = XmlGetChild(root, i);
if (!n)
break;
OnProcessProtocol(n, &info);
@@ -566,17 +566,17 @@ void CJabberProto::PerformIqAuth(ThreadData *info)
void CJabberProto::OnProcessStreamOpening(HXML node, ThreadData *info)
{
- if (mir_tstrcmp(xmlGetName(node), _T("stream:stream")))
+ if (mir_tstrcmp(XmlGetName(node), _T("stream:stream")))
return;
if (!info->bIsReg) {
- const TCHAR *sid = xmlGetAttrValue(node, _T("id"));
+ const TCHAR *sid = XmlGetAttrValue(node, _T("id"));
if (sid != NULL)
info->szStreamId = mir_t2a(sid);
}
// old server - disable SASL then
- if (xmlGetAttrValue(node, _T("version")) == NULL)
+ if (XmlGetAttrValue(node, _T("version")) == NULL)
info->proto->m_options.Disable3920auth = TRUE;
if (info->proto->m_options.Disable3920auth)
@@ -675,33 +675,33 @@ void CJabberProto::OnProcessFeatures(HXML node, ThreadData *info)
bool areMechanismsDefined = false;
for (int i = 0;; i++) {
- HXML n = xmlGetChild(node, i);
+ HXML n = XmlGetChild(node, i);
if (!n)
break;
- if (!mir_tstrcmp(xmlGetName(n), _T("starttls"))) {
+ if (!mir_tstrcmp(XmlGetName(n), _T("starttls"))) {
if (!info->conn.useSSL && m_options.UseTLS) {
debugLogA("Requesting TLS");
- info->send(XmlNode(xmlGetName(n)) << XATTR(_T("xmlns"), _T("urn:ietf:params:xml:ns:xmpp-tls")));
+ info->send(XmlNode(XmlGetName(n)) << XATTR(_T("xmlns"), _T("urn:ietf:params:xml:ns:xmpp-tls")));
return;
} }
- if (!mir_tstrcmp(xmlGetName(n), _T("compression")) && m_options.EnableZlib == TRUE) {
+ if (!mir_tstrcmp(XmlGetName(n), _T("compression")) && m_options.EnableZlib == TRUE) {
debugLogA("Server compression available");
for (int k = 0;; k++) {
- HXML c = xmlGetChild(n, k);
+ HXML c = XmlGetChild(n, k);
if (!c)
break;
- if (!mir_tstrcmp(xmlGetName(c), _T("method"))) {
- if (!mir_tstrcmp(xmlGetText(c), _T("zlib")) && info->zlibInit() == TRUE) {
+ if (!mir_tstrcmp(XmlGetName(c), _T("method"))) {
+ if (!mir_tstrcmp(XmlGetText(c), _T("zlib")) && info->zlibInit() == TRUE) {
debugLogA("Requesting Zlib compression");
info->send(XmlNode(_T("compress")) << XATTR(_T("xmlns"), _T("http://jabber.org/protocol/compress"))
<< XCHILD(_T("method"), _T("zlib")));
return;
} } } }
- if (!mir_tstrcmp(xmlGetName(n), _T("mechanisms"))) {
+ if (!mir_tstrcmp(XmlGetName(n), _T("mechanisms"))) {
m_AuthMechs.isPlainAvailable = false;
m_AuthMechs.isPlainOldAvailable = false;
m_AuthMechs.isMd5Available = false;
@@ -714,12 +714,12 @@ void CJabberProto::OnProcessFeatures(HXML node, ThreadData *info)
areMechanismsDefined = true;
//JabberLog("%d mechanisms\n",n->numChild);
for (int k = 0;; k++) {
- HXML c = xmlGetChild(n, k);
+ HXML c = XmlGetChild(n, k);
if (!c)
break;
- if (!mir_tstrcmp(xmlGetName(c), _T("mechanism"))) {
- LPCTSTR ptszMechanism = xmlGetText(c);
+ if (!mir_tstrcmp(XmlGetName(c), _T("mechanism"))) {
+ LPCTSTR ptszMechanism = XmlGetText(c);
if (!mir_tstrcmp(ptszMechanism, _T("PLAIN"))) m_AuthMechs.isPlainOldAvailable = m_AuthMechs.isPlainAvailable = true;
else if (!mir_tstrcmp(ptszMechanism, _T("DIGEST-MD5"))) m_AuthMechs.isMd5Available = true;
else if (!mir_tstrcmp(ptszMechanism, _T("SCRAM-SHA-1"))) m_AuthMechs.isScramAvailable = true;
@@ -727,17 +727,17 @@ void CJabberProto::OnProcessFeatures(HXML node, ThreadData *info)
else if (!mir_tstrcmp(ptszMechanism, _T("GSS-SPNEGO"))) m_AuthMechs.isSpnegoAvailable = true;
else if (!mir_tstrcmp(ptszMechanism, _T("GSSAPI"))) m_AuthMechs.isKerberosAvailable = true;
}
- else if (!mir_tstrcmp(xmlGetName(c), _T("hostname"))) {
- const TCHAR *mech = xmlGetAttrValue(c, _T("mechanism"));
+ else if (!mir_tstrcmp(XmlGetName(c), _T("hostname"))) {
+ const TCHAR *mech = XmlGetAttrValue(c, _T("mechanism"));
if (mech && mir_tstrcmpi(mech, _T("GSSAPI")) == 0) {
- m_AuthMechs.m_gssapiHostName = mir_tstrdup(xmlGetText(c));
+ m_AuthMechs.m_gssapiHostName = mir_tstrdup(XmlGetText(c));
}
}
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("register"))) isRegisterAvailable = true;
- else if (!mir_tstrcmp(xmlGetName(n), _T("auth"))) m_AuthMechs.isAuthAvailable = true;
- else if (!mir_tstrcmp(xmlGetName(n), _T("session"))) m_AuthMechs.isSessionAvailable = true;
+ else if (!mir_tstrcmp(XmlGetName(n), _T("register"))) isRegisterAvailable = true;
+ else if (!mir_tstrcmp(XmlGetName(n), _T("auth"))) m_AuthMechs.isAuthAvailable = true;
+ else if (!mir_tstrcmp(XmlGetName(n), _T("session"))) m_AuthMechs.isSessionAvailable = true;
}
if (areMechanismsDefined) {
@@ -769,7 +769,7 @@ void CJabberProto::OnProcessFailure(HXML node, ThreadData *info)
{
const TCHAR *type;
//failure xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\"
- if ((type = xmlGetAttrValue(node, _T("xmlns"))) == NULL) return;
+ if ((type = XmlGetAttrValue(node, _T("xmlns"))) == NULL) return;
if (!mir_tstrcmp(type, _T("urn:ietf:params:xml:ns:xmpp-sasl"))) {
PerformAuthentication(info);
}
@@ -783,18 +783,18 @@ void CJabberProto::OnProcessError(HXML node, ThreadData *info)
bool skipMsg = false;
//failure xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\"
- if (!xmlGetChild(node, 0))
+ if (!XmlGetChild(node, 0))
return;
buff = (TCHAR *)mir_alloc(1024 * sizeof(TCHAR));
pos = 0;
for (i = 0;; i++) {
- HXML n = xmlGetChild(node, i);
+ HXML n = XmlGetChild(node, i);
if (!n)
break;
- const TCHAR *name = xmlGetName(n);
- const TCHAR *desc = xmlGetText(n);
+ const TCHAR *name = XmlGetName(n);
+ const TCHAR *desc = XmlGetText(n);
if (desc)
pos += mir_sntprintf(buff + pos, 1024 - pos, _T("%s: %s\r\n"), name, desc);
else
@@ -817,11 +817,11 @@ void CJabberProto::OnProcessSuccess(HXML node, ThreadData *info)
// int iqId;
// RECVED: <success ...
// ACTION: if successfully logged in, continue by requesting roster list and set my initial status
- if ((type = xmlGetAttrValue(node, _T("xmlns"))) == NULL)
+ if ((type = XmlGetAttrValue(node, _T("xmlns"))) == NULL)
return;
if (!mir_tstrcmp(type, _T("urn:ietf:params:xml:ns:xmpp-sasl"))) {
- if (!info->auth->validateLogin(xmlGetText(node))) {
+ if (!info->auth->validateLogin(XmlGetText(node))) {
info->send("</stream:stream>");
return;
}
@@ -843,10 +843,10 @@ void CJabberProto::OnProcessChallenge(HXML node, ThreadData *info)
return;
}
- if (mir_tstrcmp(xmlGetAttrValue(node, _T("xmlns")), _T("urn:ietf:params:xml:ns:xmpp-sasl")))
+ if (mir_tstrcmp(XmlGetAttrValue(node, _T("xmlns")), _T("urn:ietf:params:xml:ns:xmpp-sasl")))
return;
- char* challenge = info->auth->getChallenge(xmlGetText(node));
+ char* challenge = info->auth->getChallenge(XmlGetText(node));
info->send(XmlNode(_T("response"), _A2T(challenge)) << XATTR(_T("xmlns"), _T("urn:ietf:params:xml:ns:xmpp-sasl")));
mir_free(challenge);
}
@@ -855,34 +855,34 @@ void CJabberProto::OnProcessProtocol(HXML node, ThreadData *info)
{
OnConsoleProcessXml(node, JCPF_IN);
- if (!mir_tstrcmp(xmlGetName(node), _T("proceed")))
+ if (!mir_tstrcmp(XmlGetName(node), _T("proceed")))
OnProcessProceed(node, info);
- else if (!mir_tstrcmp(xmlGetName(node), _T("compressed")))
+ else if (!mir_tstrcmp(XmlGetName(node), _T("compressed")))
OnProcessCompressed(node, info);
- else if (!mir_tstrcmp(xmlGetName(node), _T("stream:features")))
+ else if (!mir_tstrcmp(XmlGetName(node), _T("stream:features")))
OnProcessFeatures(node, info);
- else if (!mir_tstrcmp(xmlGetName(node), _T("stream:stream")))
+ else if (!mir_tstrcmp(XmlGetName(node), _T("stream:stream")))
OnProcessStreamOpening(node, info);
- else if (!mir_tstrcmp(xmlGetName(node), _T("success")))
+ else if (!mir_tstrcmp(XmlGetName(node), _T("success")))
OnProcessSuccess(node, info);
- else if (!mir_tstrcmp(xmlGetName(node), _T("failure")))
+ else if (!mir_tstrcmp(XmlGetName(node), _T("failure")))
OnProcessFailure(node, info);
- else if (!mir_tstrcmp(xmlGetName(node), _T("stream:error")))
+ else if (!mir_tstrcmp(XmlGetName(node), _T("stream:error")))
OnProcessError(node, info);
- else if (!mir_tstrcmp(xmlGetName(node), _T("challenge")))
+ else if (!mir_tstrcmp(XmlGetName(node), _T("challenge")))
OnProcessChallenge(node, info);
else if (!info->bIsReg) {
- if (!mir_tstrcmp(xmlGetName(node), _T("message")))
+ if (!mir_tstrcmp(XmlGetName(node), _T("message")))
OnProcessMessage(node, info);
- else if (!mir_tstrcmp(xmlGetName(node), _T("presence")))
+ else if (!mir_tstrcmp(XmlGetName(node), _T("presence")))
OnProcessPresence(node, info);
- else if (!mir_tstrcmp(xmlGetName(node), _T("iq")))
+ else if (!mir_tstrcmp(XmlGetName(node), _T("iq")))
OnProcessIq(node);
else
debugLogA("Invalid top-level tag (only <message/> <presence/> and <iq/> allowed)");
}
else {
- if (!mir_tstrcmp(xmlGetName(node), _T("iq")))
+ if (!mir_tstrcmp(XmlGetName(node), _T("iq")))
OnProcessRegIq(node, info);
else
debugLogA("Invalid top-level tag (only <iq/> allowed)");
@@ -892,7 +892,7 @@ void CJabberProto::OnProcessProtocol(HXML node, ThreadData *info)
void CJabberProto::OnProcessProceed(HXML node, ThreadData *info)
{
const TCHAR *type;
- if ((type = xmlGetAttrValue(node, _T("xmlns"))) != NULL && !mir_tstrcmp(type, _T("error")))
+ if ((type = XmlGetAttrValue(node, _T("xmlns"))) != NULL && !mir_tstrcmp(type, _T("error")))
return;
if (!mir_tstrcmp(type, _T("urn:ietf:params:xml:ns:xmpp-tls"))) {
@@ -919,7 +919,7 @@ void CJabberProto::OnProcessCompressed(HXML node, ThreadData *info)
{
debugLogA("Compression confirmed");
- const TCHAR *type = xmlGetAttrValue(node, _T("xmlns"));
+ const TCHAR *type = XmlGetAttrValue(node, _T("xmlns"));
if (type != NULL && !mir_tstrcmp(type, _T("error")))
return;
if (mir_tstrcmp(type, _T("http://jabber.org/protocol/compress")))
@@ -935,11 +935,11 @@ void CJabberProto::OnProcessCompressed(HXML node, ThreadData *info)
void CJabberProto::OnProcessPubsubEvent(HXML node)
{
- const TCHAR *from = xmlGetAttrValue(node, _T("from"));
+ const TCHAR *from = XmlGetAttrValue(node, _T("from"));
if (!from)
return;
- HXML eventNode = xmlGetChildByTag(node, "event", "xmlns", JABBER_FEAT_PUBSUB_EVENT);
+ HXML eventNode = XmlGetChildByTag(node, "event", "xmlns", JABBER_FEAT_PUBSUB_EVENT);
if (!eventNode)
return;
@@ -950,9 +950,9 @@ void CJabberProto::OnProcessPubsubEvent(HXML node)
return;
HXML itemsNode;
- if (m_options.EnableUserTune && (itemsNode = xmlGetChildByTag(eventNode, "items", "node", JABBER_FEAT_USER_TUNE))) {
+ if (m_options.EnableUserTune && (itemsNode = XmlGetChildByTag(eventNode, "items", "node", JABBER_FEAT_USER_TUNE))) {
// node retract?
- if (xmlGetChild(itemsNode, "retract")) {
+ if (XmlGetChild(itemsNode, "retract")) {
SetContactTune(hContact, NULL, NULL, NULL, NULL, NULL);
return;
}
@@ -1024,18 +1024,18 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
{
HXML xNode, n;
- if (!xmlGetName(node) || mir_tstrcmp(xmlGetName(node), _T("message")))
+ if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("message")))
return;
- LPCTSTR from, type = xmlGetAttrValue(node, _T("type"));
- if ((from = xmlGetAttrValue(node, _T("from"))) == NULL)
+ LPCTSTR from, type = XmlGetAttrValue(node, _T("type"));
+ if ((from = XmlGetAttrValue(node, _T("from"))) == NULL)
return;
- LPCTSTR idStr = xmlGetAttrValue(node, _T("id"));
+ LPCTSTR idStr = XmlGetAttrValue(node, _T("id"));
pResourceStatus pFromResource(ResourceInfoFromJID(from));
// Message receipts delivery request. Reply here, before a call to HandleMessagePermanent() to make sure message receipts are handled for external plugins too.
- if ((!type || mir_tstrcmpi(type, _T("error"))) && xmlGetChildByTag(node, "request", "xmlns", JABBER_FEAT_MESSAGE_RECEIPTS)) {
+ if ((!type || mir_tstrcmpi(type, _T("error"))) && XmlGetChildByTag(node, "request", "xmlns", JABBER_FEAT_MESSAGE_RECEIPTS)) {
info->send(
XmlNode(_T("message")) << XATTR(_T("to"), from) << XATTR(_T("id"), idStr)
<< XCHILDNS(_T("received"), JABBER_FEAT_MESSAGE_RECEIPTS) << XATTR(_T("id"), idStr));
@@ -1050,20 +1050,20 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
MCONTACT hContact = HContactFromJID(from);
JABBER_LIST_ITEM *chatItem = ListGetItemPtr(LIST_CHATROOM, from);
if (chatItem) {
- HXML xCaptcha = xmlGetChild(node, "captcha");
+ HXML xCaptcha = XmlGetChild(node, "captcha");
if (xCaptcha)
if (ProcessCaptcha(xCaptcha, node, info))
return;
}
const TCHAR *szMessage = NULL;
- HXML bodyNode = xmlGetChildByTag(node, "body", "xml:lang", m_tszSelectedLang);
+ HXML bodyNode = XmlGetChildByTag(node, "body", "xml:lang", m_tszSelectedLang);
if (bodyNode == NULL)
- bodyNode = xmlGetChild(node, "body");
+ bodyNode = XmlGetChild(node, "body");
if (bodyNode != NULL)
- szMessage = xmlGetText(bodyNode);
+ szMessage = XmlGetText(bodyNode);
- LPCTSTR ptszSubject = xmlGetText(xmlGetChild(node, "subject"));
+ LPCTSTR ptszSubject = XmlGetText(XmlGetChild(node, "subject"));
if (ptszSubject && *ptszSubject) {
size_t cbLen = (szMessage ? mir_tstrlen(szMessage) : 0) + mir_tstrlen(ptszSubject) + 128;
TCHAR *szTmp = (TCHAR *)alloca(sizeof(TCHAR) * cbLen);
@@ -1078,10 +1078,10 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
szMessage = szTmp;
}
- if (szMessage && (n = xmlGetChildByTag(node, "addresses", "xmlns", JABBER_FEAT_EXT_ADDRESSING))) {
- HXML addressNode = xmlGetChildByTag(n, "address", "type", _T("ofrom"));
+ if (szMessage && (n = XmlGetChildByTag(node, "addresses", "xmlns", JABBER_FEAT_EXT_ADDRESSING))) {
+ HXML addressNode = XmlGetChildByTag(n, "address", "type", _T("ofrom"));
if (addressNode) {
- const TCHAR *szJid = xmlGetAttrValue(addressNode, _T("jid"));
+ const TCHAR *szJid = XmlGetAttrValue(addressNode, _T("jid"));
if (szJid) {
size_t cbLen = mir_tstrlen(szMessage) + 1000;
TCHAR *p = (TCHAR*)alloca(sizeof(TCHAR) * cbLen);
@@ -1108,26 +1108,26 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
bool isDelivered = false;
// check chatstates availability
- if (pFromResource && xmlGetChildByTag(node, "active", "xmlns", JABBER_FEAT_CHATSTATES))
+ if (pFromResource && XmlGetChildByTag(node, "active", "xmlns", JABBER_FEAT_CHATSTATES))
pFromResource->m_jcbManualDiscoveredCaps |= JABBER_CAPS_CHATSTATES;
// chatstates composing event
- if (hContact && xmlGetChildByTag(node, "composing", "xmlns", JABBER_FEAT_CHATSTATES))
+ if (hContact && XmlGetChildByTag(node, "composing", "xmlns", JABBER_FEAT_CHATSTATES))
CallService(MS_PROTO_CONTACTISTYPING, hContact, 60);
// chatstates paused event
- if (hContact && xmlGetChildByTag(node, "paused", "xmlns", JABBER_FEAT_CHATSTATES))
+ if (hContact && XmlGetChildByTag(node, "paused", "xmlns", JABBER_FEAT_CHATSTATES))
CallService(MS_PROTO_CONTACTISTYPING, hContact, PROTOTYPE_CONTACTTYPING_OFF);
// chatstates inactive event
- if (hContact && xmlGetChildByTag(node, "inactive", "xmlns", JABBER_FEAT_CHATSTATES)) {
+ if (hContact && XmlGetChildByTag(node, "inactive", "xmlns", JABBER_FEAT_CHATSTATES)) {
CallService(MS_PROTO_CONTACTISTYPING, hContact, PROTOTYPE_CONTACTTYPING_OFF);
if (pFromResource)
pFromResource->m_bMessageSessionActive = false;
}
// message receipts delivery notification
- if (n = xmlGetChildByTag(node, "received", "xmlns", JABBER_FEAT_MESSAGE_RECEIPTS)) {
+ if (n = XmlGetChildByTag(node, "received", "xmlns", JABBER_FEAT_MESSAGE_RECEIPTS)) {
int nPacketId = JabberGetPacketID(n);
if (nPacketId == -1)
nPacketId = JabberGetPacketID(node);
@@ -1138,7 +1138,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
JabberReadXep203delay(node, msgTime);
// XEP-0224 support (Attention/Nudge)
- if (xmlGetChildByTag(node, "attention", "xmlns", JABBER_FEAT_ATTENTION)) {
+ if (XmlGetChildByTag(node, "attention", "xmlns", JABBER_FEAT_ATTENTION)) {
if (!hContact)
hContact = CreateTemporaryContact(from, chatItem);
if (hContact)
@@ -1146,7 +1146,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
}
// chatstates gone event
- if (hContact && xmlGetChildByTag(node, "gone", "xmlns", JABBER_FEAT_CHATSTATES) && m_options.LogChatstates) {
+ if (hContact && XmlGetChildByTag(node, "gone", "xmlns", JABBER_FEAT_CHATSTATES) && m_options.LogChatstates) {
BYTE bEventType = JABBER_DB_EVENT_CHATSTATES_GONE; // gone event
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.pBlob = &bEventType;
@@ -1158,10 +1158,10 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
db_event_add(hContact, &dbei);
}
- if ((n = xmlGetChildByTag(node, "confirm", "xmlns", JABBER_FEAT_HTTP_AUTH)) && m_options.AcceptHttpAuth) {
- const TCHAR *szId = xmlGetAttrValue(n, _T("id"));
- const TCHAR *szMethod = xmlGetAttrValue(n, _T("method"));
- const TCHAR *szUrl = xmlGetAttrValue(n, _T("url"));
+ if ((n = XmlGetChildByTag(node, "confirm", "xmlns", JABBER_FEAT_HTTP_AUTH)) && m_options.AcceptHttpAuth) {
+ const TCHAR *szId = XmlGetAttrValue(n, _T("id"));
+ const TCHAR *szMethod = XmlGetAttrValue(n, _T("method"));
+ const TCHAR *szUrl = XmlGetAttrValue(n, _T("url"));
if (!szId || !szMethod || !szUrl)
return;
@@ -1172,7 +1172,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
memset(pParams, 0, sizeof(CJabberHttpAuthParams));
pParams->m_nType = CJabberHttpAuthParams::MSG;
pParams->m_szFrom = mir_tstrdup(from);
- LPCTSTR ptszThread = xmlGetText(xmlGetChild(node, "thread"));
+ LPCTSTR ptszThread = XmlGetText(XmlGetChild(node, "thread"));
if (ptszThread && *ptszThread)
pParams->m_szThreadId = mir_tstrdup(ptszThread);
pParams->m_szId = mir_tstrdup(szId);
@@ -1184,20 +1184,20 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
}
// parsing extensions
- for (int i = 0; (xNode = xmlGetChild(node, i)) != NULL; i++) {
- if ((xNode = xmlGetNthChild(node, _T("x"), i + 1)) == NULL)
+ for (int i = 0; (xNode = XmlGetChild(node, i)) != NULL; i++) {
+ if ((xNode = XmlGetNthChild(node, _T("x"), i + 1)) == NULL)
continue;
- const TCHAR *ptszXmlns = xmlGetAttrValue(xNode, _T("xmlns"));
+ const TCHAR *ptszXmlns = XmlGetAttrValue(xNode, _T("xmlns"));
if (ptszXmlns == NULL)
continue;
if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_MIRANDA_NOTES)) {
- if (OnIncomingNote(from, xmlGetChild(xNode, "note")))
+ if (OnIncomingNote(from, XmlGetChild(xNode, "note")))
return;
}
else if (!mir_tstrcmp(ptszXmlns, _T("jabber:x:encrypted"))) {
- LPCTSTR ptszText = xmlGetText(xNode);
+ LPCTSTR ptszText = XmlGetText(xNode);
if (ptszText == NULL)
return;
@@ -1209,7 +1209,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
szMessage = tempstring;
}
else if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_DELAY) && msgTime == 0) {
- const TCHAR *ptszTimeStamp = xmlGetAttrValue(xNode, _T("stamp"));
+ const TCHAR *ptszTimeStamp = XmlGetAttrValue(xNode, _T("stamp"));
if (ptszTimeStamp != NULL)
msgTime = JabberIsoToUnixTime(ptszTimeStamp);
}
@@ -1224,28 +1224,28 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
// pFromResource->m_jcbManualDiscoveredCaps |= (JABBER_CAPS_MESSAGE_EVENTS | JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY);
if (bodyNode == NULL) {
- HXML idNode = xmlGetChild(xNode, "id");
- if (xmlGetChild(xNode, "delivered") != NULL || xmlGetChild(xNode, "offline") != NULL) {
+ HXML idNode = XmlGetChild(xNode, "id");
+ if (XmlGetChild(xNode, "delivered") != NULL || XmlGetChild(xNode, "offline") != NULL) {
int id = -1;
- if (idNode != NULL && xmlGetText(idNode) != NULL)
- if (!_tcsncmp(xmlGetText(idNode), _T(JABBER_IQID), mir_strlen(JABBER_IQID)))
- id = _ttoi((xmlGetText(idNode)) + mir_strlen(JABBER_IQID));
+ if (idNode != NULL && XmlGetText(idNode) != NULL)
+ if (!_tcsncmp(XmlGetText(idNode), _T(JABBER_IQID), mir_strlen(JABBER_IQID)))
+ id = _ttoi((XmlGetText(idNode)) + mir_strlen(JABBER_IQID));
if (id != -1)
ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
- if (hContact && xmlGetChild(xNode, "composing") != NULL)
+ if (hContact && XmlGetChild(xNode, "composing") != NULL)
CallService(MS_PROTO_CONTACTISTYPING, hContact, 60);
// Maybe a cancel to the previous composing
- HXML child = xmlGetChild(xNode, 0);
+ HXML child = XmlGetChild(xNode, 0);
if (hContact && (!child || (child && idNode != NULL)))
CallService(MS_PROTO_CONTACTISTYPING, hContact, PROTOTYPE_CONTACTTYPING_OFF);
}
else {
// Check whether any event is requested
- if (!isDelivered && (n = xmlGetChild(xNode, "delivered")) != NULL) {
+ if (!isDelivered && (n = XmlGetChild(xNode, "delivered")) != NULL) {
isDelivered = true;
XmlNode m(_T("message")); m << XATTR(_T("to"), from);
@@ -1254,7 +1254,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
x << XCHILD(_T("id"), idStr);
info->send(m);
}
- if (item != NULL && xmlGetChild(xNode, "composing") != NULL) {
+ if (item != NULL && XmlGetChild(xNode, "composing") != NULL) {
if (item->messageEventIdStr)
mir_free(item->messageEventIdStr);
item->messageEventIdStr = (idStr == NULL) ? NULL : mir_tstrdup(idStr);
@@ -1262,7 +1262,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
}
}
else if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_OOB2)) {
- LPCTSTR ptszUrl = xmlGetText(xmlGetChild(xNode, "url"));
+ LPCTSTR ptszUrl = XmlGetText(XmlGetChild(xNode, "url"));
if (ptszUrl != NULL && *ptszUrl) {
size_t cbLen = (szMessage ? mir_tstrlen(szMessage) : 0) + mir_tstrlen(ptszUrl) + 32;
TCHAR *szTmp = (TCHAR *)alloca(sizeof(TCHAR)* cbLen);
@@ -1275,30 +1275,30 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
}
}
else if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_MUC_USER)) {
- HXML inviteNode = xmlGetChild(xNode, _T("invite"));
+ HXML inviteNode = XmlGetChild(xNode, _T("invite"));
if (inviteNode != NULL) {
- inviteFromJid = xmlGetAttrValue(inviteNode, _T("from"));
- inviteReason = xmlGetText(xmlGetChild(inviteNode, _T("reason")));
+ inviteFromJid = XmlGetAttrValue(inviteNode, _T("from"));
+ inviteReason = XmlGetText(XmlGetChild(inviteNode, _T("reason")));
}
inviteRoomJid = from;
if (inviteReason == NULL)
inviteReason = szMessage;
isChatRoomInvitation = true;
- invitePassword = xmlGetText(xmlGetChild(xNode, "password"));
+ invitePassword = XmlGetText(XmlGetChild(xNode, "password"));
}
else if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_ROSTER_EXCHANGE) &&
item != NULL && (item->subscription == SUB_BOTH || item->subscription == SUB_TO)) {
TCHAR chkJID[JABBER_MAX_JID_LEN] = _T("@");
JabberStripJid(from, chkJID + 1, _countof(chkJID) - 1);
for (int i = 1;; i++) {
- HXML iNode = xmlGetNthChild(xNode, _T("item"), i);
+ HXML iNode = XmlGetNthChild(xNode, _T("item"), i);
if (iNode == NULL)
break;
- const TCHAR *action = xmlGetAttrValue(iNode, _T("action"));
- const TCHAR *jid = xmlGetAttrValue(iNode, _T("jid"));
- const TCHAR *nick = xmlGetAttrValue(iNode, _T("name"));
- const TCHAR *group = xmlGetText(xmlGetChild(iNode, _T("group")));
+ const TCHAR *action = XmlGetAttrValue(iNode, _T("action"));
+ const TCHAR *jid = XmlGetAttrValue(iNode, _T("jid"));
+ const TCHAR *nick = XmlGetAttrValue(iNode, _T("name"));
+ const TCHAR *group = XmlGetText(XmlGetChild(iNode, _T("group")));
if (action && jid && _tcsstr(jid, chkJID)) {
if (!mir_tstrcmp(action, _T("add"))) {
MCONTACT hContact = DBCreateContact(jid, nick, FALSE, FALSE);
@@ -1314,10 +1314,10 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
}
}
else if (!isChatRoomInvitation && !mir_tstrcmp(ptszXmlns, JABBER_FEAT_DIRECT_MUC_INVITE)) {
- inviteRoomJid = xmlGetAttrValue(xNode, _T("jid"));
+ inviteRoomJid = XmlGetAttrValue(xNode, _T("jid"));
inviteFromJid = from;
if (inviteReason == NULL)
- inviteReason = xmlGetText(xNode);
+ inviteReason = XmlGetText(xNode);
if (!inviteReason)
inviteReason = szMessage;
isChatRoomInvitation = true;
@@ -1329,12 +1329,12 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
if (m_options.IgnoreMUCInvites) {
// FIXME: temporary disabled due to MUC inconsistence on server side
/*
- XmlNode m("message"); xmlAddAttr(m, "to", from);
- XmlNode xNode = xmlAddChild(m, "x");
- xmlAddAttr(xNode, "xmlns", JABBER_FEAT_MUC_USER);
- XmlNode declineNode = xmlAddChild(xNode, "decline");
- xmlAddAttr(declineNode, "from", inviteRoomJid);
- XmlNode reasonNode = xmlAddChild(declineNode, "reason", "The user has chosen to not accept chat invites");
+ XmlNode m("message"); XmlAddAttr(m, "to", from);
+ XmlNode xNode = XmlAddChild(m, "x");
+ XmlAddAttr(xNode, "xmlns", JABBER_FEAT_MUC_USER);
+ XmlNode declineNode = XmlAddChild(xNode, "decline");
+ XmlAddAttr(declineNode, "from", inviteRoomJid);
+ XmlNode reasonNode = XmlAddChild(declineNode, "reason", "The user has chosen to not accept chat invites");
info->send(m);
*/
}
@@ -1385,7 +1385,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
// XEP-0115: Entity Capabilities
void CJabberProto::OnProcessPresenceCapabilites(HXML node)
{
- const TCHAR *from = xmlGetAttrValue(node, _T("from"));
+ const TCHAR *from = XmlGetAttrValue(node, _T("from"));
if (from == NULL)
return;
@@ -1397,12 +1397,12 @@ void CJabberProto::OnProcessPresenceCapabilites(HXML node)
// check XEP-0115 support, and old style:
HXML n;
- if ((n = xmlGetChildByTag(node, "c", "xmlns", JABBER_FEAT_ENTITY_CAPS)) != NULL ||
- (n = xmlGetChild(node, "c")) != NULL)
+ if ((n = XmlGetChildByTag(node, "c", "xmlns", JABBER_FEAT_ENTITY_CAPS)) != NULL ||
+ (n = XmlGetChild(node, "c")) != NULL)
{
- const TCHAR *szNode = xmlGetAttrValue(n, _T("node"));
- const TCHAR *szVer = xmlGetAttrValue(n, _T("ver"));
- const TCHAR *szExt = xmlGetAttrValue(n, _T("ext"));
+ const TCHAR *szNode = XmlGetAttrValue(n, _T("node"));
+ const TCHAR *szVer = XmlGetAttrValue(n, _T("ver"));
+ const TCHAR *szExt = XmlGetAttrValue(n, _T("ext"));
if (szNode && szVer) {
r->m_tszCapsNode = mir_tstrdup(szNode);
r->m_tszCapsVer = mir_tstrdup(szVer);
@@ -1479,10 +1479,10 @@ void CJabberProto::UpdateJidDbSettings(const TCHAR *jid)
void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
{
- if (!node || !xmlGetName(node) || mir_tstrcmp(xmlGetName(node), _T("presence")))
+ if (!node || !XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("presence")))
return;
- LPCTSTR from = xmlGetAttrValue(node, _T("from"));
+ LPCTSTR from = XmlGetAttrValue(node, _T("from"));
if (from == NULL) return;
if (m_presenceManager.HandlePresencePermanent(node, info))
@@ -1503,7 +1503,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
if (!mir_tstrcmpi(szBareFrom, szBareOurJid))
bSelfPresence = TRUE;
- LPCTSTR type = xmlGetAttrValue(node, _T("type"));
+ LPCTSTR type = XmlGetAttrValue(node, _T("type"));
if (type == NULL || !mir_tstrcmp(type, _T("available"))) {
ptrT nick(JabberNickFromJID(from));
if (nick == NULL)
@@ -1522,8 +1522,8 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
}
DBCheckIsTransportedContact(from, hContact);
int status = ID_STATUS_ONLINE;
- if (HXML showNode = xmlGetChild(node, "show")) {
- if (LPCTSTR show = xmlGetText(showNode)) {
+ if (HXML showNode = XmlGetChild(node, "show")) {
+ if (LPCTSTR show = XmlGetText(showNode)) {
if (!mir_tstrcmp(show, _T("away"))) status = ID_STATUS_AWAY;
else if (!mir_tstrcmp(show, _T("xa"))) status = ID_STATUS_NA;
else if (!mir_tstrcmp(show, _T("dnd"))) status = ID_STATUS_DND;
@@ -1532,10 +1532,10 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
}
char priority = 0;
- if (LPCTSTR ptszPriority = xmlGetText(xmlGetChild(node, "priority")))
+ if (LPCTSTR ptszPriority = XmlGetText(XmlGetChild(node, "priority")))
priority = (char)_ttoi(ptszPriority);
- ListAddResource(LIST_ROSTER, from, status, xmlGetText(xmlGetChild(node, "status")), priority);
+ ListAddResource(LIST_ROSTER, from, status, XmlGetText(XmlGetChild(node, "status")), priority);
// XEP-0115: Entity Capabilities
OnProcessPresenceCapabilites(node);
@@ -1552,9 +1552,9 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
bool bHasAvatar = false, bRemovedAvatar = false;
debugLogA("Avatar enabled");
- for (int i = 1; (xNode = xmlGetNthChild(node, _T("x"), i)) != NULL; i++) {
- if (!mir_tstrcmp(xmlGetAttrValue(xNode, _T("xmlns")), _T("jabber:x:avatar"))) {
- LPCTSTR ptszHash = xmlGetText(xmlGetChild(xNode, "hash"));
+ for (int i = 1; (xNode = XmlGetNthChild(node, _T("x"), i)) != NULL; i++) {
+ if (!mir_tstrcmp(XmlGetAttrValue(xNode, _T("xmlns")), _T("jabber:x:avatar"))) {
+ LPCTSTR ptszHash = XmlGetText(XmlGetChild(xNode, "hash"));
if (ptszHash != NULL) {
delSetting(hContact, "AvatarXVcard");
debugLogA("AvatarXVcard deleted");
@@ -1571,10 +1571,10 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
}
if (!bHasAvatar) { //no jabber:x:avatar. try vcard-temp:x:update
debugLogA("Not hasXAvatar");
- for (int i = 1; (xNode = xmlGetNthChild(node, _T("x"), i)) != NULL; i++) {
- if (!mir_tstrcmp(xmlGetAttrValue(xNode, _T("xmlns")), _T("vcard-temp:x:update"))) {
- if ((xNode = xmlGetChild(xNode, "photo")) != NULL) {
- LPCTSTR txt = xmlGetText(xNode);
+ for (int i = 1; (xNode = XmlGetNthChild(node, _T("x"), i)) != NULL; i++) {
+ if (!mir_tstrcmp(XmlGetAttrValue(xNode, _T("xmlns")), _T("vcard-temp:x:update"))) {
+ if ((xNode = XmlGetChild(xNode, "photo")) != NULL) {
+ LPCTSTR txt = XmlGetText(xNode);
if (txt != NULL && txt[0] != 0) {
setByte(hContact, "AvatarXVcard", 1);
debugLogA("AvatarXVcard set");
@@ -1617,7 +1617,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
// set status only if no more available resources
if (!item->arResources.getCount()) {
item->getTemp()->m_iStatus = ID_STATUS_OFFLINE;
- item->getTemp()->m_tszStatusMessage = mir_tstrdup(xmlGetText(xmlGetChild(node, "status")));
+ item->getTemp()->m_tszStatusMessage = mir_tstrdup(XmlGetText(XmlGetChild(node, "status")));
}
}
else debugLog(_T("SKIP Receive presence offline from %s (who is not in my roster)"), from);
@@ -1636,9 +1636,9 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
AddDbPresenceEvent(hContact, JABBER_DB_EVENT_PRESENCE_SUBSCRIBE);
ptrT tszNick(JabberNickFromJID(from));
- HXML xNick = xmlGetChildByTag(node, "nick", "xmlns", JABBER_FEAT_NICK);
+ HXML xNick = XmlGetChildByTag(node, "nick", "xmlns", JABBER_FEAT_NICK);
if (xNick != NULL) {
- LPCTSTR xszNick = xmlGetText(xNick);
+ LPCTSTR xszNick = XmlGetText(xNick);
if (xszNick != NULL && *xszNick) {
debugLog(_T("Grabbed nick from presence: %s"), xszNick);
tszNick = mir_tstrdup(xszNick);
@@ -1714,12 +1714,12 @@ void CJabberProto::OnIqResultVersion(HXML /*node*/, CJabberIqInfo *pInfo)
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT && queryNode) {
HXML n;
- if ((n = xmlGetChild(queryNode, "name")) != NULL && xmlGetText(n))
- r->m_tszSoftware = mir_tstrdup(xmlGetText(n));
- if ((n = xmlGetChild(queryNode, "version")) != NULL && xmlGetText(n))
- r->m_tszSoftwareVersion = mir_tstrdup(xmlGetText(n));
- if ((n = xmlGetChild(queryNode, "os")) != NULL && xmlGetText(n))
- r->m_tszOs = mir_tstrdup(xmlGetText(n));
+ if ((n = XmlGetChild(queryNode, "name")) != NULL && XmlGetText(n))
+ r->m_tszSoftware = mir_tstrdup(XmlGetText(n));
+ if ((n = XmlGetChild(queryNode, "version")) != NULL && XmlGetText(n))
+ r->m_tszSoftwareVersion = mir_tstrdup(XmlGetText(n));
+ if ((n = XmlGetChild(queryNode, "os")) != NULL && XmlGetText(n))
+ r->m_tszOs = mir_tstrdup(XmlGetText(n));
}
GetResourceCapabilites(pInfo->GetFrom(), TRUE);
@@ -1732,14 +1732,14 @@ void CJabberProto::OnIqResultVersion(HXML /*node*/, CJabberIqInfo *pInfo)
BOOL CJabberProto::OnProcessJingle(HXML node)
{
LPCTSTR type;
- HXML child = xmlGetChildByTag(node, _T("jingle"), _T("xmlns"), JABBER_FEAT_JINGLE);
+ HXML child = XmlGetChildByTag(node, _T("jingle"), _T("xmlns"), JABBER_FEAT_JINGLE);
if (child) {
- if ((type = xmlGetAttrValue(node, _T("type"))) == NULL) return FALSE;
+ if ((type = XmlGetAttrValue(node, _T("type"))) == NULL) return FALSE;
if ((!mir_tstrcmp(type, _T("get")) || !mir_tstrcmp(type, _T("set")))) {
- LPCTSTR szAction = xmlGetAttrValue(child, _T("action"));
- LPCTSTR idStr = xmlGetAttrValue(node, _T("id"));
- LPCTSTR from = xmlGetAttrValue(node, _T("from"));
+ LPCTSTR szAction = XmlGetAttrValue(child, _T("action"));
+ LPCTSTR idStr = XmlGetAttrValue(node, _T("id"));
+ LPCTSTR from = XmlGetAttrValue(node, _T("from"));
if (szAction && !mir_tstrcmp(szAction, _T("session-initiate"))) {
// if this is a Jingle 'session-initiate' and noone processed it yet, reply with "unsupported-applications"
m_ThreadInfo->send(XmlNodeIq(_T("result"), idStr, from));
@@ -1748,10 +1748,10 @@ BOOL CJabberProto::OnProcessJingle(HXML node)
HXML jingleNode = iq << XCHILDNS(_T("jingle"), JABBER_FEAT_JINGLE);
jingleNode << XATTR(_T("action"), _T("session-terminate"));
- LPCTSTR szInitiator = xmlGetAttrValue(child, _T("initiator"));
+ LPCTSTR szInitiator = XmlGetAttrValue(child, _T("initiator"));
if (szInitiator)
jingleNode << XATTR(_T("initiator"), szInitiator);
- LPCTSTR szSid = xmlGetAttrValue(child, _T("sid"));
+ LPCTSTR szSid = XmlGetAttrValue(child, _T("sid"));
if (szSid)
jingleNode << XATTR(_T("sid"), szSid);
@@ -1780,13 +1780,13 @@ void CJabberProto::OnProcessIq(HXML node)
HXML queryNode;
const TCHAR *type, *xmlns;
- if (!xmlGetName(node) || mir_tstrcmp(xmlGetName(node), _T("iq"))) return;
- if ((type = xmlGetAttrValue(node, _T("type"))) == NULL) return;
+ if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("iq"))) return;
+ if ((type = XmlGetAttrValue(node, _T("type"))) == NULL) return;
int id = JabberGetPacketID(node);
- queryNode = xmlGetChild(node, "query");
- xmlns = xmlGetAttrValue(queryNode, _T("xmlns"));
+ queryNode = XmlGetChild(node, "query");
+ xmlns = XmlGetAttrValue(queryNode, _T("xmlns"));
// new match by id
if (m_iqManager.HandleIq(id, node))
@@ -1819,11 +1819,11 @@ void CJabberProto::OnProcessIq(HXML node)
}
}
else if ((!mir_tstrcmp(type, _T("get")) || !mir_tstrcmp(type, _T("set")))) {
- XmlNodeIq iq(_T("error"), id, xmlGetAttrValue(node, _T("from")));
+ XmlNodeIq iq(_T("error"), id, XmlGetAttrValue(node, _T("from")));
- HXML pFirstChild = xmlGetChild(node, 0);
+ HXML pFirstChild = XmlGetChild(node, 0);
if (pFirstChild)
- xmlAddChild(iq, pFirstChild);
+ XmlAddChild(iq, pFirstChild);
iq << XCHILD(_T("error")) << XATTR(_T("type"), _T("cancel"))
<< XCHILDNS(_T("service-unavailable"), _T("urn:ietf:params:xml:ns:xmpp-stanzas"));
@@ -1835,8 +1835,8 @@ void CJabberProto::OnProcessRegIq(HXML node, ThreadData *info)
{
const TCHAR *type;
- if (!xmlGetName(node) || mir_tstrcmp(xmlGetName(node), _T("iq"))) return;
- if ((type = xmlGetAttrValue(node, _T("type"))) == NULL) return;
+ if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("iq"))) return;
+ if ((type = XmlGetAttrValue(node, _T("type"))) == NULL) return;
int id = JabberGetPacketID(node);
@@ -1864,7 +1864,7 @@ void CJabberProto::OnProcessRegIq(HXML node, ThreadData *info)
}
else if (!mir_tstrcmp(type, _T("error"))) {
- TCHAR *str = JabberErrorMsg(xmlGetChild(node, "error"));
+ TCHAR *str = JabberErrorMsg(XmlGetChild(node, "error"));
SendMessage(info->conn.reg_hwndDlg, WM_JABBER_REGDLG_UPDATE, 100, (LPARAM)str);
mir_free(str);
info->reg_done = TRUE;
@@ -1963,7 +1963,7 @@ int ThreadData::send(HXML node)
if (this == NULL)
return 0;
- while (HXML parent = xi.getParent(node))
+ while (HXML parent = xmlGetParent(node))
node = parent;
if (proto->m_sendManager.HandleSendPermanent(node, this))
@@ -1971,7 +1971,7 @@ int ThreadData::send(HXML node)
proto->OnConsoleProcessXml(node, JCPF_OUT);
- TCHAR *str = xi.toString(node, NULL);
+ TCHAR *str = xmlToString(node, NULL);
// strip forbidden control characters from outgoing XML stream
TCHAR *q = str;
@@ -1990,6 +1990,6 @@ int ThreadData::send(HXML node)
T2Utf utfStr(str);
int result = send(utfStr, (int)mir_strlen(utfStr));
- xi.freeMem(str);
+ xmlFree(str);
return result;
}
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index a709bc492c..77534292f5 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -298,20 +298,20 @@ TCHAR* __stdcall JabberErrorMsg(HXML errorNode, int* pErrorCode)
}
int errorCode = -1;
- const TCHAR *str = xmlGetAttrValue(errorNode, _T("code"));
+ const TCHAR *str = XmlGetAttrValue(errorNode, _T("code"));
if (str != NULL)
errorCode = _ttoi(str);
- str = xmlGetText(errorNode);
+ str = XmlGetText(errorNode);
if (str == NULL)
- str = xmlGetText(xmlGetChild(errorNode, _T("text")));
+ str = XmlGetText(XmlGetChild(errorNode, _T("text")));
if (str == NULL) {
for (int i = 0;; i++) {
- HXML c = xmlGetChild(errorNode, i);
+ HXML c = XmlGetChild(errorNode, i);
if (c == NULL) break;
- const TCHAR *attr = xmlGetAttrValue(c, _T("xmlns"));
+ const TCHAR *attr = XmlGetAttrValue(c, _T("xmlns"));
if (attr && !mir_tstrcmp(attr, _T("urn:ietf:params:xml:ns:xmpp-stanzas"))) {
- str = xmlGetName(c);
+ str = XmlGetName(c);
break;
}
}
@@ -416,7 +416,7 @@ void CJabberProto::SendPresenceTo(int status, const TCHAR* to, HXML extra, const
p << XATTR(_T("to"), to);
if (extra)
- xmlAddChild(p, extra);
+ XmlAddChild(p, extra);
// XEP-0115:Entity Capabilities
HXML c = p << XCHILDNS(_T("c"), JABBER_FEAT_ENTITY_CAPS) << XATTR(_T("node"), JABBER_CAPS_MIRANDA_NODE)
@@ -465,7 +465,7 @@ void CJabberProto::SendPresenceTo(int status, const TCHAR* to, HXML extra, const
szExtCaps.AppendChar(' ');
szExtCaps += arrExtCaps[i];
}
- xmlAddAttr(c, _T("ext"), szExtCaps);
+ XmlAddAttr(c, _T("ext"), szExtCaps);
}
if (m_options.EnableAvatars) {
@@ -540,7 +540,7 @@ void CJabberProto::SendPresence(int status, bool bSendToAll)
int __stdcall JabberGetPacketID(HXML n)
{
- const TCHAR *str = xmlGetAttrValue(n, _T("id"));
+ const TCHAR *str = XmlGetAttrValue(n, _T("id"));
if (str)
if (!_tcsncmp(str, _T(JABBER_IQID), _countof(JABBER_IQID) - 1))
return _ttoi(str + _countof(JABBER_IQID) - 1);
@@ -616,7 +616,7 @@ TCHAR* __stdcall JabberStripJid(const TCHAR *jid, TCHAR *dest, size_t destLen)
LPCTSTR __stdcall JabberGetPictureType(HXML node, const char *picBuf)
{
- if (LPCTSTR ptszType = xmlGetText(xmlGetChild(node, "TYPE")))
+ if (LPCTSTR ptszType = XmlGetText(XmlGetChild(node, "TYPE")))
if (!mir_tstrcmp(ptszType, _T("image/jpeg")) ||
!mir_tstrcmp(ptszType, _T("image/png")) ||
!mir_tstrcmp(ptszType, _T("image/gif")) ||
@@ -872,11 +872,11 @@ BOOL CJabberProto::EnterString(CMString &result, LPCTSTR caption, int type, char
bool JabberReadXep203delay(HXML node, time_t &msgTime)
{
- HXML n = xmlGetChildByTag(node, "delay", "xmlns", _T("urn:xmpp:delay"));
+ HXML n = XmlGetChildByTag(node, "delay", "xmlns", _T("urn:xmpp:delay"));
if (n == NULL)
return false;
- const TCHAR *ptszTimeStamp = xmlGetAttrValue(n, _T("stamp"));
+ const TCHAR *ptszTimeStamp = XmlGetAttrValue(n, _T("stamp"));
if (ptszTimeStamp == NULL)
return false;
diff --git a/protocols/JabberG/src/jabber_xml.cpp b/protocols/JabberG/src/jabber_xml.cpp
index 0d75e02496..dc528dadfd 100644
--- a/protocols/JabberG/src/jabber_xml.cpp
+++ b/protocols/JabberG/src/jabber_xml.cpp
@@ -55,7 +55,7 @@ XmlNodeIq::XmlNodeIq(const TCHAR *type, HXML node, LPCTSTR to) :
if (type != NULL) *this << XATTR(_T("type"), type );
if (to != NULL) *this << XATTR(_T("to"), to );
if (node != NULL) {
- const TCHAR *iqId = xmlGetAttrValue(*this, _T("id"));
+ const TCHAR *iqId = XmlGetAttrValue(*this, _T("id"));
if (iqId != NULL) *this << XATTR(_T("id"), iqId);
}
}
@@ -85,31 +85,31 @@ XmlNodeIq::XmlNodeIq(const TCHAR *type, CJabberIqInfo *pInfo) :
XmlNode::XmlNode(LPCTSTR pszName)
{
- m_hXml = xi.createNode(T2UTF(pszName), NULL, 0);
+ m_hXml = xmlCreateNode(T2UTF(pszName), NULL, 0);
}
XmlNode::XmlNode(LPCTSTR pszName, LPCTSTR ptszText)
{
- m_hXml = xi.createNode(T2UTF(pszName), ptszText, 0);
+ m_hXml = xmlCreateNode(T2UTF(pszName), ptszText, 0);
}
XmlNode::XmlNode(const XmlNode& n)
{
- m_hXml = xi.copyNode(n);
+ m_hXml = xmlCopyNode(n);
}
XmlNode& XmlNode::operator =(const XmlNode& n)
{
if (m_hXml)
- xi.destroyNode(m_hXml);
- m_hXml = xi.copyNode(n);
+ xmlDestroyNode(m_hXml);
+ m_hXml = xmlCopyNode(n);
return *this;
}
XmlNode::~XmlNode()
{
if (m_hXml) {
- xi.destroyNode(m_hXml);
+ xmlDestroyNode(m_hXml);
m_hXml = NULL;
} }
@@ -117,132 +117,132 @@ XmlNode::~XmlNode()
HXML __fastcall operator<<(HXML node, const XCHILDNS& child)
{
- HXML res = xmlAddChild(node, child.name);
- xmlAddAttr(res, _T("xmlns"), child.ns);
+ HXML res = XmlAddChild(node, child.name);
+ XmlAddAttr(res, _T("xmlns"), child.ns);
return res;
}
HXML __fastcall operator<<(HXML node, const XQUERY& child)
{
- HXML n = xmlAddChild(node, _T("query"));
+ HXML n = XmlAddChild(node, _T("query"));
if (n)
- xmlAddAttr(n, _T("xmlns"), child.ns);
+ XmlAddAttr(n, _T("xmlns"), child.ns);
return n;
}
/////////////////////////////////////////////////////////////////////////////////////////
-void __fastcall xmlAddAttr(HXML hXml, LPCTSTR name, LPCTSTR value)
+void __fastcall XmlAddAttr(HXML hXml, LPCTSTR name, LPCTSTR value)
{
if (value)
- xi.addAttr(hXml, name, T2UTF(value));
+ xmlAddAttr(hXml, name, T2UTF(value));
}
-void __fastcall xmlAddAttr(HXML hXml, LPCTSTR pszName, int value)
+void __fastcall XmlAddAttr(HXML hXml, LPCTSTR pszName, int value)
{
- xi.addAttrInt(hXml, T2UTF(pszName), value);
+ xmlAddAttrInt(hXml, T2UTF(pszName), value);
}
-void __fastcall xmlAddAttr(HXML hXml, LPCTSTR pszName, unsigned __int64 value)
+void __fastcall XmlAddAttr(HXML hXml, LPCTSTR pszName, unsigned __int64 value)
{
TCHAR buf[60];
_ui64tot(value, buf, 10);
- xi.addAttr(hXml, T2UTF(pszName), T2UTF(buf));
+ xmlAddAttr(hXml, T2UTF(pszName), T2UTF(buf));
}
-void __fastcall xmlAddAttrID(HXML hXml, int id)
+void __fastcall XmlAddAttrID(HXML hXml, int id)
{
TCHAR text[100];
mir_sntprintf(text, _T(JABBER_IQID) _T("%d"), id);
- xmlAddAttr(hXml, _T("id"), text);
+ XmlAddAttr(hXml, _T("id"), text);
}
/////////////////////////////////////////////////////////////////////////////////////////
-LPCTSTR __fastcall xmlGetAttr(HXML hXml, int n)
+LPCTSTR __fastcall XmlGetAttr(HXML hXml, int n)
{
- return xi.getAttr(hXml, n);
+ return xmlGetAttr(hXml, n);
}
-int __fastcall xmlGetAttrCount(HXML hXml)
+int __fastcall XmlGetAttrCount(HXML hXml)
{
- return xi.getAttrCount(hXml);
+ return xmlGetAttrCount(hXml);
}
-LPCTSTR __fastcall xmlGetAttrName(HXML hXml, int n)
+LPCTSTR __fastcall XmlGetAttrName(HXML hXml, int n)
{
- return xi.getAttrName(hXml, n);
+ return xmlGetAttrName(hXml, n);
}
/////////////////////////////////////////////////////////////////////////////////////////
-void __fastcall xmlAddChild(HXML hXml, HXML n)
+void __fastcall XmlAddChild(HXML hXml, HXML n)
{
- xi.addChild2(n, hXml);
+ xmlAddChild2(n, hXml);
}
-HXML __fastcall xmlAddChild(HXML hXml, LPCTSTR name)
+HXML __fastcall XmlAddChild(HXML hXml, LPCTSTR name)
{
- return xi.addChild(hXml, T2UTF(name), NULL);
+ return xmlAddChild(hXml, T2UTF(name), NULL);
}
-HXML __fastcall xmlAddChild(HXML hXml, LPCTSTR name, LPCTSTR value)
+HXML __fastcall XmlAddChild(HXML hXml, LPCTSTR name, LPCTSTR value)
{
- return xi.addChild(hXml, T2UTF(name), T2UTF(value));
+ return xmlAddChild(hXml, T2UTF(name), T2UTF(value));
}
-HXML __fastcall xmlAddChild(HXML hXml, LPCTSTR name, int value)
+HXML __fastcall XmlAddChild(HXML hXml, LPCTSTR name, int value)
{
TCHAR buf[40];
_itot(value, buf, 10);
- return xi.addChild(hXml, T2UTF(name), buf);
+ return xmlAddChild(hXml, T2UTF(name), buf);
}
/////////////////////////////////////////////////////////////////////////////////////////
-LPCTSTR __fastcall xmlGetAttrValue(HXML hXml, LPCTSTR key)
+LPCTSTR __fastcall XmlGetAttrValue(HXML hXml, LPCTSTR key)
{
- return xi.getAttrValue(hXml, key);
+ return xmlGetAttrValue(hXml, key);
}
-HXML __fastcall xmlGetChild(HXML hXml, int n)
+HXML __fastcall XmlGetChild(HXML hXml, int n)
{
- return xi.getChild(hXml, n);
+ return xmlGetChild(hXml, n);
}
-HXML __fastcall xmlGetChild(HXML hXml, LPCTSTR key)
+HXML __fastcall XmlGetChild(HXML hXml, LPCTSTR key)
{
- return xi.getNthChild(hXml, key, 0);
+ return xmlGetNthChild(hXml, key, 0);
}
-HXML __fastcall xmlGetChild(HXML hXml, LPCSTR key)
+HXML __fastcall XmlGetChild(HXML hXml, LPCSTR key)
{
LPTSTR wszKey = mir_a2t(key);
- HXML result = xi.getNthChild(hXml, wszKey, 0);
+ HXML result = xmlGetNthChild(hXml, wszKey, 0);
mir_free(wszKey);
return result;
}
-HXML __fastcall xmlGetChildByTag(HXML hXml, LPCTSTR key, LPCTSTR attrName, LPCTSTR attrValue)
+HXML __fastcall XmlGetChildByTag(HXML hXml, LPCTSTR key, LPCTSTR attrName, LPCTSTR attrValue)
{
- return xi.getChildByAttrValue(hXml, key, attrName, attrValue);
+ return xmlGetChildByAttrValue(hXml, key, attrName, attrValue);
}
-HXML __fastcall xmlGetChildByTag(HXML hXml, LPCSTR key, LPCSTR attrName, LPCTSTR attrValue)
+HXML __fastcall XmlGetChildByTag(HXML hXml, LPCSTR key, LPCSTR attrName, LPCTSTR attrValue)
{
LPTSTR wszKey = mir_a2t(key), wszName = mir_a2t(attrName);
- HXML result = xi.getChildByAttrValue(hXml, wszKey, wszName, attrValue);
+ HXML result = xmlGetChildByAttrValue(hXml, wszKey, wszName, attrValue);
mir_free(wszKey), mir_free(wszName);
return result;
}
-int __fastcall xmlGetChildCount(HXML hXml)
+int __fastcall XmlGetChildCount(HXML hXml)
{
- return xi.getChildCount(hXml);
+ return xmlGetChildCount(hXml);
}
-HXML __fastcall xmlGetNthChild(HXML hXml, LPCTSTR tag, int nth)
+HXML __fastcall XmlGetNthChild(HXML hXml, LPCTSTR tag, int nth)
{
int i, num;
@@ -251,10 +251,10 @@ HXML __fastcall xmlGetNthChild(HXML hXml, LPCTSTR tag, int nth)
num = 1;
for (i=0; ; i++) {
- HXML n = xi.getChild(hXml, i);
+ HXML n = xmlGetChild(hXml, i);
if (!n)
break;
- if (!mir_tstrcmp(tag, xmlGetName(n))) {
+ if (!mir_tstrcmp(tag, XmlGetName(n))) {
if (num == nth)
return n;
@@ -264,14 +264,14 @@ HXML __fastcall xmlGetNthChild(HXML hXml, LPCTSTR tag, int nth)
return NULL;
}
-LPCTSTR __fastcall xmlGetName(HXML xml)
+LPCTSTR __fastcall XmlGetName(HXML xml)
{
- return xi.getName(xml);
+ return xmlGetName(xml);
}
-LPCTSTR __fastcall xmlGetText(HXML xml)
+LPCTSTR __fastcall XmlGetText(HXML xml)
{
- return (xml) ? xi.getText(xml) : NULL;
+ return (xml) ? xmlGetText(xml) : NULL;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -288,16 +288,16 @@ void XPath::ProcessPath(LookupInfo &info, bool bCreate)
mir_tstrncpy(attrName, info.attrName.p, info.attrName.length + 1);
TCHAR *attrValue = (TCHAR *)alloca(sizeof(TCHAR)* (info.attrValue.length + 1));
mir_tstrncpy(attrValue, info.attrValue.p, info.attrValue.length + 1);
- HXML hXml = xmlGetChildByTag(m_hXml, nodeName, attrName, attrValue);
+ HXML hXml = XmlGetChildByTag(m_hXml, nodeName, attrName, attrValue);
m_hXml = (hXml || !bCreate) ? hXml : (m_hXml << XCHILD(nodeName) << XATTR(attrName, attrValue));
}
else if (info.nodeIndex) {
int idx = _ttoi(info.nodeIndex.p);
- m_hXml = mir_tstrcmp(nodeName, _T("*")) ? xmlGetNthChild(m_hXml, nodeName, idx) : xmlGetChild(m_hXml, idx - 1);
+ m_hXml = mir_tstrcmp(nodeName, _T("*")) ? XmlGetNthChild(m_hXml, nodeName, idx) : XmlGetChild(m_hXml, idx - 1);
}
else {
- HXML hXml = xmlGetChild(m_hXml, nodeName);
+ HXML hXml = XmlGetChild(m_hXml, nodeName);
m_hXml = (hXml || !bCreate) ? hXml : (m_hXml << XCHILD(nodeName));
}
diff --git a/protocols/JabberG/src/jabber_xml.h b/protocols/JabberG/src/jabber_xml.h
index 452820b99c..0a935a3b46 100644
--- a/protocols/JabberG/src/jabber_xml.h
+++ b/protocols/JabberG/src/jabber_xml.h
@@ -28,32 +28,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_xml.h>
-void __fastcall xmlAddChild(HXML, HXML);
-HXML __fastcall xmlAddChild(HXML, LPCTSTR pszName);
-HXML __fastcall xmlAddChild(HXML, LPCTSTR pszName, LPCTSTR ptszValue);
-HXML __fastcall xmlAddChild(HXML, LPCTSTR pszName, int iValue);
-
-LPCTSTR __fastcall xmlGetAttrValue(HXML, LPCTSTR key);
-HXML __fastcall xmlGetChild(HXML, int n = 0);
-HXML __fastcall xmlGetChild(HXML, LPCSTR key);
-HXML __fastcall xmlGetChild(HXML, LPCTSTR key);
-int __fastcall xmlGetChildCount(HXML);
-HXML __fastcall xmlGetChildByTag(HXML, LPCTSTR key, LPCTSTR attrName, LPCTSTR attrValue);
-HXML __fastcall xmlGetChildByTag(HXML, LPCSTR key, LPCSTR attrName, LPCTSTR attrValue);
-HXML __fastcall xmlGetNthChild(HXML, LPCTSTR key, int n = 0);
-
-LPCTSTR __fastcall xmlGetName(HXML);
-LPCTSTR __fastcall xmlGetText(HXML);
-
-void __fastcall xmlAddAttr(HXML, LPCTSTR pszName, LPCTSTR ptszValue);
-void __fastcall xmlAddAttr(HXML, LPCTSTR pszName, int value);
-void __fastcall xmlAddAttr(HXML hXml, LPCTSTR pszName, unsigned __int64 value);
-void __fastcall xmlAddAttrID(HXML, int id);
-
-int __fastcall xmlGetAttrCount(HXML);
-LPCTSTR __fastcall xmlGetAttr(HXML, int n);
-LPCTSTR __fastcall xmlGetAttrName(HXML, int n);
-LPCTSTR __fastcall xmlGetAttrValue(HXML, LPCTSTR key);
+void __fastcall XmlAddChild(HXML, HXML);
+HXML __fastcall XmlAddChild(HXML, LPCTSTR pszName);
+HXML __fastcall XmlAddChild(HXML, LPCTSTR pszName, LPCTSTR ptszValue);
+HXML __fastcall XmlAddChild(HXML, LPCTSTR pszName, int iValue);
+
+LPCTSTR __fastcall XmlGetAttrValue(HXML, LPCTSTR key);
+HXML __fastcall XmlGetChild(HXML, int n = 0);
+HXML __fastcall XmlGetChild(HXML, LPCSTR key);
+HXML __fastcall XmlGetChild(HXML, LPCTSTR key);
+int __fastcall XmlGetChildCount(HXML);
+HXML __fastcall XmlGetChildByTag(HXML, LPCTSTR key, LPCTSTR attrName, LPCTSTR attrValue);
+HXML __fastcall XmlGetChildByTag(HXML, LPCSTR key, LPCSTR attrName, LPCTSTR attrValue);
+HXML __fastcall XmlGetNthChild(HXML, LPCTSTR key, int n = 0);
+
+LPCTSTR __fastcall XmlGetName(HXML);
+LPCTSTR __fastcall XmlGetText(HXML);
+
+void __fastcall XmlAddAttr(HXML, LPCTSTR pszName, LPCTSTR ptszValue);
+void __fastcall XmlAddAttr(HXML, LPCTSTR pszName, int value);
+void __fastcall XmlAddAttr(HXML hXml, LPCTSTR pszName, unsigned __int64 value);
+void __fastcall XmlAddAttrID(HXML, int id);
+
+int __fastcall XmlGetAttrCount(HXML);
+LPCTSTR __fastcall XmlGetAttr(HXML, int n);
+LPCTSTR __fastcall XmlGetAttrName(HXML, int n);
+LPCTSTR __fastcall XmlGetAttrValue(HXML, LPCTSTR key);
struct XmlNode
{
@@ -61,7 +61,7 @@ struct XmlNode
__forceinline XmlNode(LPCTSTR pszString, int* numBytes, LPCTSTR ptszTag)
{
- m_hXml = xi.parseString(pszString, numBytes, ptszTag);
+ m_hXml = xmlParseString(pszString, numBytes, ptszTag);
}
XmlNode(const XmlNode& n);
@@ -107,7 +107,7 @@ struct XATTR
};
HXML __forceinline operator<<(HXML node, const XATTR& attr)
-{ xmlAddAttr(node, attr.name, attr.value);
+{ XmlAddAttr(node, attr.name, attr.value);
return node;
}
@@ -125,7 +125,7 @@ struct XATTRI
};
HXML __forceinline operator<<(HXML node, const XATTRI& attr)
-{ xmlAddAttr(node, attr.name, attr.value);
+{ XmlAddAttr(node, attr.name, attr.value);
return node;
}
@@ -143,7 +143,7 @@ struct XATTRI64
};
HXML __forceinline operator<<(HXML node, const XATTRI64& attr)
-{ xmlAddAttr(node, attr.name, attr.value);
+{ XmlAddAttr(node, attr.name, attr.value);
return node;
}
@@ -159,7 +159,7 @@ struct XATTRID
};
HXML __forceinline operator<<(HXML node, const XATTRID& attr)
-{ xmlAddAttrID(node, attr.id);
+{ XmlAddAttrID(node, attr.id);
return node;
}
@@ -176,7 +176,7 @@ struct XCHILD
};
HXML __forceinline operator<<(HXML node, const XCHILD& child)
-{ return xmlAddChild(node, child.name, child.value);
+{ return XmlAddChild(node, child.name, child.value);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -237,7 +237,7 @@ public:
switch (Lookup())
{
case T_NODE: return m_hXml;
- case T_NODESET: return xmlGetNthChild(m_hXml, m_szParam, 1);
+ case T_NODESET: return XmlGetNthChild(m_hXml, m_szParam, 1);
}
return NULL;
}
@@ -245,9 +245,9 @@ public:
{
switch (Lookup())
{
- case T_ATTRIBUTE: return (TCHAR *)xmlGetAttrValue(m_hXml, m_szParam);
- case T_NODE: return (TCHAR *)xmlGetText(m_hXml);
- case T_NODESET: return (TCHAR *)xmlGetText(xmlGetNthChild(m_hXml, m_szParam, 1));
+ case T_ATTRIBUTE: return (TCHAR *)XmlGetAttrValue(m_hXml, m_szParam);
+ case T_NODE: return (TCHAR *)XmlGetText(m_hXml);
+ case T_NODESET: return (TCHAR *)XmlGetText(XmlGetNthChild(m_hXml, m_szParam, 1));
}
return NULL;
}
@@ -266,7 +266,7 @@ public:
}
HXML operator[] (int idx)
{
- return (Lookup() == T_NODESET) ? xmlGetNthChild(m_hXml, m_szParam, idx) : NULL;
+ return (Lookup() == T_NODESET) ? XmlGetNthChild(m_hXml, m_szParam, idx) : NULL;
}
// Write data
@@ -274,7 +274,7 @@ public:
{
switch (Lookup(true))
{
- case T_ATTRIBUTE: xmlAddAttr(m_hXml, m_szParam, value); break;
+ case T_ATTRIBUTE: XmlAddAttr(m_hXml, m_szParam, value); break;
case T_NODE: break; // TODO: set node text
}
}
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp
index 947d047537..53959c0c83 100644
--- a/protocols/JabberG/src/jabber_xstatus.cpp
+++ b/protocols/JabberG/src/jabber_xstatus.cpp
@@ -626,7 +626,7 @@ void CPepMood::ProcessItems(const TCHAR *from, HXML itemsNode)
}
else hSelfContact = m_proto->HContactFromJID(from);
- if (xmlGetChild(itemsNode, _T("retract"))) {
+ if (XmlGetChild(itemsNode, _T("retract"))) {
if (hSelfContact)
SetMood(hSelfContact, NULL, NULL);
SetMood(hContact, NULL, NULL);
@@ -637,11 +637,11 @@ void CPepMood::ProcessItems(const TCHAR *from, HXML itemsNode)
if (!moodNode) return;
LPCTSTR moodType = NULL, moodText = NULL;
- for (int i=0; n = xmlGetChild(moodNode, i); i++) {
- if (!mir_tstrcmp(xmlGetName(n), _T("text")))
- moodText = xmlGetText(n);
+ for (int i=0; n = XmlGetChild(moodNode, i); i++) {
+ if (!mir_tstrcmp(XmlGetName(n), _T("text")))
+ moodText = XmlGetText(n);
else
- moodType = xmlGetName(n);
+ moodType = XmlGetName(n);
}
TCHAR *fixedText = JabberStrFixLines(moodText);
@@ -1006,7 +1006,7 @@ void CPepActivity::ProcessItems(const TCHAR *from, HXML itemsNode)
}
else hSelfContact = m_proto->HContactFromJID(from);
- if (xmlGetChild(itemsNode, "retract")) {
+ if (XmlGetChild(itemsNode, "retract")) {
if (hSelfContact)
SetActivity(hSelfContact, NULL, NULL, NULL);
SetActivity(hContact, NULL, NULL, NULL);
@@ -1021,12 +1021,12 @@ void CPepActivity::ProcessItems(const TCHAR *from, HXML itemsNode)
LPCTSTR szFirstNode = NULL, szSecondNode = NULL;
HXML n;
- for (int i=0; n = xmlGetChild(actNode, i); i++) {
- if (mir_tstrcmp(xmlGetName(n), _T("text"))) {
- szFirstNode = xmlGetName(n);
- HXML secondNode = xmlGetChild(n, 0);
- if (szFirstNode && secondNode && xmlGetName(secondNode))
- szSecondNode = xmlGetName(secondNode);
+ for (int i=0; n = XmlGetChild(actNode, i); i++) {
+ if (mir_tstrcmp(XmlGetName(n), _T("text"))) {
+ szFirstNode = XmlGetName(n);
+ HXML secondNode = XmlGetChild(n, 0);
+ if (szFirstNode && secondNode && XmlGetName(secondNode))
+ szSecondNode = XmlGetName(secondNode);
break;
}
}
diff --git a/protocols/JabberG/src/jabber_xstatus.h b/protocols/JabberG/src/jabber_xstatus.h
index 1fd27d5c2b..daa12ac4ec 100644
--- a/protocols/JabberG/src/jabber_xstatus.h
+++ b/protocols/JabberG/src/jabber_xstatus.h
@@ -69,7 +69,7 @@ public:
for (int i=0; i < getCount(); i++)
{
CPepService &pepSvc = (*this)[i];
- HXML itemsNode = xmlGetChildByTag(eventNode, _T("items"), _T("node"), pepSvc.GetNode());
+ HXML itemsNode = XmlGetChildByTag(eventNode, _T("items"), _T("node"), pepSvc.GetNode());
if (itemsNode)
pepSvc.ProcessItems(from, itemsNode);
}
diff --git a/protocols/SkypeWeb/src/main.cpp b/protocols/SkypeWeb/src/main.cpp
index 0d09d03e32..c944b64fb5 100644
--- a/protocols/SkypeWeb/src/main.cpp
+++ b/protocols/SkypeWeb/src/main.cpp
@@ -18,7 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
int hLangpack;
-XML_API xi;
HINSTANCE g_hInstance;
CLIST_INTERFACE *pcli;
char g_szMirVer[100];
@@ -55,7 +54,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
- mir_getXI(&xi);
mir_getCLI();
CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(g_szMirVer), LPARAM(g_szMirVer));
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp
index 51b70c307a..eef1c9179f 100644
--- a/protocols/SkypeWeb/src/skype_chatrooms.cpp
+++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp
@@ -293,37 +293,37 @@ void CSkypeProto::OnChatEvent(const JSONNode &node)
ptrA xinitiator, xtarget, initiator;
//content = <addmember><eventtime>1429186229164</eventtime><initiator>8:initiator</initiator><target>8:user</target></addmember>
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("addmember"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("addmember"));
if (xml == NULL)
return;
- for (int i = 0; i < xi.getChildCount(xml); i++)
+ for (int i = 0; i < xmlGetChildCount(xml); i++)
{
- HXML xmlNode = xi.getNthChild(xml, L"target", i);
+ HXML xmlNode = xmlGetNthChild(xml, L"target", i);
if (xmlNode == NULL)
break;
- xtarget = mir_t2a(xi.getText(xmlNode));
+ xtarget = mir_t2a(xmlGetText(xmlNode));
CMStringA target = ParseUrl(xtarget, "8:");
AddChatContact(_A2T(chatname), target, target, L"User");
}
- xi.destroyNode(xml);
+ xmlDestroyNode(xml);
}
else if (!mir_strcmpi(messageType.c_str(), "ThreadActivity/DeleteMember"))
{
ptrA xinitiator, xtarget;
//content = <addmember><eventtime>1429186229164</eventtime><initiator>8:initiator</initiator><target>8:user</target></addmember>
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("deletemember"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("deletemember"));
if (xml != NULL) {
- HXML xmlNode = xi.getChildByPath(xml, _T("initiator"), 0);
- xinitiator = node != NULL ? mir_t2a(xi.getText(xmlNode)) : NULL;
+ HXML xmlNode = xmlGetChildByPath(xml, _T("initiator"), 0);
+ xinitiator = node != NULL ? mir_t2a(xmlGetText(xmlNode)) : NULL;
- xmlNode = xi.getChildByPath(xml, _T("target"), 0);
- xtarget = xmlNode != NULL ? mir_t2a(xi.getText(xmlNode)) : NULL;
+ xmlNode = xmlGetChildByPath(xml, _T("target"), 0);
+ xtarget = xmlNode != NULL ? mir_t2a(xmlGetText(xmlNode)) : NULL;
- xi.destroyNode(xml);
+ xmlDestroyNode(xml);
}
if (xtarget == NULL)
return;
@@ -337,15 +337,15 @@ void CSkypeProto::OnChatEvent(const JSONNode &node)
{
//content=<topicupdate><eventtime>1429532702130</eventtime><initiator>8:user</initiator><value>test topic</value></topicupdate>
ptrA xinitiator, value;
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("topicupdate"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("topicupdate"));
if (xml != NULL) {
- HXML xmlNode = xi.getChildByPath(xml, _T("initiator"), 0);
- xinitiator = xmlNode != NULL ? mir_t2a(xi.getText(xmlNode)) : NULL;
+ HXML xmlNode = xmlGetChildByPath(xml, _T("initiator"), 0);
+ xinitiator = xmlNode != NULL ? mir_t2a(xmlGetText(xmlNode)) : NULL;
- xmlNode = xi.getChildByPath(xml, _T("value"), 0);
- value = xmlNode != NULL ? mir_t2a(xi.getText(xmlNode)) : NULL;
+ xmlNode = xmlGetChildByPath(xml, _T("value"), 0);
+ value = xmlNode != NULL ? mir_t2a(xmlGetText(xmlNode)) : NULL;
- xi.destroyNode(xml);
+ xmlDestroyNode(xml);
}
CMStringA initiator = ParseUrl(xinitiator, "8:");
@@ -356,20 +356,20 @@ void CSkypeProto::OnChatEvent(const JSONNode &node)
{
//content=<roleupdate><eventtime>1429551258363</eventtime><initiator>8:user</initiator><target><id>8:user1</id><role>admin</role></target></roleupdate>
ptrA xinitiator, xId, xRole;
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("roleupdate"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("roleupdate"));
if (xml != NULL) {
- HXML xmlNode = xi.getChildByPath(xml, _T("initiator"), 0);
- xinitiator = xmlNode != NULL ? mir_t2a(xi.getText(xmlNode)) : NULL;
+ HXML xmlNode = xmlGetChildByPath(xml, _T("initiator"), 0);
+ xinitiator = xmlNode != NULL ? mir_t2a(xmlGetText(xmlNode)) : NULL;
- xmlNode = xi.getChildByPath(xml, _T("target"), 0);
+ xmlNode = xmlGetChildByPath(xml, _T("target"), 0);
if (xmlNode != NULL)
{
- HXML xmlId = xi.getChildByPath(xmlNode, _T("id"), 0);
- HXML xmlRole = xi.getChildByPath(xmlNode, _T("role"), 0);
- xId = xmlId != NULL ? mir_t2a(xi.getText(xmlId)) : NULL;
- xRole = xmlRole != NULL ? mir_t2a(xi.getText(xmlRole)) : NULL;
+ HXML xmlId = xmlGetChildByPath(xmlNode, _T("id"), 0);
+ HXML xmlRole = xmlGetChildByPath(xmlNode, _T("role"), 0);
+ xId = xmlId != NULL ? mir_t2a(xmlGetText(xmlId)) : NULL;
+ xRole = xmlRole != NULL ? mir_t2a(xmlGetText(xmlRole)) : NULL;
}
- xi.destroyNode(xml);
+ xmlDestroyNode(xml);
CMStringA initiator = ParseUrl(xinitiator, "8:");
CMStringA id = ParseUrl(xId, "8:");
diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp
index c21ee4573a..ef57c93e8a 100644
--- a/protocols/SkypeWeb/src/skype_history_sync.cpp
+++ b/protocols/SkypeWeb/src/skype_history_sync.cpp
@@ -107,19 +107,19 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response)
//content=<partlist type="started" alt=""><part identity="username"><name>user name</name></part></partlist>
int iType = 3, iDuration = 0;
CMStringA skypename(ContactUrlToName(from.c_str()));
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("partlist"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("partlist"));
if (xml != NULL)
{
- ptrA type(mir_t2a(xi.getAttrValue(xml, _T("type"))));
+ ptrA type(mir_t2a(xmlGetAttrValue(xml, _T("type"))));
if (!mir_strcmpi(type, "ended")) iType = 0;
else if (!mir_strcmpi(type, "started")) iType = 1;
- HXML xmlNode = xi.getChildByPath(xml, _T("part"), 0);
- HXML duration = xmlNode == NULL ? NULL : xi.getChildByPath(xmlNode, _T("duration"), 0);
- iDuration = duration != NULL ? atoi(mir_t2a(xi.getText(duration))) : NULL;
+ HXML xmlNode = xmlGetChildByPath(xml, _T("part"), 0);
+ HXML duration = xmlNode == NULL ? NULL : xmlGetChildByPath(xmlNode, _T("duration"), 0);
+ iDuration = duration != NULL ? atoi(mir_t2a(xmlGetText(duration))) : NULL;
- xi.destroyNode(xml);
+ xmlDestroyNode(xml);
}
CMStringA text = "";
if (iType == 1)
@@ -147,17 +147,17 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response)
else if (!mir_strcmpi(messageType.c_str(), "RichText/Files"))
{
//content=<files alt="отправил (-а) файл &quot;run.bat&quot;"><file size="97" index="0" tid="4197760077">run.bat</file></files>
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("files"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("files"));
if (xml != NULL)
{
- for (int i = 0; i < xi.getChildCount(xml); i++)
+ for (int i = 0; i < xmlGetChildCount(xml); i++)
{
int fileSize; CMStringA msg = "";
- HXML xmlNode = xi.getNthChild(xml, L"file", i);
+ HXML xmlNode = xmlGetNthChild(xml, L"file", i);
if (xmlNode == NULL)
break;
- fileSize = atoi(_T2A(xi.getAttrValue(xmlNode, L"size")));
- ptrA fileName(mir_t2a(xi.getText(xmlNode)));
+ fileSize = atoi(_T2A(xmlGetAttrValue(xmlNode, L"size")));
+ ptrA fileName(mir_t2a(xmlGetText(xmlNode)));
if (fileName == NULL || fileSize == NULL)
continue;
@@ -170,10 +170,10 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response)
else if (!mir_strcmpi(messageType.c_str(), "RichText/UriObject"))
{
//content=<URIObject type="Picture.1" uri="https://api.asm.skype.com/v1//objects/0-weu-d1-262f0a1ee256d03b8e4b8360d9208834" url_thumbnail="https://api.asm.skype.com/v1//objects/0-weu-d1-262f0a1ee256d03b8e4b8360d9208834/views/imgt1"><Title></Title><Description></Description>Для просмотра этого общего фото перейдите по ссылке: https://api.asm.skype.com/s/i?0-weu-d1-262f0a1ee256d03b8e4b8360d9208834<meta type="photo" originalName="ysd7ZE4BqOg.jpg"/><OriginalName v="ysd7ZE4BqOg.jpg"/></URIObject>
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("URIObject"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("URIObject"));
if (xml != NULL)
{
- CMStringA object(ParseUrl(_T2A(xi.getAttrValue(xml, L"uri")), "/objects/"));
+ CMStringA object(ParseUrl(_T2A(xmlGetAttrValue(xml, L"uri")), "/objects/"));
CMStringA data(FORMAT, "%s: https://api.asm.skype.com/s/i?%s", Translate("Image"), object.c_str());
AddMessageToDb(hContact, timestamp, flags, clientMsgId.c_str(), data.GetBuffer());
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp
index cdd86adf49..87ed6a37fe 100644
--- a/protocols/SkypeWeb/src/skype_messages.cpp
+++ b/protocols/SkypeWeb/src/skype_messages.cpp
@@ -199,20 +199,20 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node)
//<part identity="echo123"><name>Echo / Sound Test Service</name><duration>6</duration></part></partlist>
//content=<partlist type="started" alt=""><part identity="username"><name>user name</name></part></partlist>
int iType = 3, iDuration = 0;
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("partlist"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("partlist"));
if (xml != NULL)
{
- ptrA type(mir_t2a(xi.getAttrValue(xml, _T("type"))));
+ ptrA type(mir_t2a(xmlGetAttrValue(xml, _T("type"))));
if (!mir_strcmpi(type, "ended")) iType = 0;
else if (!mir_strcmpi(type, "started")) iType = 1;
- HXML xmlNode = xi.getChildByPath(xml, _T("part"), 0);
- HXML duration = xmlNode == NULL ? NULL : xi.getChildByPath(xmlNode, _T("duration"), 0);
- iDuration = duration != NULL ? atoi(mir_t2a(xi.getText(duration))) : NULL;
+ HXML xmlNode = xmlGetChildByPath(xml, _T("part"), 0);
+ HXML duration = xmlNode == NULL ? NULL : xmlGetChildByPath(xmlNode, _T("duration"), 0);
+ iDuration = duration != NULL ? atoi(mir_t2a(xmlGetText(duration))) : NULL;
- xi.destroyNode(xml);
+ xmlDestroyNode(xml);
}
CMStringA text = "";
if (iType == 1)
@@ -244,17 +244,17 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node)
else if (!mir_strcmpi(messageType.c_str(), "RichText/Files"))
{
//content=<files alt="отправил (-а) файл &quot;run.bat&quot;"><file size="97" index="0" tid="4197760077">run.bat</file></files>
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("files"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("files"));
if (xml != NULL)
{
- for (int i = 0; i < xi.getChildCount(xml); i++)
+ for (int i = 0; i < xmlGetChildCount(xml); i++)
{
int fileSize;
- HXML xmlNode = xi.getNthChild(xml, _T("file"), i);
+ HXML xmlNode = xmlGetNthChild(xml, _T("file"), i);
if (xmlNode == NULL)
break;
- fileSize = atoi(_T2A(xi.getAttrValue(xmlNode, _T("size"))));
- ptrA fileName(mir_utf8encodeT(xi.getText(xmlNode)));
+ fileSize = atoi(_T2A(xmlGetAttrValue(xmlNode, _T("size"))));
+ ptrA fileName(mir_utf8encodeT(xmlGetText(xmlNode)));
if (fileName == NULL || fileSize == NULL)
continue;
@@ -267,10 +267,10 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node)
else if (!mir_strcmpi(messageType.c_str(), "RichText/UriObject"))
{
//content=<URIObject type="Picture.1" uri="https://api.asm.skype.com/v1//objects/0-weu-d1-262f0a1ee256d03b8e4b8360d9208834" url_thumbnail="https://api.asm.skype.com/v1//objects/0-weu-d1-262f0a1ee256d03b8e4b8360d9208834/views/imgt1"><Title></Title><Description></Description>Для просмотра этого общего фото перейдите по ссылке: https://api.asm.skype.com/s/i?0-weu-d1-262f0a1ee256d03b8e4b8360d9208834<meta type="photo" originalName="ysd7ZE4BqOg.jpg"/><OriginalName v="ysd7ZE4BqOg.jpg"/></URIObject>
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("URIObject"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("URIObject"));
if (xml != NULL)
{
- CMStringA object(ParseUrl(_T2A(xi.getAttrValue(xml, L"uri")), "/objects/"));
+ CMStringA object(ParseUrl(_T2A(xmlGetAttrValue(xml, L"uri")), "/objects/"));
CMStringA data(FORMAT, "%s: https://api.asm.skype.com/s/i?%s", Translate("Image"), object.c_str());
AddMessageToDb(hContact, timestamp, DBEF_UTF, clientMsgId.c_str(), data.GetBuffer());
}
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 29a0ddd771..ca4b04ac19 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -142,3 +142,58 @@ Proto_ChainSend @139
Proto_IsProtoOnContact @140
Proto_RegisterModule @141
Proto_RemoveFromContact @142
+xmlAddAttr @143
+xmlAddAttrInt @144
+xmlAddChild @145
+xmlAddChild2 @146
+xmlAddChildEx @147
+xmlAddChildEx2 @148
+xmlAddClear @149
+xmlAddText @150
+xmlCopyNode @151
+xmlCreateNode @152
+xmlDeepCopy @153
+xmlDeleteAttrByIndex @154
+xmlDeleteAttrByName @155
+xmlDeleteClear @156
+xmlDeleteNodeContent @157
+xmlDeleteText @158
+xmlDestroyNode @159
+xmlFree @160
+xmlGetAttr @161
+xmlGetAttrCount @162
+xmlGetAttrName @163
+xmlGetAttrValue @164
+xmlGetChild @165
+xmlGetChildByAttrValue @166
+xmlGetChildByPath @167
+xmlGetChildCount @168
+xmlGetClear @169
+xmlGetClearCount @170
+xmlGetElement @171
+xmlGetElementCount @172
+xmlGetFirstChild @173
+xmlGetName @174
+xmlGetNextChild @175
+xmlGetNextNode @176
+xmlGetNthChild @177
+xmlGetParent @178
+xmlGetText @179
+xmlGetTextByIndex @180
+xmlGetTextCount @181
+xmlIsDeclaration @182
+xmlParseFile @183
+xmlParseString @184
+xmlPositionOfChildByIndex @185
+xmlPositionOfChildByName @186
+xmlPositionOfChildByNode @187
+xmlPositionOfClear @188
+xmlPositionOfText @189
+xmlSetAttrByIndex @190
+xmlSetAttrByName @191
+xmlSetClear @192
+xmlSetText @193
+xmlSetTextByIndex @194
+xmlToFile @195
+xmlToString @196
+xmlToStringWithFormatting @197
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index be37130c97..4bf3102631 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -142,3 +142,58 @@ Proto_ChainSend @139
Proto_IsProtoOnContact @140
Proto_RegisterModule @141
Proto_RemoveFromContact @142
+xmlAddAttr @143
+xmlAddAttrInt @144
+xmlAddChild @145
+xmlAddChild2 @146
+xmlAddChildEx @147
+xmlAddChildEx2 @148
+xmlAddClear @149
+xmlAddText @150
+xmlCopyNode @151
+xmlCreateNode @152
+xmlDeepCopy @153
+xmlDeleteAttrByIndex @154
+xmlDeleteAttrByName @155
+xmlDeleteClear @156
+xmlDeleteNodeContent @157
+xmlDeleteText @158
+xmlDestroyNode @159
+xmlFree @160
+xmlGetAttr @161
+xmlGetAttrCount @162
+xmlGetAttrName @163
+xmlGetAttrValue @164
+xmlGetChild @165
+xmlGetChildByAttrValue @166
+xmlGetChildByPath @167
+xmlGetChildCount @168
+xmlGetClear @169
+xmlGetClearCount @170
+xmlGetElement @171
+xmlGetElementCount @172
+xmlGetFirstChild @173
+xmlGetName @174
+xmlGetNextChild @175
+xmlGetNextNode @176
+xmlGetNthChild @177
+xmlGetParent @178
+xmlGetText @179
+xmlGetTextByIndex @180
+xmlGetTextCount @181
+xmlIsDeclaration @182
+xmlParseFile @183
+xmlParseString @184
+xmlPositionOfChildByIndex @185
+xmlPositionOfChildByName @186
+xmlPositionOfChildByNode @187
+xmlPositionOfClear @188
+xmlPositionOfText @189
+xmlSetAttrByIndex @190
+xmlSetAttrByName @191
+xmlSetClear @192
+xmlSetText @193
+xmlSetTextByIndex @194
+xmlToFile @195
+xmlToString @196
+xmlToStringWithFormatting @197
diff --git a/src/mir_app/src/utils.cpp b/src/mir_app/src/utils.cpp
index c5ec173858..a383bbaf2f 100644
--- a/src/mir_app/src/utils.cpp
+++ b/src/mir_app/src/utils.cpp
@@ -377,7 +377,6 @@ int LoadUtilsModule(void)
InitOpenUrl();
InitPathUtils();
- InitXmlApi();
InitCrypt();
return 0;
}
diff --git a/src/mir_app/src/xmlApi.cpp b/src/mir_app/src/xmlApi.cpp
index cd0c347987..2e1ad2c3f5 100644
--- a/src/mir_app/src/xmlApi.cpp
+++ b/src/mir_app/src/xmlApi.cpp
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
#include "xmlParser.h"
-static HXML xmlapiCreateNode(LPCTSTR name, LPCTSTR text, char isDeclaration)
+MIR_APP_DLL(HXML) xmlCreateNode(LPCTSTR name, LPCTSTR text, char isDeclaration)
{
XMLNode result = XMLNode::createXMLTopNode(name, isDeclaration);
if (text)
@@ -33,12 +33,12 @@ static HXML xmlapiCreateNode(LPCTSTR name, LPCTSTR text, char isDeclaration)
return result.detach();
}
-static void xmlapiDestroyNode(HXML n)
+MIR_APP_DLL(void) xmlDestroyNode(HXML n)
{
XMLNode tmp; tmp.attach(n);
}
-static HXML xmlapiParseFile(LPCTSTR str, int* datalen, LPCTSTR tag)
+MIR_APP_DLL(HXML) xmlParseFile(LPCTSTR str, int* datalen, LPCTSTR tag)
{
if (str == NULL) return NULL;
@@ -51,7 +51,7 @@ static HXML xmlapiParseFile(LPCTSTR str, int* datalen, LPCTSTR tag)
return (res.error == eXMLErrorNone || (tag != NULL && res.error == eXMLErrorMissingEndTag)) ? result.detach() : NULL;
}
-static HXML xmlapiParseString(LPCTSTR str, int* datalen, LPCTSTR tag)
+MIR_APP_DLL(HXML) xmlParseString(LPCTSTR str, int* datalen, LPCTSTR tag)
{
if (str == NULL) return NULL;
@@ -64,7 +64,7 @@ static HXML xmlapiParseString(LPCTSTR str, int* datalen, LPCTSTR tag)
return (res.error == eXMLErrorNone || (tag != NULL && res.error == eXMLErrorMissingEndTag)) ? result.detach() : NULL;
}
-static HXML xmlapiAddChild(HXML _n, LPCTSTR name, LPCTSTR text)
+MIR_APP_DLL(HXML) xmlAddChild(HXML _n, LPCTSTR name, LPCTSTR text)
{
XMLNode result = XMLNode(_n).addChild(name);
if (text != NULL)
@@ -72,158 +72,158 @@ static HXML xmlapiAddChild(HXML _n, LPCTSTR name, LPCTSTR text)
return result;
}
-static void xmlapiAddChild2(HXML _child, HXML _parent)
+MIR_APP_DLL(void) xmlAddChild2(HXML _child, HXML _parent)
{
XMLNode child(_child), parent(_parent);
parent.addChild(child);
}
-static HXML xmlapiCopyNode(HXML _n)
+MIR_APP_DLL(HXML) xmlCopyNode(HXML _n)
{
XMLNode result = XMLNode(_n);
return result.detach();
}
-static LPCTSTR xmlapiGetAttr(HXML _n, int i)
+MIR_APP_DLL(LPCTSTR) xmlGetAttr(HXML _n, int i)
{
return XMLNode(_n).getAttributeValue(i);
}
-static int xmlapiGetAttrCount(HXML _n)
+MIR_APP_DLL(int) xmlGetAttrCount(HXML _n)
{
return XMLNode(_n).nAttribute();
}
-static LPCTSTR xmlapiGetAttrName(HXML _n, int i)
+MIR_APP_DLL(LPCTSTR) xmlGetAttrName(HXML _n, int i)
{
return XMLNode(_n).getAttributeName(i);
}
-static HXML xmlapiGetChild(HXML _n, int i)
+MIR_APP_DLL(HXML) xmlGetChild(HXML _n, int i)
{
return XMLNode(_n).getChildNode(i);
}
-static HXML xmlapiGetChildByAttrValue(HXML _n, LPCTSTR name, LPCTSTR attrName, LPCTSTR attrValue)
+MIR_APP_DLL(HXML) xmlGetChildByAttrValue(HXML _n, LPCTSTR name, LPCTSTR attrName, LPCTSTR attrValue)
{
return XMLNode(_n).getChildNodeWithAttribute(name, attrName, attrValue);
}
-static int xmlapiGetChildCount(HXML _n)
+MIR_APP_DLL(int) xmlGetChildCount(HXML _n)
{
return XMLNode(_n).nChildNode();
}
-static HXML xmlapiGetFirstChild(HXML _n)
+MIR_APP_DLL(HXML) xmlGetFirstChild(HXML _n)
{
return XMLNode(_n).getChildNode(0);
}
-static HXML xmlapiGetNthChild(HXML _n, LPCTSTR name, int i)
+MIR_APP_DLL(HXML) xmlGetNthChild(HXML _n, LPCTSTR name, int i)
{
return XMLNode(_n).getChildNode(name, i);
}
-static HXML xmlapiGetNextChild(HXML _n, LPCTSTR name, int* i)
+MIR_APP_DLL(HXML) xmlGetNextChild(HXML _n, LPCTSTR name, int* i)
{
return XMLNode(_n).getChildNode(name, i);
}
-static HXML xmlapiGetNextNode(HXML _n)
+MIR_APP_DLL(HXML) xmlGetNextNode(HXML _n)
{
return XMLNode(_n).getNextNode();
}
-static HXML xmlapiGetChildByPath(HXML _n, LPCTSTR path, char createNodeIfMissing)
+MIR_APP_DLL(HXML) xmlGetChildByPath(HXML _n, LPCTSTR path, char createNodeIfMissing)
{
return XMLNode(_n).getChildNodeByPath(path, createNodeIfMissing);
}
-static LPCTSTR xmlapiGetName(HXML _n)
+MIR_APP_DLL(LPCTSTR) xmlGetName(HXML _n)
{
return XMLNode(_n).getName();
}
-static HXML xmlapiGetParent(HXML _n)
+MIR_APP_DLL(HXML) xmlGetParent(HXML _n)
{
return XMLNode(_n).getParentNode();
}
-static LPCTSTR xmlapiGetText(HXML _n)
+MIR_APP_DLL(LPCTSTR) xmlGetText(HXML _n)
{
return XMLNode(_n).getInnerText();
}
-static LPCTSTR xmlapiGetAttrValue(HXML _n, LPCTSTR attrName)
+MIR_APP_DLL(LPCTSTR) xmlGetAttrValue(HXML _n, LPCTSTR attrName)
{
return XMLNode(_n).getAttribute(attrName);
}
-static void xmlapiSetText(HXML _n, LPCTSTR _text)
+MIR_APP_DLL(void) xmlSetText(HXML _n, LPCTSTR _text)
{
XMLNode(_n).updateText(_text);
}
-static LPTSTR xmlapiToString(HXML _n, int* datalen)
+MIR_APP_DLL(LPTSTR) xmlToString(HXML _n, int* datalen)
{
return XMLNode(_n).createXMLString(0, datalen);
}
-static XMLError xmlapiToFile(HXML _n, LPCTSTR filename, int withformatting)
+MIR_APP_DLL(XMLError) xmlToFile(HXML _n, LPCTSTR filename, int withformatting)
{
return XMLNode(_n).writeToFile(filename, NULL, withformatting);
}
-static void xmlapiAddAttr(HXML _n, LPCTSTR attrName, LPCTSTR attrValue)
+MIR_APP_DLL(void) xmlAddAttr(HXML _n, LPCTSTR attrName, LPCTSTR attrValue)
{
if (attrName != NULL && attrValue != NULL)
XMLNode(_n).addAttribute(attrName, attrValue);
}
-static void xmlapiAddAttrInt(HXML _n, LPCTSTR attrName, int attrValue)
+MIR_APP_DLL(void) xmlAddAttrInt(HXML _n, LPCTSTR attrName, int attrValue)
{
TCHAR buf[40];
_itot(attrValue, buf, 10);
XMLNode(_n).addAttribute(attrName, buf);
}
-static void xmlapiFree(void* p)
+MIR_APP_DLL(void) xmlFree(void* p)
{
free(p);
}
-// XML API v2 methods
-static int xmlapiGetTextCount(HXML _n)
+//) xml API v2 methods
+MIR_APP_DLL(int) xmlGetTextCount(HXML _n)
{
return XMLNode(_n).nText();
}
-static LPCTSTR xmlapiGetTextByIndex(HXML _n, int i)
+MIR_APP_DLL(LPCTSTR) xmlGetTextByIndex(HXML _n, int i)
{
return XMLNode(_n).getText(i);
}
-static void xmlapiSetTextByIndex(HXML _n, int i, LPCTSTR value)
+MIR_APP_DLL(void) xmlSetTextByIndex(HXML _n, int i, LPCTSTR value)
{
XMLNode(_n).updateText(value, i);
}
-static void xmlapiAddText(HXML _n, LPCTSTR value, XML_ELEMENT_POS pos)
+MIR_APP_DLL(void) xmlAddText(HXML _n, LPCTSTR value, XML_ELEMENT_POS pos)
{
XMLNode(_n).addText(value, (XMLElementPosition)pos);
}
-static LPTSTR xmlapiToStringWithFormatting(HXML _n, int* datalen)
+MIR_APP_DLL(LPTSTR) xmlToStringWithFormatting(HXML _n, int* datalen)
{
return XMLNode(_n).createXMLString(1, datalen);
}
-static int xmlapiGetClearCount(HXML _n)
+MIR_APP_DLL(int) xmlGetClearCount(HXML _n)
{
return XMLNode(_n).nClear();
}
-static LPCTSTR xmlapiGetClear(HXML _n, int i, LPCTSTR *openTag, LPCTSTR *closeTag)
+MIR_APP_DLL(LPCTSTR) xmlGetClear(HXML _n, int i, LPCTSTR *openTag, LPCTSTR *closeTag)
{
XMLClear c = XMLNode(_n).getClear(i);
if (openTag)
@@ -233,17 +233,17 @@ static LPCTSTR xmlapiGetClear(HXML _n, int i, LPCTSTR *openTag, LPCTSTR *closeTa
return c.lpszValue;
}
-static void xmlapiAddClear(HXML _n, LPCTSTR lpszValue, LPCTSTR openTag, LPCTSTR closeTag, XML_ELEMENT_POS pos)
+MIR_APP_DLL(void) xmlAddClear(HXML _n, LPCTSTR lpszValue, LPCTSTR openTag, LPCTSTR closeTag, XML_ELEMENT_POS pos)
{
XMLNode(_n).addClear(lpszValue, openTag, closeTag, (XMLElementPosition)pos);
}
-static void xmlapiSetClear(HXML _n, int i, LPCTSTR lpszValue)
+MIR_APP_DLL(void) xmlSetClear(HXML _n, int i, LPCTSTR lpszValue)
{
XMLNode(_n).updateClear(lpszValue, i);
}
-static int xmlapiGetElement(HXML _n, XML_ELEMENT_POS pos, XML_ELEMENT_TYPE *type, HXML *child, LPCTSTR *value, LPCTSTR *name, LPCTSTR *openTag, LPCTSTR *closeTag)
+MIR_APP_DLL(int) xmlGetElement(HXML _n, XML_ELEMENT_POS pos, XML_ELEMENT_TYPE *type, HXML *child, LPCTSTR *value, LPCTSTR *name, LPCTSTR *openTag, LPCTSTR *closeTag)
{
// reset all values
if (child)
@@ -259,209 +259,126 @@ static int xmlapiGetElement(HXML _n, XML_ELEMENT_POS pos, XML_ELEMENT_TYPE *type
if (!type || pos >= XMLNode(_n).nElement())
return false;
+
XMLNodeContents c(XMLNode(_n).enumContents((XMLElementPosition)pos));
switch (c.etype) {
- case eNodeChild:
- {
- *type = XML_ELEM_TYPE_CHILD;
- if (child)
- *child = c.child;
- } break;
- case eNodeAttribute:
- {
- *type = XML_ELEM_TYPE_ATTRIBUTE;
- if (name)
- *name = c.attrib.lpszName;
- if (value)
- *value = c.attrib.lpszValue;
- } break;
- case eNodeText:
- {
- *type = XML_ELEM_TYPE_TEXT;
- if (value)
- *value = c.text;
- } break;
- case eNodeClear:
- {
- *type = XML_ELEM_TYPE_CLEAR;
- if (value)
- *value = c.clear.lpszValue;
- if (openTag)
- *openTag = c.clear.lpszOpenTag;
- if (closeTag)
- *closeTag = c.clear.lpszCloseTag;
- } break;
- case eNodeNULL:
- {
- return false;
- } break;
+ case eNodeChild:
+ *type = XML_ELEM_TYPE_CHILD;
+ if (child)
+ *child = c.child;
+ break;
+
+ case eNodeAttribute:
+ *type = XML_ELEM_TYPE_ATTRIBUTE;
+ if (name)
+ *name = c.attrib.lpszName;
+ if (value)
+ *value = c.attrib.lpszValue;
+ break;
+
+ case eNodeText:
+ *type = XML_ELEM_TYPE_TEXT;
+ if (value)
+ *value = c.text;
+ break;
+
+ case eNodeClear:
+ *type = XML_ELEM_TYPE_CLEAR;
+ if (value)
+ *value = c.clear.lpszValue;
+ if (openTag)
+ *openTag = c.clear.lpszOpenTag;
+ if (closeTag)
+ *closeTag = c.clear.lpszCloseTag;
+ break;
+
+ case eNodeNULL:
+ return false;
}
return true;
}
-static int xmlapiGetElementCount(HXML _n)
+MIR_APP_DLL(int) xmlGetElementCount(HXML _n)
{
return XMLNode(_n).nElement();
}
-static char xmlapiIsDeclaration(HXML _n)
+MIR_APP_DLL(char) xmlIsDeclaration(HXML _n)
{
return XMLNode(_n).isDeclaration();
}
-static HXML xmlapiDeepCopy(HXML _n)
+MIR_APP_DLL(HXML) xmlDeepCopy(HXML _n)
{
return XMLNode(_n).deepCopy().detach();
}
-static HXML xmlapiAddChildEx(HXML _n, LPCTSTR name, char isDeclaration, XML_ELEMENT_POS pos)
+MIR_APP_DLL(HXML) xmlAddChildEx(HXML _n, LPCTSTR name, char isDeclaration, XML_ELEMENT_POS pos)
{
return XMLNode(_n).addChild(name, isDeclaration, (XMLElementPosition)pos);
}
-static void xmlapiAddChildEx2(HXML _n, HXML parent, XML_ELEMENT_POS pos)
+MIR_APP_DLL(void) xmlAddChildEx2(HXML _n, HXML parent, XML_ELEMENT_POS pos)
{
XMLNode(_n).addChild(parent, (XMLElementPosition)pos);
}
-static void xmlapiSetAttrByIndex(HXML _n, int i, LPCTSTR value)
+MIR_APP_DLL(void) xmlSetAttrByIndex(HXML _n, int i, LPCTSTR value)
{
XMLNode(_n).updateAttribute(value, NULL, i);
}
-static void xmlapiSetAttrByName(HXML _n, LPCTSTR name, LPCTSTR value)
+MIR_APP_DLL(void) xmlSetAttrByName(HXML _n, LPCTSTR name, LPCTSTR value)
{
XMLNode(_n).updateAttribute(value, NULL, name);
}
-static void xmlapiDeleteNodeContent(HXML _n)
+MIR_APP_DLL(void) xmlDeleteNodeContent(HXML _n)
{
XMLNode(_n).deleteNodeContent();
}
-static void xmlapiDeleteAttrByIndex(HXML _n, int i)
+MIR_APP_DLL(void) xmlDeleteAttrByIndex(HXML _n, int i)
{
XMLNode(_n).deleteAttribute(i);
}
-static void xmlapiDeleteAttrByName(HXML _n, LPCTSTR name)
+MIR_APP_DLL(void) xmlDeleteAttrByName(HXML _n, LPCTSTR name)
{
XMLNode(_n).deleteAttribute(name);
}
-static void xmlapiDeleteText(HXML _n, int i)
+MIR_APP_DLL(void) xmlDeleteText(HXML _n, int i)
{
XMLNode(_n).deleteText(i);
}
-static void xmlapiDeleteClear(HXML _n, int i)
+MIR_APP_DLL(void) xmlDeleteClear(HXML _n, int i)
{
XMLNode(_n).deleteClear(i);
}
-static XML_ELEMENT_POS xmlapiPositionOfText(HXML _n, int i)
+MIR_APP_DLL(XML_ELEMENT_POS) xmlPositionOfText(HXML _n, int i)
{
return (XML_ELEMENT_POS)XMLNode(_n).positionOfText(i);
}
-static XML_ELEMENT_POS xmlapiPositionOfClear(HXML _n, int i)
+MIR_APP_DLL(XML_ELEMENT_POS) xmlPositionOfClear(HXML _n, int i)
{
return (XML_ELEMENT_POS)XMLNode(_n).positionOfClear(i);
}
-static XML_ELEMENT_POS xmlapiPositionOfChildByIndex(HXML _n, int i)
+MIR_APP_DLL(XML_ELEMENT_POS) xmlPositionOfChildByIndex(HXML _n, int i)
{
return (XML_ELEMENT_POS)XMLNode(_n).positionOfChildNode(i);
}
-static XML_ELEMENT_POS xmlapiPositionOfChildByNode(HXML _n, HXML child)
+MIR_APP_DLL(XML_ELEMENT_POS) xmlPositionOfChildByNode(HXML _n, HXML child)
{
return (XML_ELEMENT_POS)XMLNode(_n).positionOfChildNode(child);
}
-static XML_ELEMENT_POS xmlapiPositionOfChildByName(HXML _n, LPCTSTR name, int i)
+MIR_APP_DLL(XML_ELEMENT_POS) xmlPositionOfChildByName(HXML _n, LPCTSTR name, int i)
{
return (XML_ELEMENT_POS)XMLNode(_n).positionOfChildNode(name, i);
}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-static INT_PTR GetXmlApi(WPARAM, LPARAM lParam)
-{
- XML_API* xi = (XML_API*)lParam;
- if (xi == NULL)
- return FALSE;
-
- if (xi->cbSize != XML_API_SIZEOF_V1 && xi->cbSize != sizeof(XML_API))
- return FALSE;
-
- xi->createNode = xmlapiCreateNode;
- xi->destroyNode = xmlapiDestroyNode;
-
- xi->parseString = xmlapiParseString;
- xi->toString = xmlapiToString;
- xi->freeMem = xmlapiFree;
- xi->parseFile = xmlapiParseFile;
- xi->toFile = xmlapiToFile;
-
- xi->addChild = xmlapiAddChild;
- xi->addChild2 = xmlapiAddChild2;
- xi->copyNode = xmlapiCopyNode;
- xi->getChild = xmlapiGetChild;
- xi->getChildByAttrValue = xmlapiGetChildByAttrValue;
- xi->getChildCount = xmlapiGetChildCount;
- xi->getFirstChild = xmlapiGetFirstChild;
- xi->getNthChild = xmlapiGetNthChild;
- xi->getNextChild = xmlapiGetNextChild;
- xi->getNextNode = xmlapiGetNextNode;
- xi->getChildByPath = xmlapiGetChildByPath;
- xi->getName = xmlapiGetName;
- xi->getParent = xmlapiGetParent;
- xi->getText = xmlapiGetText;
- xi->setText = xmlapiSetText;
-
- xi->getAttr = xmlapiGetAttr;
- xi->getAttrCount = xmlapiGetAttrCount;
- xi->getAttrName = xmlapiGetAttrName;
- xi->getAttrValue = xmlapiGetAttrValue;
- xi->addAttr = xmlapiAddAttr;
- xi->addAttrInt = xmlapiAddAttrInt;
-
- if (xi->cbSize > XML_API_SIZEOF_V1) {
- xi->isDeclaration = xmlapiIsDeclaration;
- xi->toStringWithFormatting = xmlapiToStringWithFormatting;
- xi->deepCopy = xmlapiDeepCopy;
- xi->setAttrByIndex = xmlapiSetAttrByIndex;
- xi->setAttrByName = xmlapiSetAttrByName;
- xi->addChildEx = xmlapiAddChildEx;
- xi->addChildEx2 = xmlapiAddChildEx2;
- xi->getTextCount = xmlapiGetTextCount;
- xi->getTextByIndex = xmlapiGetTextByIndex;
- xi->addText = xmlapiAddText;
- xi->setTextByIndex = xmlapiSetTextByIndex;
- xi->getClearCount = xmlapiGetClearCount;
- xi->getClear = xmlapiGetClear;
- xi->addClear = xmlapiAddClear;
- xi->setClear = xmlapiSetClear;
- xi->getElementCount = xmlapiGetElementCount;
- xi->getElement = xmlapiGetElement;
-
- xi->deleteNodeContent = xmlapiDeleteNodeContent;
- xi->deleteAttrByIndex = xmlapiDeleteAttrByIndex;
- xi->deleteAttrByName = xmlapiDeleteAttrByName;
- xi->deleteText = xmlapiDeleteText;
- xi->deleteClear = xmlapiDeleteClear;
-
- xi->positionOfChildByIndex = xmlapiPositionOfChildByIndex;
- xi->positionOfChildByNode = xmlapiPositionOfChildByNode;
- xi->positionOfChildByName = xmlapiPositionOfChildByName;
- xi->positionOfText = xmlapiPositionOfText;
- xi->positionOfClear = xmlapiPositionOfClear;
- }
- return TRUE;
-}
-
-void InitXmlApi(void)
-{
- CreateServiceFunction(MS_SYSTEM_GET_XI, GetXmlApi);
-}