2023-06-15 01:35:37 +00:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define DEF_ERR_CODE(ERR_CODE) \
|
|
|
|
|
ERR_CODE(ERR_SUCCESS, 0, "成功") \
|
|
|
|
|
ERR_CODE(ERR_INPUT_PARAMS, 1, "输入参数错误") \
|
|
|
|
|
ERR_CODE(ERR_UN_SUPPORT, 2, "不支持的操作") \
|
|
|
|
|
ERR_CODE(ERR_CALL_SHELL, 3, "调用Shell命令失败") \
|
|
|
|
|
ERR_CODE(ERR_ITEM_EXISTS, 4, "该内容已经存在") \
|
|
|
|
|
ERR_CODE(ERR_ITEM_UNEXISTS, 5, "该内容不存在") \
|
|
|
|
|
ERR_CODE(ERR_SYS_INIT, 6, "系统中断") \
|
|
|
|
|
ERR_CODE(ERR_SYS_CALL, 7, "系统调用") \
|
|
|
|
|
ERR_CODE(ERR_OPEN_FILE, 8, "打开文件失败") \
|
|
|
|
|
ERR_CODE(ERR_READ_FILE, 9, "读取文件失败") \
|
|
|
|
|
ERR_CODE(ERR_FILE_NOT_EXISTS, 10, "文件不存在") \
|
|
|
|
|
ERR_CODE(ERR_FILE_LOCKED, 11, "文件被锁定") \
|
|
|
|
|
ERR_CODE(ERR_GET_FILE_SIZE, 12, "获取文件大小失败") \
|
|
|
|
|
ERR_CODE(ERR_COPY_FILE, 13, "复制文件失败") \
|
|
|
|
|
ERR_CODE(ERR_MALLOC_MEMORY, 14, "分配内存失败") \
|
|
|
|
|
ERR_CODE(ERR_MMAP_MEMORY, 15, "共享内存失败")
|
|
|
|
|
|
2023-06-19 11:08:42 +00:00
|
|
|
|
|
2023-06-15 01:35:37 +00:00
|
|
|
|
#define GENERATE_ENUM(ENUM, n, x) ENUM,
|
|
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
DEF_ERR_CODE(GENERATE_ENUM)
|
|
|
|
|
} USER_ERRNO;
|