diff --git a/include/sdutils/sdutils.h b/include/sdutils/sdutils.h index 2ac47b9..a0d7510 100644 --- a/include/sdutils/sdutils.h +++ b/include/sdutils/sdutils.h @@ -36,7 +36,13 @@ typedef void (*SDCleanUpHandlesHandlerFn)(); * SDUTILS_RESULT_MODULE_NOT_FOUND when the SDHotSwapModule is not loaded * SDUTILS_RESULT_MODULE_MISSING_EXPORT when the SDHotSwapModule does not export the expected functions. */ -SDUtilsStatus SDUtils_Init(); +SDUtilsStatus SDUtils_InitLibrary(); + +/** + * Deinitializes the SDUtils library, must be called before exiting the application + * @return SDUTILS_RESULT_SUCCESS on success + */ +SDUtilsStatus SDUtils_DeInitLibrary(); /** * Returns the API Version of the WUHBUtils Module. @@ -44,11 +50,6 @@ SDUtilsStatus SDUtils_Init(); */ SDUtilsVersion SDUtils_GetVersion(); -/** - * Deinitializes the SDUtils library, must be called before exiting the application - * @return SDUTILS_RESULT_SUCCESS on success - */ -SDUtilsStatus SDUtils_DeInit(); /** * Registers a callback which will be called whenever a sd card will be inserted or ejected. diff --git a/source/utils.cpp b/source/utils.cpp index 8171573..4b896ef 100644 --- a/source/utils.cpp +++ b/source/utils.cpp @@ -13,7 +13,7 @@ static bool (*sSDUtilsRemoveAttachHandler)(SDAttachHandlerFn) = nullptr; static bool (*sSDUtilsAddCleanUpHandlesHandler)(SDCleanUpHandlesHandlerFn) = nullptr; static bool (*sSDUtilsRemoveCleanUpHandlesHandler)(SDCleanUpHandlesHandlerFn) = nullptr; -SDUtilsStatus SDUtils_Init() { +SDUtilsStatus SDUtils_InitLibrary() { if (OSDynLoad_Acquire("homebrew_sdhotswap", &sModuleHandle) != OS_DYNLOAD_OK) { OSReport("SDUtils_Init: OSDynLoad_Acquire failed.\n"); return SDUTILS_RESULT_MODULE_NOT_FOUND; @@ -51,6 +51,11 @@ SDUtilsStatus SDUtils_Init() { return SDUTILS_RESULT_SUCCESS; } +SDUtilsStatus SDUtils_DeInitLibrary() { + // We don't need to release the OSDynLoad handle for modules. + return SDUTILS_RESULT_SUCCESS; +} + SDUtilsVersion GetVersion(); SDUtilsVersion SDUtils_GetVersion() { if (sSDUtilsGetVersion == nullptr) { @@ -60,11 +65,6 @@ SDUtilsVersion SDUtils_GetVersion() { return reinterpret_cast(sSDUtilsGetVersion)(); } -SDUtilsStatus SDUtils_DeInit() { - // We don't need to release the OSDynLoad handle for modules. - return SDUTILS_RESULT_SUCCESS; -} - SDUtilsStatus SDUtils_IsSdCardMounted(bool *status) { if (status == nullptr) { return SDUTILS_RESULT_INVALID_ARGUMENT;