From ad5e273a04e89a45d41c87a6a21c6d6fd937ac43 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 1 Aug 2015 20:28:18 +0000 Subject: Variables: common project git-svn-id: http://svn.miranda-ng.org/main/trunk@14796 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Variables/src/contact.cpp | 2 +- plugins/Variables/src/enumprocs.cpp | 2 +- plugins/Variables/src/help.cpp | 2 +- plugins/Variables/src/lookup3.cpp | 2 +- plugins/Variables/src/main.cpp | 2 +- plugins/Variables/src/options.cpp | 2 +- plugins/Variables/src/parse_alias.cpp | 2 +- plugins/Variables/src/parse_external.cpp | 2 +- plugins/Variables/src/parse_inet.cpp | 2 +- plugins/Variables/src/parse_logic.cpp | 2 +- plugins/Variables/src/parse_math.cpp | 2 +- plugins/Variables/src/parse_metacontacts.cpp | 2 +- plugins/Variables/src/parse_miranda.cpp | 2 +- plugins/Variables/src/parse_regexp.cpp | 2 +- plugins/Variables/src/parse_str.cpp | 2 +- plugins/Variables/src/parse_system.cpp | 2 +- plugins/Variables/src/parse_variables.cpp | 2 +- plugins/Variables/src/stdafx.cpp | 18 --- plugins/Variables/src/stdafx.cxx | 18 +++ plugins/Variables/src/stdafx.h | 212 ++++++++++++++++++++++++++ plugins/Variables/src/tokenregister.cpp | 2 +- plugins/Variables/src/variables.cpp | 2 +- plugins/Variables/src/variables.h | 213 --------------------------- 23 files changed, 249 insertions(+), 250 deletions(-) delete mode 100644 plugins/Variables/src/stdafx.cpp create mode 100644 plugins/Variables/src/stdafx.cxx create mode 100644 plugins/Variables/src/stdafx.h delete mode 100644 plugins/Variables/src/variables.h (limited to 'plugins/Variables/src') diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index f295c0cea0..f110ab27d9 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "variables.h" +#include "stdafx.h" struct _tagType { diff --git a/plugins/Variables/src/enumprocs.cpp b/plugins/Variables/src/enumprocs.cpp index e35accfd0e..71ecd780ac 100644 --- a/plugins/Variables/src/enumprocs.cpp +++ b/plugins/Variables/src/enumprocs.cpp @@ -21,7 +21,7 @@ // EnumProc.c // -#include "variables.h" +#include "stdafx.h" typedef struct { DWORD dwPID; diff --git a/plugins/Variables/src/help.cpp b/plugins/Variables/src/help.cpp index b17d9ddbd9..2077353901 100644 --- a/plugins/Variables/src/help.cpp +++ b/plugins/Variables/src/help.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "variables.h" +#include "stdafx.h" struct HELPDLGDATA { diff --git a/plugins/Variables/src/lookup3.cpp b/plugins/Variables/src/lookup3.cpp index b75c9bbe0c..7f28ed0498 100644 --- a/plugins/Variables/src/lookup3.cpp +++ b/plugins/Variables/src/lookup3.cpp @@ -25,7 +25,7 @@ a mix of things, see the comments above hashlittle(). */ //#define SELF_TEST 1 -#include "variables.h" +#include "stdafx.h" typedef unsigned long int uint32; /* unsigned 4-byte quantities */ typedef unsigned short int uint16; /* unsigned 2-byte quantities */ diff --git a/plugins/Variables/src/main.cpp b/plugins/Variables/src/main.cpp index 449dc65cde..2a561a9b8c 100644 --- a/plugins/Variables/src/main.cpp +++ b/plugins/Variables/src/main.cpp @@ -16,7 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "variables.h" +#include "stdafx.h" CLIST_INTERFACE *pcli; HINSTANCE hInst; diff --git a/plugins/Variables/src/options.cpp b/plugins/Variables/src/options.cpp index fa37d39af6..bb381ef238 100644 --- a/plugins/Variables/src/options.cpp +++ b/plugins/Variables/src/options.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "variables.h" +#include "stdafx.h" static INT_PTR CALLBACK SetOptsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) { diff --git a/plugins/Variables/src/parse_alias.cpp b/plugins/Variables/src/parse_alias.cpp index 895fb9d50b..c3c3b38282 100644 --- a/plugins/Variables/src/parse_alias.cpp +++ b/plugins/Variables/src/parse_alias.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "variables.h" +#include "stdafx.h" struct ALIASREGISTER { diff --git a/plugins/Variables/src/parse_external.cpp b/plugins/Variables/src/parse_external.cpp index 0580dec0d6..19a0a6de61 100644 --- a/plugins/Variables/src/parse_external.cpp +++ b/plugins/Variables/src/parse_external.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "variables.h" +#include "stdafx.h" static TCHAR *getFullWinampTitleText() { diff --git a/plugins/Variables/src/parse_inet.cpp b/plugins/Variables/src/parse_inet.cpp index 881128d753..ff3e07c943 100644 --- a/plugins/Variables/src/parse_inet.cpp +++ b/plugins/Variables/src/parse_inet.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "variables.h" +#include "stdafx.h" static TCHAR *parseUrlEnc(ARGUMENTSINFO *ai) { diff --git a/plugins/Variables/src/parse_logic.cpp b/plugins/Variables/src/parse_logic.cpp index ee352cfbfa..08bdfa9c6c 100644 --- a/plugins/Variables/src/parse_logic.cpp +++ b/plugins/Variables/src/parse_logic.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "variables.h" +#include "stdafx.h" static TCHAR *parseAnd(ARGUMENTSINFO *ai) { diff --git a/plugins/Variables/src/parse_math.cpp b/plugins/Variables/src/parse_math.cpp index cfda45bd70..ee7490686a 100644 --- a/plugins/Variables/src/parse_math.cpp +++ b/plugins/Variables/src/parse_math.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "variables.h" +#include "stdafx.h" static TCHAR *parseAdd(ARGUMENTSINFO *ai) { diff --git a/plugins/Variables/src/parse_metacontacts.cpp b/plugins/Variables/src/parse_metacontacts.cpp index 06e26ce5ea..f8a965b81c 100644 --- a/plugins/Variables/src/parse_metacontacts.cpp +++ b/plugins/Variables/src/parse_metacontacts.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "variables.h" +#include "stdafx.h" static TCHAR *parseGetParent(ARGUMENTSINFO *ai) { diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index efbd3f5d86..1877bfcf3f 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "variables.h" +#include "stdafx.h" static TCHAR* parseCodeToStatus(ARGUMENTSINFO *ai) { diff --git a/plugins/Variables/src/parse_regexp.cpp b/plugins/Variables/src/parse_regexp.cpp index 5a337ae54e..fb5366329b 100644 --- a/plugins/Variables/src/parse_regexp.cpp +++ b/plugins/Variables/src/parse_regexp.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "variables.h" +#include "stdafx.h" /* pattern, subject diff --git a/plugins/Variables/src/parse_str.cpp b/plugins/Variables/src/parse_str.cpp index f0f3d68822..27e6d324f1 100644 --- a/plugins/Variables/src/parse_str.cpp +++ b/plugins/Variables/src/parse_str.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "variables.h" +#include "stdafx.h" static TCHAR *parseCaps(ARGUMENTSINFO *ai) { diff --git a/plugins/Variables/src/parse_system.cpp b/plugins/Variables/src/parse_system.cpp index 34f3c90871..4414a8b860 100644 --- a/plugins/Variables/src/parse_system.cpp +++ b/plugins/Variables/src/parse_system.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "variables.h" +#include "stdafx.h" static TCHAR *parseComputerName(ARGUMENTSINFO *ai) { diff --git a/plugins/Variables/src/parse_variables.cpp b/plugins/Variables/src/parse_variables.cpp index dc7f95552e..d15e108817 100644 --- a/plugins/Variables/src/parse_variables.cpp +++ b/plugins/Variables/src/parse_variables.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "variables.h" +#include "stdafx.h" // this is for get and put(s) static mir_cs csVarRegister; diff --git a/plugins/Variables/src/stdafx.cpp b/plugins/Variables/src/stdafx.cpp deleted file mode 100644 index 53bca828f9..0000000000 --- a/plugins/Variables/src/stdafx.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright (C) 2012-15 Miranda NG project (http://miranda-ng.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation version 2 -of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "variables.h" \ No newline at end of file diff --git a/plugins/Variables/src/stdafx.cxx b/plugins/Variables/src/stdafx.cxx new file mode 100644 index 0000000000..6fb37564b7 --- /dev/null +++ b/plugins/Variables/src/stdafx.cxx @@ -0,0 +1,18 @@ +/* +Copyright (C) 2012-15 Miranda NG project (http://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "stdafx.h" \ No newline at end of file diff --git a/plugins/Variables/src/stdafx.h b/plugins/Variables/src/stdafx.h new file mode 100644 index 0000000000..7948708b2d --- /dev/null +++ b/plugins/Variables/src/stdafx.h @@ -0,0 +1,212 @@ +/* + Variables Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define _CRT_NON_CONFORMING_SWPRINTFS + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "..\helpers\gen_helpers.h" + +#include "..\..\libs\pcre16\src\pcre.h" + +#include "resource.h" +#include "version.h" +#include "contact.h" +#include "enumprocs.h" +#include "parse_alias.h" +#include "parse_external.h" +#include "parse_inet.h" +#include "parse_logic.h" +#include "parse_math.h" +#include "parse_metacontacts.h" +#include "parse_miranda.h" +#include "parse_regexp.h" +#include "parse_str.h" +#include "parse_system.h" +#include "parse_variables.h" + +#define MODULENAME "Variables" + +#define SETTING_STARTUPTEXT "StartupText" +#define SETTING_STRIPCRLF "StripCRLF" +#define SETTING_STRIPWS "StripWS" +#define SETTING_STRIPALL "StripAll" +#define SETTING_PARSEATSTARTUP "ParseAtStartup" +#define SETTING_SPLITTERPOS "SplitterPos" +#define SETTING_SUBJECT "LastSubject" + +#define FIELD_CHAR '%' +#define FUNC_CHAR '?' +#define FUNC_ONCE_CHAR '!' +#define DONTPARSE_CHAR '`' +#define TRYPARSE_CHAR_OPEN '[' +#define TRYPARSE_CHAR_CLOSE ']' +#define COMMENT_STRING "#" + +// special tokens +#define SUBJECT _T("subject") +#define MIR_EXTRATEXT _T("extratext") + +#define VAR_HELP_TEXT LPGENT("--- Special characters ---\r\n\r\n\ +The following characters have a special meaning in a formatting string:\r\n\r\n\ +?()\r\n\ +This will parse the function given the arguments, the result will be parsed again. Example: Today is ?cdate(yyyy/MM/dd).\r\n\r\n\ +!()\r\n\ +This will parse the function given the arguments, the result will not be parsed again. Example: Message waiting: !message(,first,rcvd,unread).\r\n\r\n\ +%%\r\n\ +This will parse the given field. Example: I installed Miranda at: %mirandapath%.\r\n\r\n\ +``\r\n\ +This will not parse the given string, any function, field or special character in the string will shown in the result without being translated. Example: Use `%mirandapath%` to show the installation path.\r\n\r\n\ +#\r\n\ +This will add a comment in the formatting string. Everything from the # character to the end of the line will be removed. Example: %dbprofile% #this is a useless comment.\r\n\r\n\r\n\ +--- Contacts ---\r\n\r\n\ +Whenever a functions requires a contact as an argument, you can specify it in two ways:\r\n\r\n\ +(1) Using a unique ID (UIN for ICQ, email for MSN) or, a protocol ID followed by a unique ID in the form , for example or .\r\n\r\n\ +(2) Using the contact function:\r\n\ +?contact(x,y)\r\n\ +A contact will be searched which will have value x for its property y, y can be one of the following:\r\n\ +first, last, nick, email, ID or display\r\n\r\n\ +For example: ?contact(miranda@hotmail.com,email) or ?contact(Miranda,nick). \ +The contact function will return either a unique contact according to the arguments or nothing if none or multiple contacts exists with the given property.") + +// options +#define IDT_PARSE 1 + +#define DM_SPLITTERMOVED (WM_USER+15) + +// Messages you can send to the help window: +#define VARM_PARSE (WM_APP+11) // wParam=lParam=0 +#define VARM_SETINPUTTEXT (WM_APP+12) +#define VARM_GETINPUTTEXT (WM_APP+13) +#define VARM_GETINPUTTEXTLENGTH (WM_APP+14) +#define VARM_SETSUBJECT (WM_APP+15) +#define VARM_GETSUBJECT (WM_APP+16) // wParam=MCONTACT hContact +#define VARM_SETEXTRATEXT (WM_APP+17) +#define VARM_GETEXTRATEXT (WM_APP+18) +#define VARM_GETEXTRATEXTLENGTH (WM_APP+19) +#define VARM_GETDIALOG (WM_APP+20) + +// if a different struct internally is used, we can use TOKENREGISTEREX +#define TOKENREGISTEREX TOKENREGISTER + +// old struct +typedef struct { + int cbSize; + char *szFormat; + char *szSource; + MCONTACT hContact; + int pCount; // number of succesful parses + int eCount; // number of failures +} FORMATINFOV1; + +struct ParseOptions { + BOOL bStripEOL; + BOOL bStripWS; + BOOL bStripAll; +}; + +extern HINSTANCE hInst; +extern struct ParseOptions gParseOpts; +extern int hLangpack; + +// variables.c +//TCHAR *getArguments(char *string, char ***aargv, int *aargc); +//int isValidTokenChar(char c); +TCHAR *formatString(FORMATINFO *fi); +int setParseOptions(struct ParseOptions *po); +int LoadVarModule(); +int UnloadVarModule(); +// tokenregister.c +int registerIntToken(TCHAR *szToken, TCHAR *(*parseFunction)(ARGUMENTSINFO *ai), int extraFlags, char* szHelpText); +INT_PTR registerToken(WPARAM wParam, LPARAM lParam); +int deRegisterToken(TCHAR *var); +TOKENREGISTEREX *searchRegister(TCHAR *var, int type); +TCHAR *parseFromRegister(ARGUMENTSINFO *ai); +TOKENREGISTEREX *getTokenRegister(int i); +int getTokenRegisterCount(); +TOKENREGISTER *getTokenRegisterByIndex(int i); +void deRegisterTemporaryVariables(); +int initTokenRegister(); +int deinitTokenRegister(); +// contact.c +BYTE getContactInfoType(TCHAR* type); +TCHAR* getContactInfoT(BYTE type, MCONTACT hContact); +int getContactFromString( CONTACTSINFO* ); +int initContactModule(); +int deinitContactModule(); +// alias +void registerAliasTokens(); +void unregisterAliasTokens(); +// system +void registerSystemTokens(); +// external +void registerExternalTokens(); +// miranda +void registerMirandaTokens(); +// str +void registerStrTokens(); +// variables +void registerVariablesTokens(); +void unregisterVariablesTokens(); +// logic +void registerLogicTokens(); +// math +void registerMathTokens(); +// metacontacts +void registerMetaContactsTokens(); +// options +int OptionsInit(WPARAM wParam, LPARAM); +// reg exp +void registerRegExpTokens(); +// inet +void registerInetTokens(); +// help +INT_PTR showHelpService(WPARAM wParam, LPARAM lParam); +INT_PTR showHelpExService(WPARAM wParam, LPARAM lParam); +INT_PTR getSkinItemService(WPARAM wParam, LPARAM lParam); +int iconsChanged(WPARAM wParam, LPARAM lParam); + +int ttoi(TCHAR *string); +TCHAR *itot(int num); diff --git a/plugins/Variables/src/tokenregister.cpp b/plugins/Variables/src/tokenregister.cpp index 7998c6dbb2..3cf79cb4f1 100644 --- a/plugins/Variables/src/tokenregister.cpp +++ b/plugins/Variables/src/tokenregister.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "variables.h" +#include "stdafx.h" struct TokenRegisterEntry { diff --git a/plugins/Variables/src/variables.cpp b/plugins/Variables/src/variables.cpp index 3c5652f6f1..a481702145 100644 --- a/plugins/Variables/src/variables.cpp +++ b/plugins/Variables/src/variables.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "variables.h" +#include "stdafx.h" /* some handles */ static HANDLE diff --git a/plugins/Variables/src/variables.h b/plugins/Variables/src/variables.h deleted file mode 100644 index 49b4bbba01..0000000000 --- a/plugins/Variables/src/variables.h +++ /dev/null @@ -1,213 +0,0 @@ -/* - Variables Plugin for Miranda-IM (www.miranda-im.org) - Copyright 2003-2006 P. Boon - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#define _CRT_NON_CONFORMING_SWPRINTFS -#define _CRT_SECURE_NO_WARNINGS - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "..\helpers\gen_helpers.h" - -#include "..\..\libs\pcre16\src\pcre.h" - -#include "resource.h" -#include "version.h" -#include "contact.h" -#include "enumprocs.h" -#include "parse_alias.h" -#include "parse_external.h" -#include "parse_inet.h" -#include "parse_logic.h" -#include "parse_math.h" -#include "parse_metacontacts.h" -#include "parse_miranda.h" -#include "parse_regexp.h" -#include "parse_str.h" -#include "parse_system.h" -#include "parse_variables.h" - -#define MODULENAME "Variables" - -#define SETTING_STARTUPTEXT "StartupText" -#define SETTING_STRIPCRLF "StripCRLF" -#define SETTING_STRIPWS "StripWS" -#define SETTING_STRIPALL "StripAll" -#define SETTING_PARSEATSTARTUP "ParseAtStartup" -#define SETTING_SPLITTERPOS "SplitterPos" -#define SETTING_SUBJECT "LastSubject" - -#define FIELD_CHAR '%' -#define FUNC_CHAR '?' -#define FUNC_ONCE_CHAR '!' -#define DONTPARSE_CHAR '`' -#define TRYPARSE_CHAR_OPEN '[' -#define TRYPARSE_CHAR_CLOSE ']' -#define COMMENT_STRING "#" - -// special tokens -#define SUBJECT _T("subject") -#define MIR_EXTRATEXT _T("extratext") - -#define VAR_HELP_TEXT LPGENT("--- Special characters ---\r\n\r\n\ -The following characters have a special meaning in a formatting string:\r\n\r\n\ -?()\r\n\ -This will parse the function given the arguments, the result will be parsed again. Example: Today is ?cdate(yyyy/MM/dd).\r\n\r\n\ -!()\r\n\ -This will parse the function given the arguments, the result will not be parsed again. Example: Message waiting: !message(,first,rcvd,unread).\r\n\r\n\ -%%\r\n\ -This will parse the given field. Example: I installed Miranda at: %mirandapath%.\r\n\r\n\ -``\r\n\ -This will not parse the given string, any function, field or special character in the string will shown in the result without being translated. Example: Use `%mirandapath%` to show the installation path.\r\n\r\n\ -#\r\n\ -This will add a comment in the formatting string. Everything from the # character to the end of the line will be removed. Example: %dbprofile% #this is a useless comment.\r\n\r\n\r\n\ ---- Contacts ---\r\n\r\n\ -Whenever a functions requires a contact as an argument, you can specify it in two ways:\r\n\r\n\ -(1) Using a unique ID (UIN for ICQ, email for MSN) or, a protocol ID followed by a unique ID in the form , for example or .\r\n\r\n\ -(2) Using the contact function:\r\n\ -?contact(x,y)\r\n\ -A contact will be searched which will have value x for its property y, y can be one of the following:\r\n\ -first, last, nick, email, ID or display\r\n\r\n\ -For example: ?contact(miranda@hotmail.com,email) or ?contact(Miranda,nick). \ -The contact function will return either a unique contact according to the arguments or nothing if none or multiple contacts exists with the given property.") - -// options -#define IDT_PARSE 1 - -#define DM_SPLITTERMOVED (WM_USER+15) - -// Messages you can send to the help window: -#define VARM_PARSE (WM_APP+11) // wParam=lParam=0 -#define VARM_SETINPUTTEXT (WM_APP+12) -#define VARM_GETINPUTTEXT (WM_APP+13) -#define VARM_GETINPUTTEXTLENGTH (WM_APP+14) -#define VARM_SETSUBJECT (WM_APP+15) -#define VARM_GETSUBJECT (WM_APP+16) // wParam=MCONTACT hContact -#define VARM_SETEXTRATEXT (WM_APP+17) -#define VARM_GETEXTRATEXT (WM_APP+18) -#define VARM_GETEXTRATEXTLENGTH (WM_APP+19) -#define VARM_GETDIALOG (WM_APP+20) - -// if a different struct internally is used, we can use TOKENREGISTEREX -#define TOKENREGISTEREX TOKENREGISTER - -// old struct -typedef struct { - int cbSize; - char *szFormat; - char *szSource; - MCONTACT hContact; - int pCount; // number of succesful parses - int eCount; // number of failures -} FORMATINFOV1; - -struct ParseOptions { - BOOL bStripEOL; - BOOL bStripWS; - BOOL bStripAll; -}; - -extern HINSTANCE hInst; -extern struct ParseOptions gParseOpts; -extern int hLangpack; - -// variables.c -//TCHAR *getArguments(char *string, char ***aargv, int *aargc); -//int isValidTokenChar(char c); -TCHAR *formatString(FORMATINFO *fi); -int setParseOptions(struct ParseOptions *po); -int LoadVarModule(); -int UnloadVarModule(); -// tokenregister.c -int registerIntToken(TCHAR *szToken, TCHAR *(*parseFunction)(ARGUMENTSINFO *ai), int extraFlags, char* szHelpText); -INT_PTR registerToken(WPARAM wParam, LPARAM lParam); -int deRegisterToken(TCHAR *var); -TOKENREGISTEREX *searchRegister(TCHAR *var, int type); -TCHAR *parseFromRegister(ARGUMENTSINFO *ai); -TOKENREGISTEREX *getTokenRegister(int i); -int getTokenRegisterCount(); -TOKENREGISTER *getTokenRegisterByIndex(int i); -void deRegisterTemporaryVariables(); -int initTokenRegister(); -int deinitTokenRegister(); -// contact.c -BYTE getContactInfoType(TCHAR* type); -TCHAR* getContactInfoT(BYTE type, MCONTACT hContact); -int getContactFromString( CONTACTSINFO* ); -int initContactModule(); -int deinitContactModule(); -// alias -void registerAliasTokens(); -void unregisterAliasTokens(); -// system -void registerSystemTokens(); -// external -void registerExternalTokens(); -// miranda -void registerMirandaTokens(); -// str -void registerStrTokens(); -// variables -void registerVariablesTokens(); -void unregisterVariablesTokens(); -// logic -void registerLogicTokens(); -// math -void registerMathTokens(); -// metacontacts -void registerMetaContactsTokens(); -// options -int OptionsInit(WPARAM wParam, LPARAM); -// reg exp -void registerRegExpTokens(); -// inet -void registerInetTokens(); -// help -INT_PTR showHelpService(WPARAM wParam, LPARAM lParam); -INT_PTR showHelpExService(WPARAM wParam, LPARAM lParam); -INT_PTR getSkinItemService(WPARAM wParam, LPARAM lParam); -int iconsChanged(WPARAM wParam, LPARAM lParam); - -int ttoi(TCHAR *string); -TCHAR *itot(int num); -- cgit v1.2.3