diff options
-rw-r--r-- | addons/library.xbmc.addon/libXBMC_addon.h | 9 | ||||
-rw-r--r-- | lib/addons/library.xbmc.addon/libXBMC_addon.cpp | 7 | ||||
-rw-r--r-- | xbmc/addons/AddonCallbacks.h | 2 | ||||
-rw-r--r-- | xbmc/addons/AddonCallbacksAddon.cpp | 2 | ||||
-rw-r--r-- | xbmc/addons/AddonCallbacksAddon.h | 2 |
5 files changed, 11 insertions, 11 deletions
diff --git a/addons/library.xbmc.addon/libXBMC_addon.h b/addons/library.xbmc.addon/libXBMC_addon.h index a7348c19e0..342f804704 100644 --- a/addons/library.xbmc.addon/libXBMC_addon.h +++ b/addons/library.xbmc.addon/libXBMC_addon.h @@ -158,7 +158,7 @@ namespace ADDON dlsym(m_libXBMC_addon, "XBMC_queue_notification"); if (XBMC_queue_notification == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } - XBMC_unknown_to_utf8 = (void (*)(void* HANDLE, void* CB, std::string &str)) + XBMC_unknown_to_utf8 = (const char* (*)(void* HANDLE, void* CB, const char* str)) dlsym(m_libXBMC_addon, "XBMC_unknown_to_utf8"); if (XBMC_unknown_to_utf8 == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } @@ -293,9 +293,10 @@ namespace ADDON /*! * @brief Translate a string with an unknown encoding to UTF8. - * @param sourceDest The string to translate. + * @param str The string to translate. + * @return The string translated to UTF8. Must be freed when done. */ - void UnknownToUTF8(std::string &str) + const char* UnknownToUTF8(const char* str) { return XBMC_unknown_to_utf8(m_Handle, m_Callbacks, str); } @@ -527,7 +528,7 @@ namespace ADDON void (*XBMC_log)(void *HANDLE, void* CB, const addon_log_t loglevel, const char *msg); bool (*XBMC_get_setting)(void *HANDLE, void* CB, const char* settingName, void *settingValue); void (*XBMC_queue_notification)(void *HANDLE, void* CB, const queue_msg_t type, const char *msg); - void (*XBMC_unknown_to_utf8)(void *HANDLE, void* CB, std::string &str); + const char* (*XBMC_unknown_to_utf8)(void *HANDLE, void* CB, const char* str); const char* (*XBMC_get_localized_string)(void *HANDLE, void* CB, int dwCode); const char* (*XBMC_get_dvd_menu_language)(void *HANDLE, void* CB); void* (*XBMC_open_file)(void *HANDLE, void* CB, const char* strFileName, unsigned int flags); diff --git a/lib/addons/library.xbmc.addon/libXBMC_addon.cpp b/lib/addons/library.xbmc.addon/libXBMC_addon.cpp index a9308e5638..2dd9b0a65c 100644 --- a/lib/addons/library.xbmc.addon/libXBMC_addon.cpp +++ b/lib/addons/library.xbmc.addon/libXBMC_addon.cpp @@ -84,13 +84,12 @@ DLLEXPORT void XBMC_queue_notification(void *hdl, void* cb, const queue_msg_t ty ((CB_AddOnLib*)cb)->QueueNotification(((AddonCB*)hdl)->addonData, type, msg); } -DLLEXPORT void XBMC_unknown_to_utf8(void *hdl, void* cb, string &str) +DLLEXPORT const char* XBMC_unknown_to_utf8(void *hdl, void* cb, const char* str) { if (cb == NULL) - return; + return NULL; - string buffer = ((CB_AddOnLib*)cb)->UnknownToUTF8(str.c_str()); - str = buffer; + return ((CB_AddOnLib*)cb)->UnknownToUTF8(str); } DLLEXPORT const char* XBMC_get_localized_string(void *hdl, void* cb, int dwCode) diff --git a/xbmc/addons/AddonCallbacks.h b/xbmc/addons/AddonCallbacks.h index a5e1b819da..4b2b4c1124 100644 --- a/xbmc/addons/AddonCallbacks.h +++ b/xbmc/addons/AddonCallbacks.h @@ -27,7 +27,7 @@ typedef void (*AddOnLogCallback)(void *addonData, const ADDON::addon_log_t loglevel, const char *msg); typedef void (*AddOnQueueNotification)(void *addonData, const ADDON::queue_msg_t type, const char *msg); typedef bool (*AddOnGetSetting)(void *addonData, const char *settingName, void *settingValue); -typedef char* (*AddOnUnknownToUTF8)(const char *sourceDest); +typedef const char* (*AddOnUnknownToUTF8)(const char *sourceDest); typedef const char* (*AddOnGetLocalizedString)(const void* addonData, long dwCode); typedef const char* (*AddOnGetDVDMenuLanguage)(const void* addonData); diff --git a/xbmc/addons/AddonCallbacksAddon.cpp b/xbmc/addons/AddonCallbacksAddon.cpp index 6e8425fd1f..53547bf402 100644 --- a/xbmc/addons/AddonCallbacksAddon.cpp +++ b/xbmc/addons/AddonCallbacksAddon.cpp @@ -227,7 +227,7 @@ bool CAddonCallbacksAddon::GetAddonSetting(void *addonData, const char *strSetti return false; } -char* CAddonCallbacksAddon::UnknownToUTF8(const char *strSource) +const char* CAddonCallbacksAddon::UnknownToUTF8(const char *strSource) { CStdString string; if (strSource != NULL) diff --git a/xbmc/addons/AddonCallbacksAddon.h b/xbmc/addons/AddonCallbacksAddon.h index c7317e7757..4e60f0782b 100644 --- a/xbmc/addons/AddonCallbacksAddon.h +++ b/xbmc/addons/AddonCallbacksAddon.h @@ -38,7 +38,7 @@ public: static void AddOnLog(void *addonData, const addon_log_t addonLogLevel, const char *strMessage); static bool GetAddonSetting(void *addonData, const char *strSettingName, void *settingValue); static void QueueNotification(void *addonData, const queue_msg_t type, const char *strMessage); - static char *UnknownToUTF8(const char *strSource); + static const char *UnknownToUTF8(const char *strSource); static const char *GetLocalizedString(const void* addonData, long dwCode); static const char *GetDVDMenuLanguage(const void* addonData); |