From 04f4e2acfbc82946ca3def654214c08071a87359 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 20 Jun 2015 13:55:58 +0000 Subject: xml api became a set of functions git-svn-id: http://svn.miranda-ng.org/main/trunk@14288 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PasteIt/src/PasteIt.cpp | 2 -- plugins/PasteIt/src/PasteToWeb2.cpp | 32 ++++++++++++++++---------------- 2 files changed, 16 insertions(+), 18 deletions(-) (limited to 'plugins/PasteIt') 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 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 PasteToWeb2::GetFormats() } } } - xi.destroyNode(hXml); + xmlDestroyNode(hXml); } mir_free(resCont); } -- cgit v1.2.3