From 2aa5f544a7a03c1ad59c70ed149911aa3ece0898 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 28 Jan 2021 22:13:51 -0800 Subject: Reorganized header files --- bb.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'bb.c') diff --git a/bb.c b/bb.c index 76bf659..960fbe7 100644 --- a/bb.c +++ b/bb.c @@ -6,6 +6,7 @@ * This file contains the main source code of `bb`. */ +#include #include #include #include @@ -20,14 +21,19 @@ #include #include -#include "bb.h" #include "draw.h" #include "terminal.h" +#include "types.h" +#include "utils.h" #ifndef BB_NAME #define BB_NAME "bb" #endif +#define BB_VERSION "0.27.0" +#define MAX_BINDINGS 1024 +#define SCROLLOFF MIN(5, (winsize.ws_row-4)/2) + // Functions void bb_browse(bb_t *bb, const char *initial_path); static void check_cmdfile(bb_t *bb); @@ -208,7 +214,7 @@ static int compare_files(const void *v1, const void *v2, void *v) */ const char *n1 = e1->name, *n2 = e2->name; while (*n1 && *n2) { - char c1 = LOWERCASE(*n1), c2 = LOWERCASE(*n2); + char c1 = tolower(*n1), c2 = tolower(*n2); if ('0' <= c1 && c1 <= '9' && '0' <= c2 && c2 <= '9') { long i1 = strtol(n1, (char**)&n1, 10); long i2 = strtol(n2, (char**)&n2, 10); @@ -224,7 +230,7 @@ static int compare_files(const void *v1, const void *v2, void *v) ++n1; ++n2; } } - COMPARE(LOWERCASE(*n2), LOWERCASE(*n1)); + COMPARE(tolower(*n2), tolower(*n1)); break; } case COL_PERM: COMPARE((e1->info.st_mode & 0x3FF), (e2->info.st_mode & 0x3FF)); break; -- cgit v1.2.3