summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNvinside <Nvinside@eced67a3-f377-a0ae-92ae-d6de1850b05a>2010-10-01 23:41:36 +0000
committerNvinside <Nvinside@eced67a3-f377-a0ae-92ae-d6de1850b05a>2010-10-01 23:41:36 +0000
commite90edbc3b9bd39c8820c02e4951d29ad52951f86 (patch)
tree4d869f3fcfab2720ffa5a602dc74fe2a6b50c3cb
parentc5a491f9b23b5d6c573cdcea0743ba99f7251a0f (diff)
+ include update
git-svn-id: http://mirotr.googlecode.com/svn/trunk@40 eced67a3-f377-a0ae-92ae-d6de1850b05a
-rw-r--r--miranda/include/m_database.h8
-rw-r--r--miranda/include/m_system.h7
-rw-r--r--miranda/include/m_system_cpp.h13
-rw-r--r--miranda/include/m_utils.h29
-rw-r--r--otr.vs/building.txt70
5 files changed, 54 insertions, 73 deletions
diff --git a/miranda/include/m_database.h b/miranda/include/m_database.h
index e3a6ef8..af5feb7 100644
--- a/miranda/include/m_database.h
+++ b/miranda/include/m_database.h
@@ -132,8 +132,10 @@ Returns 0 on success or nonzero otherwise
#define MS_DB_GETPROFILENAMEW "DB/GetProfileNameW"
/* DB/Contact/GetProfilePath service
-Gets the path of the profile currently being used by the database module. This
-path does not include the last '\'.
+Get the path of the base folder where Miranda will store all individual profiles
+The returned path does NOT include a trailing backslash.
+Essentially this is what has been set in mirandaboot.ini as ProfileDir.
+For more options to retrieve profile paths check MS_UTILS_REPLACEVARS
wParam=(WPARAM)(UINT)cbName
lParam=(LPARAM)(char*)pszName
pszName is a pointer to the buffer that receives the path of the profile
@@ -554,7 +556,7 @@ Caller must free the result using mir_free
#define MS_DB_EVENT_GETSTRINGT "DB/Event/GetStringT"
__inline static TCHAR* DbGetEventStringT( DBEVENTINFO* dbei, const char* str )
-{
+{
return (TCHAR*)CallService( MS_DB_EVENT_GETSTRINGT, (WPARAM)dbei, (LPARAM)str );
}
diff --git a/miranda/include/m_system.h b/miranda/include/m_system.h
index 93cdddf..75f8212 100644
--- a/miranda/include/m_system.h
+++ b/miranda/include/m_system.h
@@ -228,6 +228,13 @@ wParam=0, lParam = (LPARAM)LIST_INTERFACE*
typedef int ( *FSortFunc )( void*, void* );
+// Assumes first 32 bit value of the data is the numeric key
+// and uses it to perform sort/search operations, this results
+// in much better performance as no compare function calls needed
+// Incredibly useful for Hash Tables
+#define NumericKeySort (FSortFunc)(void*) -1
+#define HandleKeySort (FSortFunc)(void*) -2
+
typedef struct
{
void** items;
diff --git a/miranda/include/m_system_cpp.h b/miranda/include/m_system_cpp.h
index c3d8650..5e1a406 100644
--- a/miranda/include/m_system_cpp.h
+++ b/miranda/include/m_system_cpp.h
@@ -28,6 +28,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#if defined( __cplusplus ) && MIRANDA_VER >= 0x0600
extern LIST_INTERFACE li;
+#define NumericKeySortT -1
+#define HandleKeySortT -2
+
template<class T> struct LIST
{
typedef int ( *FTSortFunc )( const T* p1, const T* p2 );
@@ -38,6 +41,12 @@ template<class T> struct LIST
sortFunc = afunc;
}
+ __inline LIST( int aincr, INT_PTR id )
+ { memset( this, 0, sizeof( *this ));
+ increment = aincr;
+ sortFunc = FTSortFunc( id );
+ }
+
__inline T* operator[]( int idx ) const { return ( idx >= 0 && idx < count ) ? items[idx] : NULL; }
__inline int getCount( void ) const { return count; }
__inline T** getArray( void ) const { return items; }
@@ -98,6 +107,10 @@ template<class T> struct OBJLIST : public LIST<T>
LIST<T>( aincr, afunc )
{}
+ __inline OBJLIST( int aincr, INT_PTR id ) :
+ LIST<T>( aincr, ( FTSortFunc ) id )
+ {}
+
__inline OBJLIST( const OBJLIST& x ) :
LIST<T>( x.increment, x.sortFunc )
{ items = NULL;
diff --git a/miranda/include/m_utils.h b/miranda/include/m_utils.h
index 587af95..167708d 100644
--- a/miranda/include/m_utils.h
+++ b/miranda/include/m_utils.h
@@ -325,6 +325,35 @@ __inline static INT_PTR Utils_AssertInsideScreen(RECT *rc) {
//wParam=(char*/TCHAR*/WCHAR*)string (depends on RVF_UNICODE/RVF_TCHAR flag)
//lParam=(REPLACEVARSDATA *) data about variables, item with key=0 terminates the list
//returns new string, use mir_free to destroy
+
+// variables known by the core:
+// ----------------------------
+// %miranda_profile% -> same as MS_DB_GETPROFILEPATH, base folder for all profiles
+// %miranda_userdata% -> the active profile folder (home of the .dat file and all
+// profile data)
+// %miranda_path% -> home path of the miranda installation (installation path
+// of miranda32/64.exe
+// %miranda_profilename% -> Name of the profile in use. Essentially, the name of the
+// .dat file without file name extension. Also: the folder name
+// relative to %miranda_profile% where all profile data is stored.
+// %miranda_logpath% -> base folder for log files. This is \Logs relative to the
+// current profile folder.
+// %miranda_avatarcache% -> base folder for all protocol avatars. internal use only.
+//
+// the following variables operate on contacts. REPLACEVARSDATA::hContact must be
+// supplied by the caller.
+//
+// %nick% -> a contact nick name.
+// %proto% -> internal protocol name for a given contact. NOT the user-
+// defined account name.
+// %userid% -> Unique ID for a given contact (UIN, JID etc.)
+
+// the following variables are system variables - unrelated to miranda profiles.
+
+// %appdata% -> same as %APPDATA% environment variable.
+// %destkop% -> location of the desktop folder in a user's profile.
+// %mydocuments% -> location of the "My Documents" shell folder.
+
typedef struct
{
union
diff --git a/otr.vs/building.txt b/otr.vs/building.txt
deleted file mode 100644
index de8ae79..0000000
--- a/otr.vs/building.txt
+++ /dev/null
@@ -1,70 +0,0 @@
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-gpgvs
-building gnupg related projects with Visual Studio
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-sub-project: otr.vs
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-DIRECTORY TREE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-First step is to have the same directory tree as me, otherwise you have to
-(can) change the paths inside visual studio workspaces.
-This is the tree I have choosen
-
-[anywhere]\libotr-2.0.2
-[anywhere]\libotr-2.0.2\libotr\[original package]
-
-[anywhere]\otrproxy-0.3.0
-[anywhere]\otrproxy-0.3.0\otrproxy\[original package]
-
-[anywhere]\wxWidgets-2.6.1
-[anywhere]\wxWidgets-2.6.1\wxWidgets\[original package]
-
-basically you have to choose you "root" directory, after then you must
-respect this order:
-- "root"\projectWithVersion\project
-
-if you take code from cvs, create the directory "project.head" and
-make cvs checkout inside "project.head", to have (example)
-"root"\libotr.head\libotr\...
-
-Then download or take from cvs the otr.vs project, and put inside
-"root"\otr.vs
-you should have
-
-"root"\otr.vs
-"root"\otr.vs\inc.vs
-"root"\otr.vs\libotr.head.vs
-"root"\otr.vs\libotr-2.0.2.vs
-"root"\otr.vs\otrproxy-0.3.0.vs
-"root"\otr.vs\otrproxy.head.vs
-
-
-LIBGCRYPT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-To build otr projects you need libgcrypt:
-first of all you have to define one environment variable
-- LIBGCRYPTDEV
-which points to a directory with libgcrypt include and lib:
-inside you should put the various libgcrypt versions (or the
-same everywhere, be careful when doing this).
-that's beacause I do not want to force anyone to use the libgcrypt
-provided with gpg.vs project: in this way you can download or compile
-your own versions of libgcrypt and use it with otr projects
-
-The "LIBGCRYPT" directory must have inside
-%LIBGCRYPTDEV%\inc
-%LIBGCRYPTDEV%\lib\debug\dll
-%LIBGCRYPTDEV%\lib\debug\static
-%LIBGCRYPTDEV%\lib\release\dll
-%LIBGCRYPTDEV%\lib\release\static
-
-because workspaces will search libgcrypt includes and libs using
-such paths.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Authors:
- Francesco Picasso
- mr.s0rr0w@gmail.com
- www.s0rr0w.net
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \ No newline at end of file