aboutsummaryrefslogtreecommitdiff
path: root/bb.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-01-01 16:38:24 -0800
committerBruce Hill <bruce@bruce-hill.com>2021-01-01 16:38:24 -0800
commit845f8e42c6d668b584df6c8611a59879b697a694 (patch)
tree1c5e73f84f63df0bbeb8a27eced6d79d875a9e64 /bb.h
parent5371a49ce0eda4054cc4dcb73abea351482711c2 (diff)
A bit of refactoring, moving more rendering code into draw.c
Diffstat (limited to 'bb.h')
-rw-r--r--bb.h23
1 files changed, 11 insertions, 12 deletions
diff --git a/bb.h b/bb.h
index e69d45e..5c53efd 100644
--- a/bb.h
+++ b/bb.h
@@ -10,7 +10,6 @@
#include "bterm.h"
#include "entry.h"
-#include "columns.h"
// Macros:
#define BB_VERSION "0.27.0"
@@ -27,8 +26,6 @@
// Configurable options:
#define SCROLLOFF MIN(5, (winsize.ws_row-4)/2)
-#define SORT_INDICATOR "↓"
-#define RSORT_INDICATOR "↑"
// Colors (using ANSI escape sequences):
#define TITLE_COLOR "\033[37;1m"
#define NORMAL_COLOR "\033[37m"
@@ -70,7 +67,7 @@
fputs(" Press any key to continue...\033[0m ", tty_out); \
fflush(tty_out); \
while (bgetkey(tty_in, NULL, NULL) == -1) usleep(100); \
- dirty = 1; \
+ bb->dirty = 1; \
} while (0)
#define LL_PREPEND(head, node, name) do { \
@@ -96,6 +93,14 @@ typedef struct {
char *description;
} binding_t;
+// For keeping track of child processes
+typedef struct proc_s {
+ pid_t pid;
+ struct {
+ struct proc_s *next, **atme;
+ } running;
+} proc_t;
+
typedef struct bb_s {
entry_t *hash[HASH_SIZE];
entry_t **files;
@@ -110,16 +115,10 @@ typedef struct bb_s {
char columns[MAX_COLS+1];
unsigned int interleave_dirs : 1;
unsigned int should_quit : 1;
+ unsigned int dirty : 1;
+ proc_t *running_procs;
} bb_t;
-// For keeping track of child processes
-typedef struct proc_s {
- pid_t pid;
- struct {
- struct proc_s *next, **atme;
- } running;
-} proc_t;
-
// Hack to get TinyCC (TCC) compilation to work:
// https://lists.nongnu.org/archive/html/tinycc-devel/2018-07/msg00000.html
#ifdef __TINYC__