diff options
author | Marvin Borner | 2019-09-19 19:56:59 +0200 |
---|---|---|
committer | Marvin Borner | 2019-09-19 20:05:38 +0200 |
commit | 05e1fedcc9cd30d1a34a65e640da45e980b4f859 (patch) | |
tree | 9cfb7620907ac126f26cdfe9363cb73ed74ea179 /src/commands/command.c | |
parent | ffd82e18b5259fab477ad375a7af8550fac526d8 (diff) |
Moved source to kernel directory
Diffstat (limited to 'src/commands/command.c')
-rw-r--r-- | src/commands/command.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/commands/command.c b/src/commands/command.c deleted file mode 100644 index 9cbcb07..0000000 --- a/src/commands/command.c +++ /dev/null @@ -1,26 +0,0 @@ -#include "../graphics/graphics.h" -#include "../lib/lib.h" -#include "../io/io.h" - -int32_t starts_with(const char *a, const char *b) { - size_t length_pre = strlen(b); - size_t length_main = strlen(a); - return length_main < length_pre ? 0 : memory_compare(b, a, length_pre) == 0; -} - -extern void shutdown(); - -void exec_command(char *command) { - if (starts_with(command, "ls")) - terminal_write_line("Listing files"); - else if (starts_with(command, "help")) - terminal_write_line("I can't help you write now"); - else if (starts_with(command, "ping")) - terminal_write_line("pong!"); - else if (starts_with(command, "shutdown")) - shutdown(); - else if (starts_with(command, "reboot")) - reboot(); - else - terminal_write_line("Command not found!"); -} |