📄 command_parse.h
字号:
#ifndef COMMAND_PARSE_H
#define COMMAND_PARSE_H
#include "ksh_type.h"
#define MAX_COMMAND_NAME_LEN 24
#define MAX_HELP_STRING_LEN 255
#define MAX_COMMAN_NR 50 /*最多支持的命令数*/
/*假设用户输入如下:
str1 str2 str3 ... strx
1.最多不超过str30
2.每个strx的长度不超过26
*/
#define MAX_COMMAND_STR_LEN 26
#define MAX_COMMAND_STR_NUM 30
typedef UINT32 (*RUNC_FUNC0)(void);
typedef UINT32 (*RUNC_FUNC1)(UINT32 arg1);
typedef UINT32 (*RUNC_FUNC2)(UINT32 arg1, UINT32 arg2);
typedef UINT32 (*RUNC_FUNC3)(UINT32 arg1, UINT32 arg2, UINT32 arg3);
typedef UINT32 (*RUNC_FUNC4)(UINT32 arg1, UINT32 arg2, UINT32 arg3, UINT32 arg4);
/*
@cmd_index:该命令在命令表中的索引
@input_para_count:用户输入的参数数
*/
typedef int (* FUNCTION)(int cmd_index, int input_para_count, char *output);
typedef struct comand_table{
char name[MAX_COMMAND_NAME_LEN]; /*名字*/
int para_num; /*函数参数个数*/
FUNCTION function; /*执行的函数*/
char help_string[MAX_HELP_STRING_LEN]; /*帮助*/
}COMMAND_TABLE;
int help(int cmd_index, int input_count, char *output);
int dump_mem(int cmd_index, int input_count, char *output);
int print_mem(UINT8 *addr, UINT16 length, char *output);
int get_var(int cmd_index, int input_count, char *output);
int execute_cmd(char *usr_input, char *output);
int run_func(int cmd_index, int input_count, char *output);
int set_var(int cmd_index, int input_count, char *output);
int fill_mem(int cmd_index, int input_count, char *output);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -