aboutsummaryrefslogtreecommitdiff
path: root/bb.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2020-04-10 00:12:57 -0700
committerBruce Hill <bruce@bruce-hill.com>2020-04-10 00:12:57 -0700
commit8d1e5f8172b9d2bcbd4ef0c33ea7a9f78cf70e9a (patch)
tree26007c9fc3bfee1b397c75e2d43972dce9374a26 /bb.h
parent5183cbd78f43f97e4e3d1cb5ad36a07fdcee51e0 (diff)
General code cleanup and removed some unnecessary imports.
Diffstat (limited to 'bb.h')
-rw-r--r--bb.h42
1 files changed, 19 insertions, 23 deletions
diff --git a/bb.h b/bb.h
index 23682b8..946f323 100644
--- a/bb.h
+++ b/bb.h
@@ -5,7 +5,6 @@
*
* This file contains definitions and customization for `bb`.
*/
-#include <dirent.h>
#include <fcntl.h>
#include <glob.h>
#include <limits.h>
@@ -13,14 +12,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/dir.h>
#include <sys/errno.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
-#include <sys/types.h>
#include <sys/wait.h>
#include <termios.h>
-#include <time.h>
#include <unistd.h>
#include "bterm.h"
@@ -32,11 +28,29 @@
#define PATH_MAX 4096
#endif
-#define BB_TIME_FMT " %T %D "
#define MAX_COLS 12
#define MAX_SORT (2*MAX_COLS)
#define HASH_SIZE 1024
#define HASH_MASK (HASH_SIZE - 1)
+#define MAX_BINDINGS 1024
+
+// Configurable options:
+#define BB_TIME_FMT " %T %D "
+#define SCROLLOFF MIN(5, (winsize.ws_row-4)/2)
+#define SORT_INDICATOR "↓"
+#define RSORT_INDICATOR "↑"
+#define SELECTED_INDICATOR " \033[31;7m \033[0m"
+#define NOT_SELECTED_INDICATOR " "
+// Colors (using ANSI escape sequences):
+#define TITLE_COLOR "\033[37;1m"
+#define NORMAL_COLOR "\033[37m"
+#define CURSOR_COLOR "\033[43;30;1m"
+#define LINK_COLOR "\033[35m"
+#define DIR_COLOR "\033[34m"
+#define EXECUTABLE_COLOR "\033[31m"
+#define SCROLLBAR_FG "\033[48;5;247m "
+#define SCROLLBAR_BG "\033[48;5;239m "
+
#define MAX(a,b) ((a) < (b) ? (b) : (a))
#define MIN(a,b) ((a) > (b) ? (b) : (a))
#define IS_SELECTED(p) (((p)->selected.atme) != NULL)
@@ -156,24 +170,6 @@ typedef struct proc_s {
} running;
} proc_t;
-// Configurable options:
-#define SCROLLOFF MIN(5, (winsize.ws_row-4)/2)
-#define SORT_INDICATOR "↓"
-#define RSORT_INDICATOR "↑"
-#define SELECTED_INDICATOR " \033[31;7m \033[0m"
-#define NOT_SELECTED_INDICATOR " "
-// Colors (using ANSI escape sequences):
-#define TITLE_COLOR "\033[37;1m"
-#define NORMAL_COLOR "\033[37m"
-#define CURSOR_COLOR "\033[43;30;1m"
-#define LINK_COLOR "\033[35m"
-#define DIR_COLOR "\033[34m"
-#define EXECUTABLE_COLOR "\033[31m"
-#define SCROLLBAR_FG "\033[48;5;247m "
-#define SCROLLBAR_BG "\033[48;5;239m "
-
-#define MAX_BINDINGS 1024
-
static binding_t bindings[MAX_BINDINGS];
#include "columns.h"