From 70948d9a9ec613b17c2cdff9e76b5b35f40565ac Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sun, 31 Jul 2022 17:09:05 +0200 Subject: user/shell: use an array of function pointers for the builtins --- src/user/app/shell/builtins.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/user/app/shell/builtins.h') diff --git a/src/user/app/shell/builtins.h b/src/user/app/shell/builtins.h index bb52cef..aa2cd8c 100644 --- a/src/user/app/shell/builtins.h +++ b/src/user/app/shell/builtins.h @@ -2,6 +2,9 @@ #include #include -void cmd_cat_ls(const char *args, bool ls); -void cmd_hexdump(const char *args); -void cmd_touch(const char *args); +struct builtin { + const char *name; + void (*fn)(int argc, const char **argv); +}; + +extern struct builtin builtins[]; -- cgit v1.2.3