From 7fd9fe181150f166a098eaf4e006f878c28cb770 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Mon, 15 Feb 2010 05:51:01 +0300 Subject: sort --- stringlist.h | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 stringlist.h (limited to 'stringlist.h') diff --git a/stringlist.h b/stringlist.h new file mode 100644 index 0000000..ec10883 --- /dev/null +++ b/stringlist.h @@ -0,0 +1,81 @@ +/* + +"Spam Filter"-Plugin for Miranda IM + +Copyright 2003-2006 Heiko Herkenrath + +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 ("SpamFilter-License.txt"); if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef SF_STRINGLIST_H__ +#define SF_STRINGLIST_H__ 1 + + +// -- Structs +typedef struct { + UINT uCount; // protected by csListAccess + WCHAR** papszList; // protected by csListAccess + CRITICAL_SECTION csListAccess; +} STRINGLIST, *LPSTRINGLIST; + +// -- Defines +#define SL_MIN_POS 0 +#define SL_INVALID_POS (-1) + +// -- Prototypes +LPSTRINGLIST SLNewList(void); +void SLFreeList(LPSTRINGLIST psl); +BOOL SLClearList(LPSTRINGLIST psl); +BOOL SLMergeList(LPSTRINGLIST pslDest, LPSTRINGLIST pslFrom); + +int SLGetMaxPos(LPSTRINGLIST psl); +int SLGetSize(LPSTRINGLIST psl, BOOL bAlsoTerminatingZeros); // character count size +int SLGetItemCount(LPSTRINGLIST psl); +WCHAR* SLGetItem(LPSTRINGLIST psl, int iPos); +BOOL SLIsValid(LPSTRINGLIST psl, int iPos); + +BOOL SLMoveItem(LPSTRINGLIST psl, int iOldPos, int iNewPos, BOOL bOnlySwitch); +BOOL SLItemPrintf(LPSTRINGLIST psl, int iPos, int cchArgMaxLen, ...); +BOOL SLSetItemLength(LPSTRINGLIST psl, int iPos, int cchLength); +BOOL SLChangeItem(LPSTRINGLIST psl, int iPos, WCHAR* pszNewStr, BOOL bDoAppend); + +BOOL SLDeleteItem(LPSTRINGLIST psl, int iPos); +BOOL SLDeleteItems(LPSTRINGLIST psl, int iPosFirst, int iPosLast); + +BOOL SLAddItems(LPSTRINGLIST psl, const WCHAR* apszNewItems[], UINT uNewItemsCount); +int SLAddItem(LPSTRINGLIST psl, const WCHAR* pszNewItem); +int SLAddItemPair(LPSTRINGLIST psl, const WCHAR* pszNewItem1, const WCHAR* pszNewItem2); +int SLPrepareItem(LPSTRINGLIST psl, int cchLength); + +BOOL SLIsItem(LPSTRINGLIST psl, const WCHAR* pszItem, BOOL bCaseSensitive); +int SLFindItem(LPSTRINGLIST psl, const WCHAR* pszItem, BOOL bCaseSensitive, int iStartPos); + +WCHAR* SLConvertToString(LPSTRINGLIST psl, const WCHAR* pszSeparator, BOOL bAlsoDoFirst, BOOL bAlsoDoLast, int* piSize); +void SLFreeReturn(void* pszPntr); +BOOL SLConvertToStringBuf(LPSTRINGLIST psl, WCHAR* pszOutput, int cchMaxSize, const WCHAR* pszSeparator, BOOL bAlsoDoFirst, BOOL bAlsoDoLast); +BOOL SLConvertFromString(LPSTRINGLIST psl, const WCHAR* pszString, int cchSize, const WCHAR* pszSeparator, BOOL bIgnoreEmptyItems); + +BOOL SLLoadFromFile(LPSTRINGLIST psl, const WCHAR* pszSearchPath); +BOOL SLSaveToFile(LPSTRINGLIST psl, const WCHAR* pszFileName); +BOOL SLLoadFromIniFile(LPSTRINGLIST psl, const WCHAR* pszSearchPath, const WCHAR* pszSection, const WCHAR* pszSettingPrefix); +BOOL SLSaveToIniFile(LPSTRINGLIST psl, const WCHAR* pszFileName, const WCHAR* pszSection, const WCHAR* pszSettingPrefix); + +BOOL SLRetrieveFromListBoxCtrl(LPSTRINGLIST psl, HWND hwndListBox); +BOOL SLAssignToListBoxCtrl(LPSTRINGLIST psl, HWND hwndListBox); + +BOOL SLBlockList(LPSTRINGLIST psl); +BOOL SLUnBlockList(LPSTRINGLIST psl); + +#endif // SF_STRINGLIST_H__ \ No newline at end of file -- cgit v1.2.3