mirror of
https://github.com/wiiu-env/libmocha.git
synced 2025-02-19 20:52:45 +01:00
Add Mocha_GetStatusStr
This commit is contained in:
parent
1bcb7649ac
commit
8d650220b2
@ -20,6 +20,8 @@ typedef enum MochaUtilsStatus {
|
|||||||
MOCHA_RESULT_UNKNOWN_ERROR = -0x100,
|
MOCHA_RESULT_UNKNOWN_ERROR = -0x100,
|
||||||
} MochaUtilsStatus;
|
} MochaUtilsStatus;
|
||||||
|
|
||||||
|
const char *Mocha_GetStatusStr(MochaUtilsStatus status);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the mocha lib. Needs to be called before any other functions can be used
|
* Initializes the mocha lib. Needs to be called before any other functions can be used
|
||||||
* @return MOCHA_RESULT_SUCCESS: Library has been successfully initialized <br>
|
* @return MOCHA_RESULT_SUCCESS: Library has been successfully initialized <br>
|
||||||
|
@ -22,6 +22,32 @@ uint32_t mochaApiVersion = 0;
|
|||||||
#define IOCTL_KERN_READ32 0x06
|
#define IOCTL_KERN_READ32 0x06
|
||||||
#define IOCTL_KERN_WRITE32 0x07
|
#define IOCTL_KERN_WRITE32 0x07
|
||||||
#define IOCTL_READ_OTP 0x08
|
#define IOCTL_READ_OTP 0x08
|
||||||
|
|
||||||
|
const char *Mocha_GetStatusStr(MochaUtilsStatus status) {
|
||||||
|
switch (status) {
|
||||||
|
case MOCHA_RESULT_SUCCESS:
|
||||||
|
return "MOCHA_RESULT_SUCCESS";
|
||||||
|
case MOCHA_RESULT_INVALID_ARGUMENT:
|
||||||
|
return "MOCHA_RESULT_INVALID_ARGUMENT";
|
||||||
|
case MOCHA_RESULT_MAX_CLIENT:
|
||||||
|
return "MOCHA_RESULT_MAX_CLIENT";
|
||||||
|
case MOCHA_RESULT_OUT_OF_MEMORY:
|
||||||
|
return "MOCHA_RESULT_OUT_OF_MEMORY";
|
||||||
|
case MOCHA_RESULT_NOT_FOUND:
|
||||||
|
return "MOCHA_RESULT_NOT_FOUND";
|
||||||
|
case MOCHA_RESULT_UNSUPPORTED_API_VERSION:
|
||||||
|
return "MOCHA_RESULT_UNSUPPORTED_API_VERSION";
|
||||||
|
case MOCHA_RESULT_UNSUPPORTED_COMMAND:
|
||||||
|
return "MOCHA_RESULT_UNSUPPORTED_COMMAND";
|
||||||
|
case MOCHA_RESULT_LIB_UNINITIALIZED:
|
||||||
|
return "MOCHA_RESULT_LIB_UNINITIALIZED";
|
||||||
|
case MOCHA_RESULT_UNKNOWN_ERROR:
|
||||||
|
return "MOCHA_RESULT_UNKNOWN_ERROR";
|
||||||
|
}
|
||||||
|
return "MOCHA_RESULT_UNKNOWN_ERROR";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
MochaUtilsStatus Mocha_InitLibrary() {
|
MochaUtilsStatus Mocha_InitLibrary() {
|
||||||
if (mochaInitDone) {
|
if (mochaInitDone) {
|
||||||
return MOCHA_RESULT_SUCCESS;
|
return MOCHA_RESULT_SUCCESS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user