typedef void (*MICROSHELL_UART_PUTC)(char c);
typedef char (*MICROSHELL_UART_GETC)(void);
typedef void (*MICROSHELL_ACTION_HOOK)(MSCORE_ACTION action);
void microshell_init(MICROSHELL *handle, MICROSHELL_UART_PUTC uart_putc, MICROSHELL_UART_GETC uart_getc, MICROSHELL_ACTION_HOOK action_hook);
char *microshell_getline(MICROSHELL *handle, char *buf, int siz);
typedef int MSCMD_USER_RESULT;
typedef void * MSCMD_USER_OBJECT;
typedef MSCMD_USER_RESULT (*MSCMD_FUNC)(MSOPT *msopt, MSCMD_USER_OBJECT usrobj);
typedef struct {
char *argv0;
MSCMD_FUNC func;
} MSCMD_COMMAND_TABLE;
typedef struct {
MSCMD_COMMAND_TABLE *command_table;
int command_count;
MSCMD_USER_OBJECT usrobj;
} MSCMD;
int mscmd_init(MSCMD *handle, MSCMD_COMMAND_TABLE *command_table, int command_count, MSCMD_USER_OBJECT usrobj);
int mscmd_execute(MSCMD *handle, char *text, MSCMD_USER_RESULT *result);
typedef enum {
MSOPT_RESULT_OK = 0,
MSOPT_RESULT_ERROR_ILLEGAL_OBJECT,
MSOPT_RESULT_ERROR_ILLEGAL_INDEX_NUMBER,
MSOPT_RESULT_ERROR_TOO_MUCH_ARGUMENTS,
MSOPT_RESULT_ERROR_BUFFER_SIZE,
} MSOPT_RESULT;
MSOPT_RESULT msopt_init(MSOPT *handle, char *text);
MSOPT_RESULT msopt_get_argc(MSOPT *handle, int *argc);
MSOPT_RESULT msopt_get_argv(MSOPT *handle, int index, char *bufptr, int bufsiz);