📄 exstatus.c
字号:
#include "excustom.h"
#ifdef EX_USE_ERRORS
#include "exdevice.h"
#include "exstatus.h"
/***********************************************************************
* Name : TranslateExError
* Translates ExError enums to a string.
*
* Parameters:
* wErr - Ex Error
*
* Outputs:
* returns a pointer to a string
***********************************************************************/
EXCHAR* EXAPI TranslateExError( ExStatus wErr )
{
switch( wErr )
{
case EX_OK:
return "OK";
case EX_DEV_ERROR:
return "Device error";
case EX_COMMAND_LINE_ERROR:
return "Command line error";
case EX_MALLOC_ERROR:
return "Malloc memory error";
case EX_OPEN_ERROR:
return "Open device error";
case EX_CLOSE_ERROR:
return "Close device error";
case EX_WRITE_ERROR:
return "Write to device error";
case EX_READ_ERROR:
return "Read from device error";
case EX_EOF_ERROR:
return "EOF error";
case EX_CMDLINE_PARAM_ERROR:
return "Command line param error";
case EX_USER_CUSTOM_ERROR:
return "User customization error";
case EX_TRUEFFS_ERROR:
return "TrueFFS status error";
case EX_HELP_SCREEN_ERROR:
return "help screen error";
default:
return "Unknown error";
}
}
/***********************************************************************
* Name : PrintErrorMessage
* Open Error msg device, Write error to it and close it.
*
* Parameters:
* err - Ex Error
*
* Outputs:
* none
***********************************************************************/
void EXAPI PrintErrorMessage( ExStatus err )
{
ExDevice errMsgDev;
if( OpenErrorMsgDevice( &errMsgDev ) != EX_OK )
return;
WriteErrorMsgDevice( &errMsgDev, TranslateExError( err ) );
CloseErrorMsgDevice( &errMsgDev );
}
#endif /* EX_USE_ERRORS */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -