From c28759e7c9e63b1d092904b4299afdffec91bcdf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 18 Jun 2018 17:55:24 +0300 Subject: new functions to access mirandaboot.ini from all plugins: Profile_GetSetting() - reads a string from mirandaboot.ini Profile_GetSettingInt() - reads an integer from mirandaboot.ini --- include/m_database.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/m_database.h b/include/m_database.h index 8f7e974b40..1e3dd69a85 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -463,6 +463,16 @@ EXTERN_C MIR_APP_DLL(void) Profile_SetDefault(const wchar_t *pwszPath); // Checks if a profile is opened EXTERN_C MIR_APP_DLL(bool) Profile_CheckOpened(const wchar_t *pwszProfileName); +// Read an option from mirandaboot.ini +EXTERN_C MIR_APP_DLL(int) Profile_GetSettingInt(const wchar_t *pwszSetting, int iDefault = 0); +EXTERN_C MIR_APP_DLL(bool) Profile_GetSetting(const wchar_t *pwszSetting, wchar_t *pwszBuf, size_t cbLen, const wchar_t *pwszDefault = nullptr); + +template +bool Profile_GetSetting(const wchar_t *pwszSetting, wchar_t(&pwszBuf)[_Size], const wchar_t *pwszDefault = nullptr) +{ + return Profile_GetSetting(pwszSetting, pwszBuf, _Size, pwszDefault); +} + ///////////////////////////////////////////////////////////////////////////////////////// // Contact services -- cgit v1.2.3