summaryrefslogtreecommitdiff
path: root/plugins/PasteIt/src
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 /plugins/PasteIt/src
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
Diffstat (limited to 'plugins/PasteIt/src')
-rw-r--r--plugins/PasteIt/src/PasteIt.cpp2
-rw-r--r--plugins/PasteIt/src/PasteToWeb2.cpp32
2 files changed, 16 insertions, 18 deletions
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);
}