mirror of
https://github.com/wiiu-env/WiiUPluginSystem.git
synced 2024-12-24 00:51:59 +01:00
Add WUPS_GetStorageStatusStr
This commit is contained in:
parent
a2f75edfeb
commit
104e6e1249
@ -48,6 +48,8 @@ typedef struct wups_loader_init_storage_args_t_ {
|
||||
/* called by backend */
|
||||
void WUPS_InitStorage(wups_loader_init_storage_args_t args);
|
||||
|
||||
const char *WUPS_GetStorageStatusStr(WUPSStorageError status);
|
||||
|
||||
/* opens storage for reading and writing */
|
||||
WUPSStorageError WUPS_OpenStorage(void);
|
||||
|
||||
|
@ -29,6 +29,34 @@ void WUPS_InitStorage(wups_loader_init_storage_args_t args) {
|
||||
rootItem.type = WUPS_STORAGE_TYPE_ITEM;
|
||||
}
|
||||
|
||||
const char *WUPS_GetStorageStatusStr(WUPSStorageError status) {
|
||||
switch (status) {
|
||||
case WUPS_STORAGE_ERROR_SUCCESS:
|
||||
return "WUPS_STORAGE_ERROR_SUCCESS";
|
||||
case WUPS_STORAGE_ERROR_NOT_OPENED:
|
||||
return "WUPS_STORAGE_ERROR_NOT_OPENED";
|
||||
case WUPS_STORAGE_ERROR_ALREADY_OPENED:
|
||||
return "WUPS_STORAGE_ERROR_ALREADY_OPENED";
|
||||
case WUPS_STORAGE_ERROR_INVALID_ARGS:
|
||||
return "WUPS_STORAGE_ERROR_INVALID_ARGS";
|
||||
case WUPS_STORAGE_ERROR_NOT_FOUND:
|
||||
return "WUPS_STORAGE_ERROR_NOT_FOUND";
|
||||
case WUPS_STORAGE_ERROR_NOT_INITIALIZED:
|
||||
return "WUPS_STORAGE_ERROR_NOT_INITIALIZED";
|
||||
case WUPS_STORAGE_ERROR_INVALID_BACKEND_PARAMS:
|
||||
return "WUPS_STORAGE_ERROR_INVALID_BACKEND_PARAMS";
|
||||
case WUPS_STORAGE_ERROR_INVALID_JSON:
|
||||
return "WUPS_STORAGE_ERROR_INVALID_JSON";
|
||||
case WUPS_STORAGE_ERROR_IO:
|
||||
return "WUPS_STORAGE_ERROR_IO";
|
||||
case WUPS_STORAGE_ERROR_B64_DECODE_FAILED:
|
||||
return "WUPS_STORAGE_ERROR_B64_DECODE_FAILED";
|
||||
case WUPS_STORAGE_ERROR_BUFFER_TOO_SMALL:
|
||||
return "WUPS_STORAGE_ERROR_BUFFER_TOO_SMALL";
|
||||
}
|
||||
return "WUPS_STORAGE_ERROR_UNKNOWN";
|
||||
}
|
||||
|
||||
WUPSStorageError WUPS_OpenStorage(void) {
|
||||
if (!storage_initialized) {
|
||||
return WUPS_STORAGE_ERROR_NOT_INITIALIZED;
|
||||
|
Loading…
Reference in New Issue
Block a user