summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-17 15:42:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-17 15:42:14 +0000
commitd6964f7bb1c2afc8d67905fa38ac9a3df766b807 (patch)
treec1faf62ec8a37d184fce91df7fc07243ec738f5d /include
parent69f3e7d05fcdab94dc78e52af620d46191fafb37 (diff)
obsolete services extincted
git-svn-id: http://svn.miranda-ng.org/main/trunk@14237 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'include')
-rw-r--r--include/delphi/m_core.inc26
-rw-r--r--include/delphi/m_utils.inc103
-rw-r--r--include/m_core.h31
-rw-r--r--include/m_utils.h89
4 files changed, 103 insertions, 146 deletions
diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc
index f8884d239a..fb3a57e2be 100644
--- a/include/delphi/m_core.inc
+++ b/include/delphi/m_core.inc
@@ -388,32 +388,6 @@ function GetInstByAddress(codePtr:pointer):HINST; stdcall;
///////////////////////////////////////////////////////////////////////////////
-// path utils
-
-procedure CreatePathToFile(wszFilePath:PAnsiChar); stdcall;
- external CoreDLL name 'CreatePathToFile';
-function CreateDirectoryTree(const szDir:PAnsiChar):int; stdcall;
- external CoreDLL name 'CreateDirectoryTree';
-function PathIsAbsolute(const pSrc:PAnsiChar):int; stdcall;
- external CoreDLL name 'PathIsAbsolute';
-function PathToAbsolute(const pSrc:PAnsiChar; pOut:PAnsiChar; base:PAnsiChar=nil):int; stdcall;
- external CoreDLL name 'PathToAbsolute';
-function PathToRelative(const pSrc:PAnsiChar; pOut:PAnsiChar; base:PAnsiChar=nil):int; stdcall;
- external CoreDLL name 'PathToRelative';
-
-procedure CreatePathToFileW(wszFilePath:PWideChar); stdcall;
- external CoreDLL name 'CreatePathToFileW';
-function CreateDirectoryTreeW(const szDir:PWideChar):int; stdcall;
- external CoreDLL name 'CreateDirectoryTreeW';
-function PathIsAbsoluteW(const pSrc:PWideChar):int; stdcall;
- external CoreDLL name 'PathIsAbsoluteW';
-function PathToAbsoluteW(const pSrc:PWideChar; pOut:PWideChar; base:PWideChar=nil):int; stdcall;
- external CoreDLL name 'PathToAbsoluteW';
-function PathToRelativeW(const pSrc:PWideChar; pOut:PWideChar; base:PWideChar=nil):int; stdcall;
- external CoreDLL name 'PathToRelativeW';
-
-
-///////////////////////////////////////////////////////////////////////////////
// print functions
function mir_snprintf(buffer:PAnsiChar;count:size_t;fmt:PAnsiChar{, ...}):int; stdcall;
diff --git a/include/delphi/m_utils.inc b/include/delphi/m_utils.inc
index d241a91aa3..dea6497f48 100644
--- a/include/delphi/m_utils.inc
+++ b/include/delphi/m_utils.inc
@@ -74,13 +74,6 @@ type
ISOcode: array [0..2] of AnsiChar;
end;
- PWINDOWLISTENTRY = ^TWINDOWLISTENTRY;
- TWINDOWLISTENTRY = record
- hList : THANDLE;
- hWnd : HWND;
- hContact: TMCONTACT;
- end;
-
PSAVEWINDOWPOS = ^TSAVEWINDOWPOS;
TSAVEWINDOWPOS = record
hWnd : HWND;
@@ -274,59 +267,61 @@ const
MS_UTILS_LOADBITMAP :PAnsiChar = 'Utils/LoadBitmap';
MS_UTILS_LOADBITMAPW:PAnsiChar = 'Utils/LoadBitmapW';
- {
- wParam : byte length of buffer (not to be confused with byte range)
- lParam : Pointer to buffer
- Affect : Get the filter strings for use in the open file dialog, see notes
- Returns: 0 on success [non zero] on failure
- Notes : See the WINAPI under OPENFILENAME.lpStrFiler for formatting,
- an 'All bitmaps' item is alway first, and 'All files' is always last
- -
- The returned string is always formatted
- -
- To build this filter, the filter string consists of
- filter followed by a descriptive text
- followed by more filters and their descriptive texts -- end with double NULL(0)
- e.g. *.bmp' #0 'All bitmaps' #0 '*.*' #0 'All Files' #0 #0
- }
- MS_UTILS_GETBITMAPFILTERSTRINGS :PAnsiChar = 'Utils/GetBitmapFilterStrings';
- MS_UTILS_GETBITMAPFILTERSTRINGSW:PAnsiChar = 'Utils/GetBitmapFilterStringsW';
- {
- wParam : pszPath
- lParam : pszNewPath
- Affect : Saves a path to a relative path (from the miranda directory)
- Only saves as a relative path if the file is in the miranda
- directory (or sub directory)
- Notes : pszPath is the path to convert and pszNewPath is the buffer that
- the new path is copied too. pszNewPath MUST be of the size MAX_PATH.
- Returns: numbers of chars copied.
- }
- MS_UTILS_PATHTORELATIVE :PAnsiChar = 'Utils/PathToRelative';
-//Unicode versions (0.6.2+)
- MS_UTILS_PATHTORELATIVEW:PAnsiChar = 'Utils/PathToRelativeW';
+{
+ Affect : Saves a path to a relative path (from the miranda directory)
+ Only saves as a relative path if the file is in the miranda
+ directory (or sub directory)
+ Notes : pszPath is the path to convert and pszNewPath is the buffer that
+ the new path is copied too. pszNewPath MUST be of the size MAX_PATH.
+ Returns: numbers of chars copied.
+}
- {
- Affect : Saves a path to a absolute path (from the miranda directory)
- wParam : pszPath
- lParam : pszNewPath
- Notes : pszPath is the path to convert and pszNewPath is the buffer that
- the new path is copied too. pszNewPath MUST be of the size MAX_PATH.
- Returns: numbers of chars copied.
- }
- MS_UTILS_PATHTOABSOLUTE :PAnsiChar = 'Utils/PathToAbsolute';
-//Unicode versions (0.6.2+)
- MS_UTILS_PATHTOABSOLUTEW:PAnsiChar = 'Utils/PathToAbsoluteW';
+function PathToRelative(const pSrc:PAnsiChar; pOut:PAnsiChar; base:PAnsiChar=nil):int; stdcall;
+ external CoreDLL name 'PathToRelative';
+function PathToRelativeW(const pSrc:PWideChar; pOut:PWideChar; base:PWideChar=nil):int; stdcall;
+ external CoreDLL name 'PathToRelativeW';
+
+{
+ Affect : Saves a path to a absolute path (from the miranda directory)
+ Notes : pszPath is the path to convert and pszNewPath is the buffer that
+ the new path is copied too. pszNewPath MUST be of the size MAX_PATH.
+ Returns: numbers of chars copied.
+}
+
+function PathToAbsolute(const pSrc:PAnsiChar; pOut:PAnsiChar; base:PAnsiChar=nil):int; stdcall;
+ external CoreDLL name 'PathToAbsolute';
+function PathToAbsoluteW(const pSrc:PWideChar; pOut:PWideChar; base:PWideChar=nil):int; stdcall;
+ external CoreDLL name 'PathToAbsoluteW';
{
Creates a directory tree (even more than one directories levels are missing) 0.7.0+
- wParam=0 (unused)
- lParam=pszPath - directory to be created
Returns 0 on success error code otherwise
- Unicode version is available since 0.7.0
}
- MS_UTILS_CREATEDIRTREE :PAnsiChar = 'Utils/CreateDirTree';
- MS_UTILS_CREATEDIRTREEW:PAnsiChar = 'Utils/CreateDirTreeW';
+
+function CreateDirectoryTree(const szDir:PAnsiChar):int; stdcall;
+ external CoreDLL name 'CreateDirectoryTree';
+function CreateDirectoryTreeW(const szDir:PWideChar):int; stdcall;
+ external CoreDLL name 'CreateDirectoryTreeW';
+
+{
+ Creates all subdirectories required to create a file with the file name given
+ Returns 0 on success or an error code otherwise
+}
+
+procedure CreatePathToFile(wszFilePath:PAnsiChar); stdcall;
+ external CoreDLL name 'CreatePathToFile';
+procedure CreatePathToFileW(wszFilePath:PWideChar); stdcall;
+ external CoreDLL name 'CreatePathToFileW';
+{
+ Checks if a file name is absolute or not
+ returns TRUE if yes or FALSE if not
+}
+
+function PathIsAbsolute(const pSrc:PAnsiChar):int; stdcall;
+ external CoreDLL name 'PathIsAbsolute';
+function PathIsAbsoluteW(const pSrc:PWideChar):int; stdcall;
+ external CoreDLL name 'PathIsAbsoluteW';
{
Generates Random number of any length
@@ -334,6 +329,8 @@ const
lParam=(LPARAM)(char*)pszArray - pointer to array to fill with random number
Always returns 0
}
+
+const
MS_UTILS_GETRANDOM:PAnsiChar = 'Utils/GetRandom';
//Replace variables in text
diff --git a/include/m_core.h b/include/m_core.h
index b39b0fd703..5133ecbd6f 100644
--- a/include/m_core.h
+++ b/include/m_core.h
@@ -330,37 +330,6 @@ MIR_CORE_DLL(void) UnregisterModule(HINSTANCE hInst);
MIR_CORE_DLL(HINSTANCE) GetInstByAddress(void* codePtr);
///////////////////////////////////////////////////////////////////////////////
-// path utils
-
-MIR_CORE_DLL(void) CreatePathToFile(char* wszFilePath);
-MIR_CORE_DLL(int) CreateDirectoryTree(const char* szDir);
-MIR_CORE_DLL(int) PathIsAbsolute(const char *pSrc);
-
-MIR_CORE_DLL(void) CreatePathToFileW(wchar_t* wszFilePath);
-MIR_CORE_DLL(int) CreateDirectoryTreeW(const wchar_t* szDir);
-MIR_CORE_DLL(int) PathIsAbsoluteW(const wchar_t *pSrc);
-
-#if defined( __cplusplus )
- MIR_CORE_DLL(int) PathToAbsolute(const char *pSrc, char *pOut, const char* base=0);
- MIR_CORE_DLL(int) PathToAbsoluteW(const wchar_t *pSrc, wchar_t *pOut, const wchar_t* base = 0);
-
- MIR_CORE_DLL(int) PathToRelative(const char *pSrc, char *pOut, const char* base = 0);
- MIR_CORE_DLL(int) PathToRelativeW(const wchar_t *pSrc, wchar_t *pOut, const wchar_t* base = 0);
-#else
- MIR_CORE_DLL(int) PathToAbsolute(const char *pSrc, char *pOut, const char* base);
- MIR_CORE_DLL(int) PathToAbsoluteW(const wchar_t *pSrc, wchar_t *pOut, const wchar_t* base);
-
- MIR_CORE_DLL(int) PathToRelative(const char *pSrc, char *pOut, const char* base);
- MIR_CORE_DLL(int) PathToRelativeW(const wchar_t *pSrc, wchar_t *pOut, const wchar_t* base);
-#endif
-
-#define CreatePathToFileT CreatePathToFileW
-#define CreateDirectoryTreeT CreateDirectoryTreeW
-#define PathIsAbsoluteT PathIsAbsoluteW
-#define PathToAbsoluteT PathToAbsoluteW
-#define PathToRelativeT PathToRelativeW
-
-///////////////////////////////////////////////////////////////////////////////
// print functions
MIR_CORE_DLL(int) mir_snprintf(char *buffer, size_t count, const char* fmt, ...);
diff --git a/include/m_utils.h b/include/m_utils.h
index 4e779871a5..9d9d689e3a 100644
--- a/include/m_utils.h
+++ b/include/m_utils.h
@@ -287,58 +287,75 @@ EXTERN_C MIR_CORE_DLL(HBITMAP) Bitmap_Load(const TCHAR *ptszFileName);
EXTERN_C MIR_CORE_DLL(void) Bitmap_GetFilter(TCHAR *dest, size_t destLen);
/////////////////////////////////////////////////////////////////////////////////////////
-// Saves a path to a relative path (from the miranda directory)
+// Converts a path to a relative path
// Only saves as a relative path if the file is in the miranda directory (or
// sub directory)
-// wParam = (WPARAM)(char*)pszPath
-// lParam = (LPARAM)(char*)pszNewPath
-// pszPath is the path to convert and pszNewPath is the buffer that
-// the new path is copied too. pszNewPath MUST be of the size MAX_PATH.
-// Returns numbers of chars copied.
-// Unicode version is available since 0.6.2
-
-#define MS_UTILS_PATHTORELATIVE "Utils/PathToRelative"
-#define MS_UTILS_PATHTORELATIVEW "Utils/PathToRelativeW"
+//
+// [pszSrc] is the path to convert and [pszOut] is the buffer that
+// the new path is copied too. pszOut MUST be at least of the size MAX_PATH.
+//
+// [pszBase] is the folder that is treated as root for 'relativity'
+// by default = path to miranda32.exe
+//
+// Returns number of chars copied.
-#ifdef _UNICODE
- #define MS_UTILS_PATHTORELATIVET MS_UTILS_PATHTORELATIVEW
+#if defined( __cplusplus )
+EXTERN_C MIR_CORE_DLL(int) PathToRelative(const char *pszSrc, char *pszOut, const char* pszBase = 0);
+EXTERN_C MIR_CORE_DLL(int) PathToRelativeW(const wchar_t *pwszSrc, wchar_t *pwszOut, const wchar_t* pwszBase = 0);
#else
- #define MS_UTILS_PATHTORELATIVET MS_UTILS_PATHTORELATIVE
+EXTERN_C MIR_CORE_DLL(int) PathToRelative(const char *pszSrc, char *pszOut, const char* pszBase);
+EXTERN_C MIR_CORE_DLL(int) PathToRelativeW(const wchar_t *pwszSrc, wchar_t *pwszOut, const wchar_t* pwszBase);
#endif
+#define PathToRelativeT PathToRelativeW
+
/////////////////////////////////////////////////////////////////////////////////////////
// Saves a path to a absolute path (from the miranda directory)
-// wParam = (WPARAM)(char*)pszPath
-// lParam = (LPARAM)(char*)pszNewPath
-// pszPath is the path to convert and pszNewPath is the buffer that
-// the new path is copied too. pszNewPath MUST be of the size MAX_PATH.
+//
+// [pszSrc] is the path to convert and [pszOut] is the buffer that
+// the new path is copied too. pszOut MUST be of the size MAX_PATH.
+//
+// [pszBase] is the folder that is treated as root for 'relativity'
+// by default = path to miranda32.exe
+//
// Returns numbers of chars copied.
-// Unicode version is available since 0.6.2
-#define MS_UTILS_PATHTOABSOLUTE "Utils/PathToAbsolute"
-#define MS_UTILS_PATHTOABSOLUTEW "Utils/PathToAbsoluteW"
-
-#ifdef _UNICODE
- #define MS_UTILS_PATHTOABSOLUTET MS_UTILS_PATHTOABSOLUTEW
+#if defined( __cplusplus )
+EXTERN_C MIR_CORE_DLL(int) PathToAbsolute(const char *pszSrc, char *pszOut, const char* pszBase = 0);
+EXTERN_C MIR_CORE_DLL(int) PathToAbsoluteW(const wchar_t *pwszSrc, wchar_t *pwszOut, const wchar_t* pwszBase = 0);
#else
- #define MS_UTILS_PATHTOABSOLUTET MS_UTILS_PATHTOABSOLUTE
+EXTERN_C MIR_CORE_DLL(int) PathToAbsolute(const char *pszSrc, char *pszOut, const char* pszBase);
+EXTERN_C MIR_CORE_DLL(int) PathToAbsoluteW(const wchar_t *pwszSrc, wchar_t *pwszOut, const wchar_t* pwszBase);
#endif
+#define PathToAbsoluteT PathToAbsoluteW
+
/////////////////////////////////////////////////////////////////////////////////////////
-// Creates a directory tree (even more than one directories levels are missing) 0.7.0+
-// wParam = 0 (unused)
-// lParam = (LPARAM)(char*)pszPath - directory to be created
-// Returns 0 on success error code otherwise
-// Unicode version is available since 0.7.0
+// Creates a directory tree (even more than one directories levels are missing)
+// Returns 0 on success or an error code otherwise
-#define MS_UTILS_CREATEDIRTREE "Utils/CreateDirTree"
-#define MS_UTILS_CREATEDIRTREEW "Utils/CreateDirTreeW"
+EXTERN_C MIR_CORE_DLL(int) CreateDirectoryTree(const char *pszDir);
+EXTERN_C MIR_CORE_DLL(int) CreateDirectoryTreeW(const wchar_t *pwszDir);
-#ifdef _UNICODE
- #define MS_UTILS_CREATEDIRTREET MS_UTILS_CREATEDIRTREEW
-#else
- #define MS_UTILS_CREATEDIRTREET MS_UTILS_CREATEDIRTREE
-#endif
+#define CreateDirectoryTreeT CreateDirectoryTreeW
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Creates all subdirectories required to create a file with the file name given
+// Returns 0 on success or an error code otherwise
+
+EXTERN_C MIR_CORE_DLL(void) CreatePathToFile(char *wszFilePath);
+EXTERN_C MIR_CORE_DLL(void) CreatePathToFileW(wchar_t *wszFilePath);
+
+#define CreatePathToFileT CreatePathToFileW
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Checks if a file name is absolute or not
+// returns TRUE if yes or FALSE if not
+
+EXTERN_C MIR_CORE_DLL(int) PathIsAbsolute(const char *pSrc);
+EXTERN_C MIR_CORE_DLL(int) PathIsAbsoluteW(const wchar_t *pSrc);
+
+#define PathIsAbsoluteT PathIsAbsoluteW
/////////////////////////////////////////////////////////////////////////////////////////
// Generates Random number of any length