From 05e1fedcc9cd30d1a34a65e640da45e980b4f859 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 19 Sep 2019 19:56:59 +0200 Subject: Moved source to kernel directory --- src/commands/command.c | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 src/commands/command.c (limited to 'src/commands/command.c') 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!"); -} -- cgit v1.2.3