From 0fa6e3a636876c4d016d7eeee5c4d38d6dcf1a67 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 31 May 2019 17:59:58 -0700 Subject: Compacting the code, putting column names with widths --- config.def.h | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'config.def.h') diff --git a/config.def.h b/config.def.h index 6a26999..8c5fbe0 100644 --- a/config.def.h +++ b/config.def.h @@ -89,9 +89,14 @@ typedef struct { int flags; } binding_t; +typedef struct { + int width; + const char *name; +} column_t; + // These commands will run at startup (before command-line arguments) extern const char *startupcmds[]; -extern const int colwidths[128]; +extern const column_t columns[128]; const char *startupcmds[] = { ////////////////////////////////////////////// @@ -106,15 +111,15 @@ const char *startupcmds[] = { }; // Column widths: -const int colwidths[128] = { - ['*'] = 2, - ['s'] = 9, - ['m'] = 21, - ['a'] = 21, - ['c'] = 21, - ['p'] = 5, - ['n'] = 40, - ['r'] = 2, +const column_t columns[128] = { + ['*'] = {2, "*"}, + ['a'] = {21, " Accessed"}, + ['c'] = {21, " Created"}, + ['m'] = {21, " Modified"}, + ['n'] = {40, "Name"}, + ['p'] = {5, "Permissions"}, + ['r'] = {2, "Random"}, + ['s'] = {9, "Size"}, }; #ifdef __APPLE__ -- cgit v1.2.3