You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

31 lines
579 B

#ifndef __CMD_H__
#define __CMD_H__
#ifdef __cplusplus
extern "C" {
#endif
struct cmd_tbl_s {
const char *name;
const char *help;
void * user;
int (*cmd)(struct cmd_tbl_s *, int argc, char *argv[]);
};
typedef struct cmd_tbl_s *cmd_tbl_t;
#define CON_CMD(name, usage, _user, handler) \
struct cmd_tbl_s __con_cmd_##name __attribute__((unused, section(".cmdline_cmd"))) = \
{ #name, usage, _user, handler};
/* initialize command */
int cmd_init(void);
/* process debug console input */
void cmd_loop(void);
#ifdef __cplusplus
}
#endif
#endif