aboutsummaryrefslogtreecommitdiff
path: root/bb.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-10-13 18:33:46 -0700
committerBruce Hill <bruce@bruce-hill.com>2019-10-13 18:33:46 -0700
commite40feed849fb24aee23e4a19110e642a77c38726 (patch)
tree78772f355d04966d277b31b0675313d1630dc596 /bb.h
parente2152a57a328ccd95415838e31c93eeec695ed8c (diff)
Cleaned up the command parsing code a bit to be slightly more correct
and more compact. Now uses if-else-if chain instead of nested switch statements. This may be very slightly less performant, but probably not noticeable and much cleaner code.
Diffstat (limited to 'bb.h')
-rw-r--r--bb.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/bb.h b/bb.h
index 358016c..ba4d404 100644
--- a/bb.h
+++ b/bb.h
@@ -178,11 +178,12 @@ static int fputs_escaped(FILE *f, const char *str, const char *color);
static void init_term(void);
static int is_simple_bbcmd(const char *s);
static entry_t* load_entry(bb_t *bb, const char *path, int clear_dots);
+static inline int matches_cmd(const char *str, const char *cmd);
static void* memcheck(void *p);
static void normalize_path(const char *root, const char *path, char *pbuf, int clear_dots);
static void populate_files(bb_t *bb, int samedir);
static void print_bindings(int fd);
-static bb_result_t process_cmd(bb_t *bb, const char *cmd);
+static bb_result_t run_bbcmd(bb_t *bb, const char *cmd);
static void render(bb_t *bb);
static void restore_term(const struct termios *term);
static int run_script(bb_t *bb, const char *cmd);