Kintsugi OS 0.5.0
x86 Monolithic OS
Loading...
Searching...
No Matches
shell.h
Go to the documentation of this file.
1#ifndef SHELL_H
2#define SHELL_H
3
4#include "../kklibc/ctypes.h"
5
6#define SHELL_LINE_SIZE 256
7#define SHELL_MAX_ARGS 32
8
15
16typedef struct {
17 const char* name;
18 const char* category;
19 const char* usage;
20 const char* description;
21 int (*run)(int argc, char** argv);
23
28
29void shell_init(void);
30void shell_poll(void);
31int shell_execute(char* line);
32int shell_parse(char* line, char** argv, int capacity);
33int shell_last_status(void);
35void shell_complete(char* line, u32* length, u32* cursor);
36void line_editor_init(void);
37void line_editor_key(int key);
38
39#endif
unsigned int u32
Definition ctypes.h:11
static u32 length
Definition line_editor.c:10
static char line[SHELL_LINE_SIZE]
Definition line_editor.c:7
static u32 cursor
Definition memory.c:13
int shell_parse(char *line, char **argv, int capacity)
Definition shell.c:27
shell_status_t
Definition shell.h:9
@ SHELL_NOT_FOUND
Definition shell.h:13
@ SHELL_ERROR
Definition shell.h:11
@ SHELL_OK
Definition shell.h:10
@ SHELL_USAGE
Definition shell.h:12
const shell_command_t shell_diag_commands[]
Definition commands_diag.c:170
const shell_command_t * shell_command_at(u32 index)
Definition shell.c:12
int shell_last_status(void)
Definition shell.c:73
void shell_init(void)
Definition shell.c:135
const shell_command_t shell_fs_commands[]
Definition commands_fs.c:245
const shell_command_t shell_misc_commands[]
Definition commands_misc.c:65
void line_editor_init(void)
Definition line_editor.c:40
const shell_command_t shell_system_commands[]
Definition commands_system.c:53
void line_editor_key(int key)
Definition line_editor.c:58
void shell_poll(void)
Definition shell.c:141
int shell_execute(char *line)
Definition shell.c:77
void shell_complete(char *line, u32 *length, u32 *cursor)
Definition completion.c:5
Definition shell.h:16
const char * description
Definition shell.h:20
const char * usage
Definition shell.h:19
const char * name
Definition shell.h:17
const char * category
Definition shell.h:18