2022-12-05 04:26:36 +00:00
|
|
|
//
|
|
|
|
// Created by xajhuang on 2022/12/5.
|
|
|
|
//
|
|
|
|
#include <user_errno.h>
|
|
|
|
|
2022-12-08 08:55:55 +00:00
|
|
|
#define MAX_DESC_LENGTH (256)
|
|
|
|
#define GENERATE_STRING(STRING, no, desc) {#STRING, desc},
|
2022-12-05 04:26:36 +00:00
|
|
|
|
2023-02-07 01:22:54 +00:00
|
|
|
static const char *g_enumStrVal[][MAX_DESC_LENGTH] = {
|
|
|
|
DEF_ERR_CODE(GENERATE_STRING) {"ERR_UNKNOWN", "未知错误"},
|
|
|
|
};
|
2022-12-05 04:26:36 +00:00
|
|
|
|
2022-12-08 07:21:26 +00:00
|
|
|
const char *getErrorEnumNameString(int errCode) {
|
2022-12-05 04:26:36 +00:00
|
|
|
return g_enumStrVal[errCode][0];
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *getErrorEnumDesc(int errCode) {
|
2022-12-08 07:21:26 +00:00
|
|
|
return g_enumStrVal[errCode][0];
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *getErrorEnumDescripty(int errCode) {
|
2022-12-05 04:26:36 +00:00
|
|
|
return g_enumStrVal[errCode][1];
|
|
|
|
}
|