aboutsummaryrefslogtreecommitdiff
path: root/src/commands/command.c
diff options
context:
space:
mode:
authorMarvin Borner2019-09-19 19:56:59 +0200
committerMarvin Borner2019-09-19 20:05:38 +0200
commit05e1fedcc9cd30d1a34a65e640da45e980b4f859 (patch)
tree9cfb7620907ac126f26cdfe9363cb73ed74ea179 /src/commands/command.c
parentffd82e18b5259fab477ad375a7af8550fac526d8 (diff)
Moved source to kernel directory
Diffstat (limited to 'src/commands/command.c')
-rw-r--r--src/commands/command.c26
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!");
-}