HomeCore 0.1.3 (07b5544)
Bare-metal personal computer firmware for Cortex-M
Loading...
Searching...
No Matches
shell.h File Reference

Command shell: line input, command registration, and dispatch. More...

#include <stddef.h>
#include <stdint.h>
#include "homecore/session/session.h"
Include dependency graph for shell.h:

Go to the source code of this file.

Typedefs

typedef session_t shell_context_t
 Command execution context: the session the command runs in.
 
typedef int(* shell_command_handler_t) (shell_context_t *context, int argc, char **argv)
 Command handler.
 

Functions

void shell_init (void)
 Register the built-in commands.
 
void shell_register_command (const char *name, const char *help, shell_command_handler_t handler)
 Add a command.
 
int shell_read_line (char *buffer, size_t max_length)
 Read and echo one console line.
 
int shell_execute_line (shell_context_t *context, char *line)
 Tokenize and run one command line in a session.
 
void shell_run (void)
 Run the interactive shell.
 

Detailed Description

Command shell: line input, command registration, and dispatch.