diff options
author | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2010-02-21 23:00:56 +0000 |
---|---|---|
committer | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2010-02-21 23:00:56 +0000 |
commit | 8f5a7b54eb953bbfc877ec915e26b3a95ec28d00 (patch) | |
tree | 827e40ab3528e10afd6fcb44f7ed5db0d7eed519 /updater/common.h | |
parent | b130e8caa16961f597ae4ac6984a6aa00de7b6c7 (diff) |
New updater with 3x reduced footprint and fully W7 and x64 compatible
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@476 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'updater/common.h')
-rw-r--r-- | updater/common.h | 129 |
1 files changed, 33 insertions, 96 deletions
diff --git a/updater/common.h b/updater/common.h index 545f957..d454179 100644 --- a/updater/common.h +++ b/updater/common.h @@ -3,47 +3,36 @@ #define _CRT_SECURE_NO_DEPRECATE
-#define _WIN32_WINNT 0x0400
-#define WINVER 0x0400
-#define _WIN32_IE 0x0400
+#define MIRANDA_VER 0x0800
-#ifdef _UNICODE
-//#define _GLIBCXX_USE_WCHAR_T 1
-//#define _GLIBCXX_USE_WSTRING 1
-#endif
-
-// uses mim 0.6 options pages if available
-#define MIRANDA_VER 0x0600
+#include <m_stdhdr.h>
#include <windows.h>
+#include <shlobj.h>
#include <commctrl.h>
-#include "tinyxml.h"
-#ifdef _MSC_VER
-#pragma warning( disable : 4786 )
-#endif
-
#include <process.h>
-#include <shlobj.h>
#include <stdio.h>
+#include "ezxml.h"
+
#include <newpluginapi.h>
#include <m_database.h>
#include <m_langpack.h>
#include <m_options.h>
#include <m_system.h>
+#include <m_system_cpp.h>
#include <m_idle.h>
#include <m_clui.h>
#include <m_netlib.h>
#include <m_utils.h>
#include <m_clist.h>
#include <m_icoLib.h>
-//#include "../mwclist/m_clist.h"
-//#include <m_genmenu.h>
-#include "m_updater.h"
-#include "m_trigger.h"
+#include <win2k.h>
+#include "m_updater.h"
+#include "m_trigger.h"
#include "m_folders.h"
//#define TESTING // causes version to be 0.0.0.1
@@ -77,84 +66,35 @@ typedef struct UpdateInternal_tag { char *shortName;
} UpdateInternal;
-class UpdateList {
-public:
- UpdateList();
- virtual ~UpdateList();
- UpdateList(UpdateList &source);
-
- int size();
-
- void push_back(UpdateInternal &update);
-
- UpdateInternal &back();
-
- void clear();
- void reset();
- void next();
- UpdateInternal *current();
- void erase();
-
-protected:
- class Node {
- public:
- Node(): next(0), prev(0) {}
- UpdateInternal ui;
- Node *next, *prev;
- };
-
- int count;
- Node *head, *tail, *it_current;
+struct UpdateList : OBJLIST<UpdateInternal>
+{
+ UpdateList() : OBJLIST<UpdateInternal>(10) {}
+ UpdateList(const UpdateList& upd) : OBJLIST<UpdateInternal>(10)
+ {
+ for (int i=0; i<upd.getCount(); ++i)
+ insert(new UpdateInternal(upd[i]));
+ }
};
-class StringList {
-public:
- StringList(): head(0), count(0) {}
- virtual ~StringList() {clear();}
-
- int size() {return count;}
-
- void push_back(TCHAR *str) { Node *n = new Node; n->next = head; head = n; n->val = _tcsdup(str); }
-
- void clear() {
- Node *current;
- while(head) {
- current = head;
- head = head->next;
- free(current->val);
- delete current;
- }
- count = 0;
- reset();
- }
- void reset() {it_current = head;}
- void next() {if(it_current) it_current = it_current->next;}
- TCHAR *current() {return (it_current ? it_current->val : 0);}
-
-protected:
- class Node {
- public:
- Node(): next(0) {}
- TCHAR *val;
- Node *next;
- };
-
- Node *head, *it_current;
- int count;
+struct StrList : LIST<TCHAR>
+{
+ StrList() : LIST<TCHAR>(5) {}
+ ~StrList()
+ {
+ for (int i=0; i<getCount(); ++i) mir_free(getArray()[i]);
+ destroy();
+ }
};
-#include <map>
-#include <list>
-#include <string>
+struct FileNameStruct
+{
+ int file_id;
+ StrList list;
-#ifdef _UNICODE
-typedef std::wstring STDString;
-#else
-typedef std::string STDString;
-#endif
+ FileNameStruct(int id) : file_id(id) {}
+};
-typedef std::list< STDString > STDStringList;
-typedef std::map<int, STDStringList > FilenameMap;
+typedef OBJLIST<FileNameStruct> FilenameMap;
#include "resource.h"
@@ -166,10 +106,7 @@ extern PLUGININFOEX pluginInfo; extern bool is_idle;
-extern HANDLE hNetlibUser;
-
-extern HANDLE mainThread;
-extern DWORD mainThreadId;
+extern HANDLE hNetlibUser, hNetlibHttp;
static int __inline NLog(char *msg) {
return CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, (LPARAM)msg);
|