From 61e14d4bb25268593019e6df3eb02264b4ac8e0e Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Sat, 31 Oct 2020 23:28:02 +0100 Subject: Spacing around operators --- Action.c | 12 +- Affinity.c | 4 +- AffinityPanel.c | 14 +- BatteryMeter.c | 2 +- CPUMeter.c | 14 +- CRT.c | 738 ++++++++++++++++----------------- CRT.h | 2 +- ClockMeter.c | 2 +- ColumnsPanel.c | 2 +- DateMeter.c | 4 +- DateTimeMeter.c | 4 +- EnvScreen.c | 4 +- FunctionBar.c | 10 +- Header.c | 2 +- HostnameMeter.c | 2 +- IncSet.h | 2 +- InfoScreen.c | 17 +- MainPanel.c | 6 +- MainPanel.h | 2 +- Meter.c | 36 +- OpenFilesScreen.c | 2 +- Panel.c | 10 +- Panel.h | 2 +- Process.c | 22 +- Process.h | 2 +- ProcessList.c | 8 +- RichString.c | 2 +- RichString.h | 2 +- ScreenManager.c | 16 +- Settings.c | 6 +- TraceScreen.c | 11 +- UptimeMeter.c | 6 +- Vector.c | 14 +- Vector.h | 2 +- XUtils.c | 8 +- XUtils.h | 4 +- darwin/DarwinProcess.c | 12 +- darwin/DarwinProcess.h | 8 +- darwin/DarwinProcessList.c | 12 +- darwin/DarwinProcessList.h | 10 +- darwin/Platform.c | 26 +- darwin/Platform.h | 8 +- dragonflybsd/DragonFlyBSDProcess.c | 2 +- dragonflybsd/DragonFlyBSDProcessList.c | 16 +- dragonflybsd/DragonFlyBSDProcessList.h | 10 +- dragonflybsd/Platform.c | 12 +- dragonflybsd/Platform.h | 8 +- freebsd/FreeBSDProcess.c | 2 +- freebsd/FreeBSDProcessList.c | 16 +- freebsd/FreeBSDProcessList.h | 8 +- freebsd/Platform.c | 18 +- freebsd/Platform.h | 8 +- htop.c | 10 +- linux/Battery.c | 22 +- linux/IOPriorityPanel.c | 2 +- linux/LinuxProcess.h | 2 +- linux/LinuxProcessList.c | 94 +++-- linux/LinuxProcessList.h | 2 +- linux/Platform.c | 35 +- linux/Platform.h | 10 +- openbsd/Battery.c | 2 +- openbsd/OpenBSDProcessList.c | 12 +- openbsd/OpenBSDProcessList.h | 2 +- openbsd/Platform.c | 26 +- openbsd/Platform.h | 8 +- solaris/Platform.c | 32 +- solaris/Platform.h | 10 +- solaris/SolarisProcessList.c | 62 +-- solaris/SolarisProcessList.h | 2 +- unsupported/Platform.c | 8 +- unsupported/Platform.h | 8 +- zfs/ZfsCompressedArcMeter.c | 2 +- zfs/openzfs_sysctl.c | 22 +- zfs/openzfs_sysctl.h | 4 +- 74 files changed, 784 insertions(+), 765 deletions(-) diff --git a/Action.c b/Action.c index 303eeeaf..87901432 100644 --- a/Action.c +++ b/Action.c @@ -59,7 +59,7 @@ Object* Action_pickFromVector(State* st, Panel* list, int x, bool followProcess) } ScreenManager_delete(scr); Panel_move(panel, 0, y); - Panel_resize(panel, COLS, LINES-y-1); + Panel_resize(panel, COLS, LINES - y - 1); if (panelFocus == list && ch == 13) { if (followProcess) { Process* selected = (Process*)Panel_getSelected(panel); @@ -181,7 +181,7 @@ static Htop_Reaction sortBy(State* st) { static Htop_Reaction actionResize(State* st) { clear(); - Panel_resize(st->panel, COLS, LINES-(st->panel->y)-1); + Panel_resize(st->panel, COLS, LINES - (st->panel->y) - 1); return HTOP_REDRAW_BAR; } @@ -393,12 +393,12 @@ static Htop_Reaction actionTag(State* st) { return HTOP_OK; } -static Htop_Reaction actionRedraw(ATTR_UNUSED State *st) { +static Htop_Reaction actionRedraw(ATTR_UNUSED State* st) { clear(); return HTOP_REFRESH | HTOP_REDRAW_BAR; } -static Htop_Reaction actionTogglePauseProcessUpdate(State *st) { +static Htop_Reaction actionTogglePauseProcessUpdate(State* st) { st->pauseProcessUpdate = !st->pauseProcessUpdate; return HTOP_REFRESH | HTOP_REDRAW_BAR; } @@ -454,7 +454,7 @@ static Htop_Reaction actionHelp(State* st) { clear(); attrset(CRT_colors[HELP_BOLD]); - for (int i = 0; i < LINES-1; i++) + for (int i = 0; i < LINES - 1; i++) mvhline(i, 0, ' ', COLS); int line = 0; @@ -500,7 +500,7 @@ static Htop_Reaction actionHelp(State* st) { addattrstr(CRT_colors[BAR_SHADOW], " used/total"); addattrstr(CRT_colors[BAR_BORDER], "]"); attrset(CRT_colors[DEFAULT_COLOR]); - mvaddstr(line++,0, "Type and layout of header meters are configurable in the setup screen."); + mvaddstr(line++, 0, "Type and layout of header meters are configurable in the setup screen."); if (CRT_colorScheme == COLORSCHEME_MONOCHROME) { mvaddstr(line, 0, "In monochrome, meters display as different chars, in order: |#*@$%&."); } diff --git a/Affinity.c b/Affinity.c index 96591a65..bfa7ceb5 100644 --- a/Affinity.c +++ b/Affinity.c @@ -74,7 +74,7 @@ Affinity* Affinity_get(Process* proc, ProcessList* pl) { } bool Affinity_set(Process* proc, Arg arg) { - Affinity *this = arg.v; + Affinity* this = arg.v; hwloc_cpuset_t cpuset = hwloc_bitmap_alloc(); for (int i = 0; i < this->used; i++) { hwloc_bitmap_set(cpuset, this->cpus[i]); @@ -99,7 +99,7 @@ Affinity* Affinity_get(Process* proc, ProcessList* pl) { } bool Affinity_set(Process* proc, Arg arg) { - Affinity *this = arg.v; + Affinity* this = arg.v; cpu_set_t cpuset; CPU_ZERO(&cpuset); for (int i = 0; i < this->used; i++) { diff --git a/AffinityPanel.c b/AffinityPanel.c index e184d64b..85094b4c 100644 --- a/AffinityPanel.c +++ b/AffinityPanel.c @@ -35,7 +35,7 @@ typedef struct MaskItem_ { char* indent; /* used also as an condition whether this is a tree node */ int value; /* tri-state: 0 - off, 1 - some set, 2 - all set */ int sub_tree; /* tri-state: 0 - no sub-tree, 1 - open sub-tree, 2 - closed sub-tree */ - Vector *children; + Vector* children; #ifdef HAVE_LIBHWLOC bool ownCpuset; hwloc_bitmap_t cpuset; @@ -123,11 +123,11 @@ typedef struct AffinityPanel_ { Panel super; ProcessList* pl; bool topoView; - Vector *cpuids; + Vector* cpuids; unsigned width; #ifdef HAVE_LIBHWLOC - MaskItem *topoRoot; + MaskItem* topoRoot; hwloc_const_cpuset_t allCpuset; hwloc_bitmap_t workCpuset; #endif @@ -262,7 +262,7 @@ static HandlerResult AffinityPanel_eventHandler(Panel* super, int ch) { #ifdef HAVE_LIBHWLOC -static MaskItem *AffinityPanel_addObject(AffinityPanel* this, hwloc_obj_t obj, unsigned indent, MaskItem *parent) { +static MaskItem* AffinityPanel_addObject(AffinityPanel* this, hwloc_obj_t obj, unsigned indent, MaskItem* parent) { const char* type_name = hwloc_obj_type_string(obj->type); const char* index_prefix = "#"; unsigned depth = obj->depth; @@ -294,7 +294,7 @@ static MaskItem *AffinityPanel_addObject(AffinityPanel* this, hwloc_obj_t obj, u xSnprintf(buf, 64, "%s %s%u", type_name, index_prefix, index); - MaskItem *item = MaskItem_newMask(buf, indent_buf, obj->complete_cpuset, false); + MaskItem* item = MaskItem_newMask(buf, indent_buf, obj->complete_cpuset, false); if (parent) Vector_add(parent->children, item); @@ -316,8 +316,8 @@ static MaskItem *AffinityPanel_addObject(AffinityPanel* this, hwloc_obj_t obj, u return item; } -static MaskItem *AffinityPanel_buildTopology(AffinityPanel* this, hwloc_obj_t obj, unsigned indent, MaskItem *parent) { - MaskItem *item = AffinityPanel_addObject(this, obj, indent, parent); +static MaskItem* AffinityPanel_buildTopology(AffinityPanel* this, hwloc_obj_t obj, unsigned indent, MaskItem* parent) { + MaskItem* item = AffinityPanel_addObject(this, obj, indent, parent); if (obj->next_sibling) { indent |= (1u << obj->depth); } else { diff --git a/BatteryMeter.c b/BatteryMeter.c index c91ae997..ac126cea 100644 --- a/BatteryMeter.c +++ b/BatteryMeter.c @@ -21,7 +21,7 @@ static const int BatteryMeter_attributes[] = { BATTERY }; -static void BatteryMeter_updateValues(Meter * this, char *buffer, int len) { +static void BatteryMeter_updateValues(Meter* this, char* buffer, int len) { ACPresence isOnAC; double percent; diff --git a/CPUMeter.c b/CPUMeter.c index 4997f6f8..b1bb8f45 100644 --- a/CPUMeter.c +++ b/CPUMeter.c @@ -149,7 +149,7 @@ static void AllCPUsMeter_getRange(Meter* this, int* start, int* count) { } } -static void CPUMeterCommonInit(Meter *this, int ncol) { +static void CPUMeterCommonInit(Meter* this, int ncol) { int cpus = this->pl->cpuCount; CPUMeterData* data = this->meterData; if (!data) { @@ -162,13 +162,13 @@ static void CPUMeterCommonInit(Meter *this, int ncol) { AllCPUsMeter_getRange(this, &start, &count); for (int i = 0; i < count; i++) { if (!meters[i]) - meters[i] = Meter_new(this->pl, start+i+1, (const MeterClass*) Class(CPUMeter)); + meters[i] = Meter_new(this->pl, start + i + 1, (const MeterClass*) Class(CPUMeter)); Meter_init(meters[i]); } if (this->mode == 0) this->mode = BAR_METERMODE; int h = Meter_modes[this->mode]->h; - this->h = h * ((count + ncol - 1)/ ncol); + this->h = h * ((count + ncol - 1) / ncol); } static void CPUMeterCommonUpdateMode(Meter* this, int mode, int ncol) { @@ -181,7 +181,7 @@ static void CPUMeterCommonUpdateMode(Meter* this, int mode, int ncol) { for (int i = 0; i < count; i++) { Meter_setMode(meters[i], mode); } - this->h = h * ((count + ncol - 1)/ ncol); + this->h = h * ((count + ncol - 1) / ncol); } static void AllCPUsMeter_done(Meter* this) { @@ -232,11 +232,11 @@ static void CPUMeterCommonDraw(Meter* this, int x, int y, int w, int ncol) { Meter** meters = data->meters; int start, count; AllCPUsMeter_getRange(this, &start, &count); - int colwidth = (w-ncol)/ncol + 1; + int colwidth = (w - ncol) / ncol + 1; int diff = (w - (colwidth * ncol)); int nrows = (count + ncol - 1) / ncol; - for (int i = 0; i < count; i++){ - int d = (i/nrows) > diff ? diff : (i / nrows) ; // dynamic spacer + for (int i = 0; i < count; i++) { + int d = (i / nrows) > diff ? diff : (i / nrows); // dynamic spacer int xpos = x + ((i / nrows) * colwidth) + d; int ypos = y + ((i % nrows) * meters[0]->h); meters[i]->draw(meters[i], xpos, ypos, colwidth); diff --git a/CRT.c b/CRT.c index d91d0d79..38ba9da3 100644 --- a/CRT.c +++ b/CRT.c @@ -42,7 +42,7 @@ in the source distribution for its full text. #define ColorPairGrayBlack ColorPair(Magenta,Magenta) #define ColorIndexGrayBlack ColorIndex(Magenta,Magenta) -static const char *const CRT_treeStrAscii[TREE_STR_COUNT] = { +static const char* const CRT_treeStrAscii[TREE_STR_COUNT] = { "-", // TREE_STR_HORZ "|", // TREE_STR_VERT "`", // TREE_STR_RTEE @@ -54,7 +54,7 @@ static const char *const CRT_treeStrAscii[TREE_STR_COUNT] = { #ifdef HAVE_LIBNCURSESW -static const char *const CRT_treeStrUtf8[TREE_STR_COUNT] = { +static const char* const CRT_treeStrUtf8[TREE_STR_COUNT] = { "\xe2\x94\x80", // TREE_STR_HORZ ─ "\xe2\x94\x82", // TREE_STR_VERT │ "\xe2\x94\x9c", // TREE_STR_RTEE ├ @@ -70,7 +70,7 @@ bool CRT_utf8 = false; #endif -const char *const *CRT_treeStr = CRT_treeStrAscii; +const char* const* CRT_treeStr = CRT_treeStrAscii; int CRT_delay; @@ -78,82 +78,82 @@ const int* CRT_colors; int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = { [COLORSCHEME_DEFAULT] = { - [RESET_COLOR] = ColorPair(White,Black), - [DEFAULT_COLOR] = ColorPair(White,Black), - [FUNCTION_BAR] = ColorPair(Black,Cyan), - [FUNCTION_KEY] = ColorPair(White,Black), - [PANEL_HEADER_FOCUS] = ColorPair(Black,Green), - [PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green), - [PANEL_SELECTION_FOCUS] = ColorPair(Black,Cyan), - [PANEL_SELECTION_FOLLOW] = ColorPair(Black,Yellow), - [PANEL_SELECTION_UNFOCUS] = ColorPair(Black,White), - [FAILED_SEARCH] = ColorPair(Red,Cyan), - [PAUSED] = A_BOLD | ColorPair(Yellow,Cyan), - [UPTIME] = A_BOLD | ColorPair(Cyan,Black), - [BATTERY] = A_BOLD | ColorPair(Cyan,Black), - [LARGE_NUMBER] = A_BOLD | ColorPair(Red,Black), - [METER_TEXT] = ColorPair(Cyan,Black), - [METER_VALUE] = A_BOLD | ColorPair(Cyan,Black), - [METER_VALUE_ERROR] = A_BOLD | ColorPair(Red,Black), - [METER_VALUE_NOTICE] = A_BOLD | ColorPair(White,Black), - [METER_VALUE_IOREAD] = ColorPair(Green,Black), - [METER_VALUE_IOWRITE] = ColorPair(Blue,Black), - [LED_COLOR] = ColorPair(Green,Black), - [TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black), + [RESET_COLOR] = ColorPair(White, Black), + [DEFAULT_COLOR] = ColorPair(White, Black), + [FUNCTION_BAR] = ColorPair(Black, Cyan), + [FUNCTION_KEY] = ColorPair(White, Black), + [PANEL_HEADER_FOCUS] = ColorPair(Black, Green), + [PANEL_HEADER_UNFOCUS] = ColorPair(Black, Green), + [PANEL_SELECTION_FOCUS] = ColorPair(Black, Cyan), + [PANEL_SELECTION_FOLLOW] = ColorPair(Black, Yellow), + [PANEL_SELECTION_UNFOCUS] = ColorPair(Black, White), + [FAILED_SEARCH] = ColorPair(Red, Cyan), + [PAUSED] = A_BOLD | ColorPair(Yellow, Cyan), + [UPTIME] = A_BOLD | ColorPair(Cyan, Black), + [BATTERY] = A_BOLD | ColorPair(Cyan, Black), + [LARGE_NUMBER] = A_BOLD | ColorPair(Red, Black), + [METER_TEXT] = ColorPair(Cyan, Black), + [METER_VALUE] = A_BOLD | ColorPair(Cyan, Black), + [METER_VALUE_ERROR] = A_BOLD | ColorPair(Red, Black), + [METER_VALUE_NOTICE] = A_BOLD | ColorPair(White, Black), + [METER_VALUE_IOREAD] = ColorPair(Green, Black), + [METER_VALUE_IOWRITE] = ColorPair(Blue, Black), + [LED_COLOR] = ColorPair(Green, Black), + [TASKS_RUNNING] = A_BOLD | ColorPair(Green, Black), [PROCESS] = A_NORMAL, [PROCESS_SHADOW] = A_BOLD | ColorPairGrayBlack, - [PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black), - [PROCESS_MEGABYTES] = ColorPair(Cyan,Black), - [PROCESS_GIGABYTES] = ColorPair(Green,Black), - [PROCESS_BASENAME] = A_BOLD | ColorPair(Cyan,Black), - [PROCESS_TREE] = ColorPair(Cyan,Black), - [PROCESS_R_STATE] = ColorPair(Green,Black), - [PROCESS_D_STATE] = A_BOLD | ColorPair(Red,Black), - [PROCESS_HIGH_PRIORITY] = ColorPair(Red,Black), - [PROCESS_LOW_PRIORITY] = ColorPair(Green,Black), - [PROCESS_THREAD] = ColorPair(Green,Black), - [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Green,Black), + [PROCESS_TAG] = A_BOLD | ColorPair(Yellow, Black), + [PROCESS_MEGABYTES] = ColorPair(Cyan, Black), + [PROCESS_GIGABYTES] = ColorPair(Green, Black), + [PROCESS_BASENAME] = A_BOLD | ColorPair(Cyan, Black), + [PROCESS_TREE] = ColorPair(Cyan, Black), + [PROCESS_R_STATE] = ColorPair(Green, Black), + [PROCESS_D_STATE] = A_BOLD | ColorPair(Red, Black), + [PROCESS_HIGH_PRIORITY] = ColorPair(Red, Black), + [PROCESS_LOW_PRIORITY] = ColorPair(Green, Black), + [PROCESS_THREAD] = ColorPair(Green, Black), + [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Green, Black), [BAR_BORDER] = A_BOLD, [BAR_SHADOW] = A_BOLD | ColorPairGrayBlack, - [SWAP] = ColorPair(Red,Black), - [GRAPH_1] = A_BOLD | ColorPair(Cyan,Black), - [GRAPH_2] = ColorPair(Cyan,Black), - [MEMORY_USED] = ColorPair(Green,Black), - [MEMORY_BUFFERS] = ColorPair(Blue,Black), - [MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Blue,Black), - [MEMORY_CACHE] = ColorPair(Yellow,Black), - [LOAD_AVERAGE_FIFTEEN] = ColorPair(Cyan,Black), - [LOAD_AVERAGE_FIVE] = A_BOLD | ColorPair(Cyan,Black), - [LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(White,Black), + [SWAP] = ColorPair(Red, Black), + [GRAPH_1] = A_BOLD | ColorPair(Cyan, Black), + [GRAPH_2] = ColorPair(Cyan, Black), + [MEMORY_USED] = ColorPair(Green, Black), + [MEMORY_BUFFERS] = ColorPair(Blue, Black), + [MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Blue, Black), + [MEMORY_CACHE] = ColorPair(Yellow, Black), + [LOAD_AVERAGE_FIFTEEN] = ColorPair(Cyan, Black), + [LOAD_AVERAGE_FIVE] = A_BOLD | ColorPair(Cyan, Black), + [LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(White, Black), [LOAD] = A_BOLD, - [HELP_BOLD] = A_BOLD | ColorPair(Cyan,Black), + [HELP_BOLD] = A_BOLD | ColorPair(Cyan, Black), [CLOCK] = A_BOLD, [DATE] = A_BOLD, [DATETIME] = A_BOLD, - [CHECK_BOX] = ColorPair(Cyan,Black), + [CHECK_BOX] = ColorPair(Cyan, Black), [CHECK_MARK] = A_BOLD, [CHECK_TEXT] = A_NORMAL, [HOSTNAME] = A_BOLD, - [CPU_NICE] = ColorPair(Blue,Black), - [CPU_NICE_TEXT] = A_BOLD | ColorPair(Blue,Black), - [CPU_NORMAL] = ColorPair(Green,Black), - [CPU_SYSTEM] = ColorPair(Red,Black), + [CPU_NICE] = ColorPair(Blue, Black), + [CPU_NICE_TEXT] = A_BOLD | ColorPair(Blue, Black), + [CPU_NORMAL] = ColorPair(Green, Black), + [CPU_SYSTEM] = ColorPair(Red, Black), [CPU_IOWAIT] = A_BOLD | ColorPairGrayBlack, - [CPU_IRQ] = ColorPair(Yellow,Black), - [CPU_SOFTIRQ] = ColorPair(Magenta,Black), - [CPU_STEAL] = ColorPair(Cyan,Black), - [CPU_GUEST] = ColorPair(Cyan,Black), - [PRESSURE_STALL_THREEHUNDRED] = ColorPair(Cyan,Black), - [PRESSURE_STALL_SIXTY] = A_BOLD | ColorPair(Cyan,Black), - [PRESSURE_STALL_TEN] = A_BOLD | ColorPair(White,Black), - [ZFS_MFU] = ColorPair(Blue,Black), - [ZFS_MRU] = ColorPair(Yellow,Black), - [ZFS_ANON] = ColorPair(Magenta,Black), - [ZFS_HEADER] = ColorPair(Cyan,Black), - [ZFS_OTHER] = ColorPair(Magenta,Black), - [ZFS_COMPRESSED] = ColorPair(Blue,Black), - [ZFS_RATIO] = ColorPair(Magenta,Black), - [ZRAM] = ColorPair(Yellow,Black), + [CPU_IRQ] = ColorPair(Yellow, Black), + [CPU_SOFTIRQ] = ColorPair(Magenta, Black), + [CPU_STEAL] = ColorPair(Cyan, Black), + [CPU_GUEST] = ColorPair(Cyan, Black), + [PRESSURE_STALL_THREEHUNDRED] = ColorPair(Cyan, Black), + [PRESSURE_STALL_SIXTY] = A_BOLD | ColorPair(Cyan, Black), + [PRESSURE_STALL_TEN] = A_BOLD | ColorPair(White, Black), + [ZFS_MFU] = ColorPair(Blue, Black), + [ZFS_MRU] = ColorPair(Yellow, Black), + [ZFS_ANON] = ColorPair(Magenta, Black), + [ZFS_HEADER] = ColorPair(Cyan, Black), + [ZFS_OTHER] = ColorPair(Magenta, Black), + [ZFS_COMPRESSED] = ColorPair(Blue, Black), + [ZFS_RATIO] = ColorPair(Magenta, Black), + [ZRAM] = ColorPair(Yellow, Black), }, [COLORSCHEME_MONOCHROME] = { [RESET_COLOR] = A_NORMAL, @@ -234,314 +234,314 @@ int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = { [ZRAM] = A_NORMAL, }, [COLORSCHEME_BLACKONWHITE] = { - [RESET_COLOR] = ColorPair(Black,White), - [DEFAULT_COLOR] = ColorPair(Black,White), - [FUNCTION_BAR] = ColorPair(Black,Cyan), - [FUNCTION_KEY] = ColorPair(Black,White), - [PANEL_HEADER_FOCUS] = ColorPair(Black,Green), - [PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green), - [PANEL_SELECTION_FOCUS] = ColorPair(Black,Cyan), - [PANEL_SELECTION_FOLLOW] = ColorPair(Black,Yellow), - [PANEL_SELECTION_UNFOCUS] = ColorPair(Blue,White), - [FAILED_SEARCH] = ColorPair(Red,Cyan), - [PAUSED] = A_BOLD | ColorPair(Yellow,Cyan), - [UPTIME] = ColorPair(Yellow,White), - [BATTERY] = ColorPair(Yellow,White), - [LARGE_NUMBER] = ColorPair(Red,White), - [METER_TEXT] = ColorPair(Blue,White), - [METER_VALUE] = ColorPair(Black,White), - [METER_VALUE_ERROR] = A_BOLD | ColorPair(Red,White), - [METER_VALUE_NOTICE] = A_BOLD | ColorPair(Yellow,White), - [METER_VALUE_IOREAD] = ColorPair(Green,White), - [METER_VALUE_IOWRITE] = ColorPair(Yellow,White), - [LED_COLOR] = ColorPair(Green,White), - [TASKS_RUNNING] = ColorPair(Green,White), - [PROCESS] = ColorPair(Black,White), - [PROCESS_SHADOW] = A_BOLD | ColorPair(Black,White), - [PROCESS_TAG] = ColorPair(White,Blue), - [PROCESS_MEGABYTES] = ColorPair(Blue,White), - [PROCESS_GIGABYTES] = ColorPair(Green,White), - [PROCESS_BASENAME] = ColorPair(Blue,White), - [PROCESS_TREE] = ColorPair(Green,White), - [PROCESS_R_STATE] = ColorPair(Green,White), - [PROCESS_D_STATE] = A_BOLD | ColorPair(Red,White), - [PROCESS_HIGH_PRIORITY] = ColorPair(Red,White), - [PROCESS_LOW_PRIORITY] = ColorPair(Green,White), - [PROCESS_THREAD] = ColorPair(Blue,White), - [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue,White), - [BAR_BORDER] = ColorPair(Blue,White), - [BAR_SHADOW] = ColorPair(Black,White), - [SWAP] = ColorPair(Red,White), - [GRAPH_1] = A_BOLD | ColorPair(Blue,White), - [GRAPH_2] = ColorPair(Blue,White), - [MEMORY_USED] = ColorPair(Green,White), - [MEMORY_BUFFERS] = ColorPair(Cyan,White), - [MEMORY_BUFFERS_TEXT] = ColorPair(Cyan,White), - [MEMORY_CACHE] = ColorPair(Yellow,White), - [LOAD_AVERAGE_FIFTEEN] = ColorPair(Black,White), - [LOAD_AVERAGE_FIVE] = ColorPair(Black,White), - [LOAD_AVERAGE_ONE] = ColorPair(Black,White), - [LOAD] = ColorPair(Black,White), - [HELP_BOLD] = ColorPair(Blue,White), - [CLOCK] = ColorPair(Black,White), - [DATE] = ColorPair(Black,White), - [DATETIME] = ColorPair(Black,White), - [CHECK_BOX] = ColorPair(Blue,White), - [CHECK_MARK] = ColorPair(Black,White), - [CHECK_TEXT] = ColorPair(Black,White), - [HOSTNAME] = ColorPair(Black,White), - [CPU_NICE] = ColorPair(Cyan,White), - [CPU_NICE_TEXT] = ColorPair(Cyan,White), - [CPU_NORMAL] = ColorPair(Green,White), - [CPU_SYSTEM] = ColorPair(Red,White), - [CPU_IOWAIT] = A_BOLD | ColorPair(Black,White), - [CPU_IRQ] = ColorPair(Blue,White), - [CPU_SOFTIRQ] = ColorPair(Blue,White), - [CPU_STEAL] = ColorPair(Cyan,White), - [CPU_GUEST] = ColorPair(Cyan,White), - [PRESSURE_STALL_THREEHUNDRED] = ColorPair(Black,White), - [PRESSURE_STALL_SIXTY] = ColorPair(Black,White), - [PRESSURE_STALL_TEN] = ColorPair(Black,White), - [ZFS_MFU] = ColorPair(Cyan,White), - [ZFS_MRU] = ColorPair(Yellow,White), - [ZFS_ANON] = ColorPair(Magenta,White), - [ZFS_HEADER] = ColorPair(Yellow,White), - [ZFS_OTHER] = ColorPair(Magenta,White), - [ZFS_COMPRESSED] = ColorPair(Cyan,White), - [ZFS_RATIO] = ColorPair(Magenta,White), - [ZRAM] = ColorPair(Yellow,White) + [RESET_COLOR] = ColorPair(Black, White), + [DEFAULT_COLOR] = ColorPair(Black, White), + [FUNCTION_BAR] = ColorPair(Black, Cyan), + [FUNCTION_KEY] = ColorPair(Black, White), + [PANEL_HEADER_FOCUS] = ColorPair(Black, Green), + [PANEL_HEADER_UNFOCUS] = ColorPair(Black, Green), + [PANEL_SELECTION_FOCUS] = ColorPair(Black, Cyan), + [PANEL_SELECTION_FOLLOW] = ColorPair(Black, Yellow), + [PANEL_SELECTION_UNFOCUS] = ColorPair(Blue, White), + [FAILED_SEARCH] = ColorPair(Red, Cyan), + [PAUSED] = A_BOLD | ColorPair(Yellow, Cyan), + [UPTIME] = ColorPair(Yellow, White), + [BATTERY] = ColorPair(Yellow, White), + [LARGE_NUMBER] = ColorPair(Red, White), + [METER_TEXT] = ColorPair(Blue, White), + [METER_VALUE] = ColorPair(Black, White), + [METER_VALUE_ERROR] = A_BOLD | ColorPair(Red, White), + [METER_VALUE_NOTICE] = A_BOLD | ColorPair(Yellow, White), + [METER_VALUE_IOREAD] = ColorPair(Green, White), + [METER_VALUE_IOWRITE] = ColorPair(Yellow, White), + [LED_COLOR] = ColorPair(Green, White), + [TASKS_RUNNING] = ColorPair(Green, White), + [PROCESS] = ColorPair(Black, White), + [PROCESS_SHADOW] = A_BOLD | ColorPair(Black, White), + [PROCESS_TAG] = ColorPair(White, Blue), + [PROCESS_MEGABYTES] = ColorPair(Blue, White), + [PROCESS_GIGABYTES] = ColorPair(Green, White), + [PROCESS_BASENAME] = ColorPair(Blue, White), + [PROCESS_TREE] = ColorPair(Green, White), + [PROCESS_R_STATE] = ColorPair(Green, White), + [PROCESS_D_STATE] = A_BOLD | ColorPair(Red, White), + [PROCESS_HIGH_PRIORITY] = ColorPair(Red, White), + [PROCESS_LOW_PRIORITY] = ColorPair(Green, White), + [PROCESS_THREAD] = ColorPair(Blue, White), + [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue, White), + [BAR_BORDER] = ColorPair(Blue, White), + [BAR_SHADOW] = ColorPair(Black, White), + [SWAP] = ColorPair(Red, White), + [GRAPH_1] = A_BOLD | ColorPair(Blue, White), + [GRAPH_2] = ColorPair(Blue, White), + [MEMORY_USED] = ColorPair(Green, White), + [MEMORY_BUFFERS] = ColorPair(Cyan, White), + [MEMORY_BUFFERS_TEXT] = ColorPair(Cyan, White), + [MEMORY_CACHE] = ColorPair(Yellow, White), + [LOAD_AVERAGE_FIFTEEN] = ColorPair(Black, White), + [LOAD_AVERAGE_FIVE] = ColorPair(Black, White), + [LOAD_AVERAGE_ONE] = ColorPair(Black, White), + [LOAD] = ColorPair(Black, White), + [HELP_BOLD] = ColorPair(Blue, White), + [CLOCK] = ColorPair(Black, White), + [DATE] = ColorPair(Black, White), + [DATETIME] = ColorPair(Black, White), + [CHECK_BOX] = ColorPair(Blue, White), + [CHECK_MARK] = ColorPair(Black, White), + [CHECK_TEXT] = ColorPair(Black, White), + [HOSTNAME] = ColorPair(Black, White), + [CPU_NICE] = ColorPair(Cyan, White), + [CPU_NICE_TEXT] = ColorPair(Cyan, White), + [CPU_NORMAL] = ColorPair(Green, White), + [CPU_SYSTEM] = ColorPair(Red, White), + [CPU_IOWAIT] = A_BOLD | ColorPair(Black, White), + [CPU_IRQ] = ColorPair(Blue, White), + [CPU_SOFTIRQ] = ColorPair(Blue, White), + [CPU_STEAL] = ColorPair(Cyan, White), + [CPU_GUEST] = ColorPair(Cyan, White), + [PRESSURE_STALL_THREEHUNDRED] = ColorPair(Black, White), + [PRESSURE_STALL_SIXTY] = ColorPair(Black, White), + [PRESSURE_STALL_TEN] = ColorPair(Black, White), + [ZFS_MFU] = ColorPair(Cyan, White), + [ZFS_MRU] = ColorPair(Yellow, White), + [ZFS_ANON] = ColorPair(Magenta, White), + [ZFS_HEADER] = ColorPair(Yellow, White), + [ZFS_OTHER] = ColorPair(Magenta, White), + [ZFS_COMPRESSED] = ColorPair(Cyan, White), + [ZFS_RATIO] = ColorPair(Magenta, White), + [ZRAM] = ColorPair(Yellow, White) }, [COLORSCHEME_LIGHTTERMINAL] = { - [RESET_COLOR] = ColorPair(Blue,Black), - [DEFAULT_COLOR] = ColorPair(Blue,Black), - [FUNCTION_BAR] = ColorPair(Black,Cyan), - [FUNCTION_KEY] = ColorPair(Blue,Black), - [PANEL_HEADER_FOCUS] = ColorPair(Black,Green), - [PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green), - [PANEL_SELECTION_FOCUS] = ColorPair(Black,Cyan), - [PANEL_SELECTION_FOLLOW] = ColorPair(Black,Yellow), - [PANEL_SELECTION_UNFOCUS] = ColorPair(Blue,Black), - [FAILED_SEARCH] = ColorPair(Red,Cyan), - [PAUSED] = A_BOLD | ColorPair(Yellow,Cyan), - [UPTIME] = ColorPair(Yellow,Black), - [BATTERY] = ColorPair(Yellow,Black), - [LARGE_NUMBER] = ColorPair(Red,Black), - [METER_TEXT] = ColorPair(Blue,Black), - [METER_VALUE] = ColorPair(Blue,Black), - [METER_VALUE_ERROR] = A_BOLD | ColorPair(Red,Black), - [METER_VALUE_NOTICE] = A_BOLD | ColorPair(Yellow,Black), - [METER_VALUE_IOREAD] = ColorPair(Green,Black), - [METER_VALUE_IOWRITE] = ColorPair(Yellow,Black), - [LED_COLOR] = ColorPair(Green,Black), - [TASKS_RUNNING] = ColorPair(Green,Black), - [PROCESS] = ColorPair(Blue,Black), + [RESET_COLOR] = ColorPair(Blue, Black), + [DEFAULT_COLOR] = ColorPair(Blue, Black), + [FUNCTION_BAR] = ColorPair(Black, Cyan), + [FUNCTION_KEY] = ColorPair(Blue, Black), + [PANEL_HEADER_FOCUS] = ColorPair(Black, Green), + [PANEL_HEADER_UNFOCUS] = ColorPair(Black, Green), + [PANEL_SELECTION_FOCUS] = ColorPair(Black, Cyan), + [PANEL_SELECTION_FOLLOW] = ColorPair(Black, Yellow), + [PANEL_SELECTION_UNFOCUS] = ColorPair(Blue, Black), + [FAILED_SEARCH] = ColorPair(Red, Cyan), + [PAUSED] = A_BOLD | ColorPair(Yellow, Cyan), + [UPTIME] = ColorPair(Yellow, Black), + [BATTERY] = ColorPair(Yellow, Black), + [LARGE_NUMBER] = ColorPair(Red, Black), + [METER_TEXT] = ColorPair(Blue, Black), + [METER_VALUE] = ColorPair(Blue, Black), + [METER_VALUE_ERROR] = A_BOLD | ColorPair(Red, Black), + [METER_VALUE_NOTICE] = A_BOLD | ColorPair(Yellow, Black), + [METER_VALUE_IOREAD] = ColorPair(Green, Black), + [METER_VALUE_IOWRITE] = ColorPair(Yellow, Black), + [LED_COLOR] = ColorPair(Green, Black), + [TASKS_RUNNING] = ColorPair(Green, Black), + [PROCESS] = ColorPair(Blue, Black), [PROCESS_SHADOW] = A_BOLD | ColorPairGrayBlack, - [PROCESS_TAG] = ColorPair(Yellow,Blue), - [PROCESS_MEGABYTES] = ColorPair(Blue,Black), - [PROCESS_GIGABYTES] = ColorPair(Green,Black), - [PROCESS_BASENAME] = ColorPair(Green,Black), - [PROCESS_TREE] = ColorPair(Blue,Black), - [PROCESS_R_STATE] = ColorPair(Green,Black), - [PROCESS_D_STATE] = A_BOLD | ColorPair(Red,Black), - [PROCESS_HIGH_PRIORITY] = ColorPair(Red,Black), - [PROCESS_LOW_PRIORITY] = ColorPair(Green,Black), - [PROCESS_THREAD] = ColorPair(Blue,Black), - [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue,Black), - [BAR_BORDER] = ColorPair(Blue,Black), + [PROCESS_TAG] = ColorPair(Yellow, Blue), + [PROCESS_MEGABYTES] = ColorPair(Blue, Black), + [PROCESS_GIGABYTES] = ColorPair(Green, Black), + [PROCESS_BASENAME] = ColorPair(Green, Black), + [PROCESS_TREE] = ColorPair(Blue, Black), + [PROCESS_R_STATE] = ColorPair(Green, Black), + [PROCESS_D_STATE] = A_BOLD | ColorPair(Red, Black), + [PROCESS_HIGH_PRIORITY] = ColorPair(Red, Black), + [PROCESS_LOW_PRIORITY] = ColorPair(Green, Black), + [PROCESS_THREAD] = ColorPair(Blue, Black), + [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue, Black), + [BAR_BORDER] = ColorPair(Blue, Black), [BAR_SHADOW] = ColorPairGrayBlack, - [SWAP] = ColorPair(Red,Black), - [GRAPH_1] = A_BOLD | ColorPair(Cyan,Black), - [GRAPH_2] = ColorPair(Cyan,Black), - [MEMORY_USED] = ColorPair(Green,Black), - [MEMORY_BUFFERS] = ColorPair(Cyan,Black), - [MEMORY_BUFFERS_TEXT] = ColorPair(Cyan,Black), - [MEMORY_CACHE] = ColorPair(Yellow,Black), - [LOAD_AVERAGE_FIFTEEN] = ColorPair(Blue,Black), - [LOAD_AVERAGE_FIVE] = ColorPair(Blue,Black), - [LOAD_AVERAGE_ONE] = ColorPair(Yellow,Black), - [LOAD] = ColorPair(Yellow,Black), - [HELP_BOLD] = ColorPair(Blue,Black), - [CLOCK] = ColorPair(Yellow,Black), - [DATE] = ColorPair(White,Black), - [DATETIME] = ColorPair(White,Black), - [CHECK_BOX] = ColorPair(Blue,Black), - [CHECK_MARK] = ColorPair(Blue,Black), - [CHECK_TEXT] = ColorPair(Blue,Black), - [HOSTNAME] = ColorPair(Yellow,Black), - [CPU_NICE] = ColorPair(Cyan,Black), - [CPU_NICE_TEXT] = ColorPair(Cyan,Black), - [CPU_NORMAL] = ColorPair(Green,Black), - [CPU_SYSTEM] = ColorPair(Red,Black), - [CPU_IOWAIT] = A_BOLD | ColorPair(Blue,Black), - [CPU_IRQ] = A_BOLD | ColorPair(Blue,Black), - [CPU_SOFTIRQ] = ColorPair(Blue,Black), - [CPU_STEAL] = ColorPair(Blue,Black), - [CPU_GUEST] = ColorPair(Blue,Black), - [PRESSURE_STALL_THREEHUNDRED] = ColorPair(Blue,Black), - [PRESSURE_STALL_SIXTY] = ColorPair(Blue,Black), - [PRESSURE_STALL_TEN] = ColorPair(Blue,Black), - [ZFS_MFU] = ColorPair(Cyan,Black), - [ZFS_MRU] = ColorPair(Yellow,Black), - [ZFS_ANON] = A_BOLD | ColorPair(Magenta,Black), - [ZFS_HEADER] = ColorPair(Blue,Black), - [ZFS_OTHER] = A_BOLD | ColorPair(Magenta,Black), - [ZFS_COMPRESSED] = ColorPair(Cyan,Black), - [ZFS_RATIO] = A_BOLD | ColorPair(Magenta,Black), - [ZRAM] = ColorPair(Yellow,Black), + [SWAP] = ColorPair(Red, Black), + [GRAPH_1] = A_BOLD | ColorPair(Cyan, Black), + [GRAPH_2] = ColorPair(Cyan, Black), + [MEMORY_USED] = ColorPair(Green, Black), + [MEMORY_BUFFERS] = ColorPair(Cyan, Black), + [MEMORY_BUFFERS_TEXT] = ColorPair(Cyan, Black), + [MEMORY_CACHE] = ColorPair(Yellow, Black), + [LOAD_AVERAGE_FIFTEEN] = ColorPair(Blue, Black), + [LOAD_AVERAGE_FIVE] = ColorPair(Blue, Black), + [LOAD_AVERAGE_ONE] = ColorPair(Yellow, Black), + [LOAD] = ColorPair(Yellow, Black), + [HELP_BOLD] = ColorPair(Blue, Black), + [CLOCK] = ColorPair(Yellow, Black), + [DATE] = ColorPair(White, Black), + [DATETIME] = ColorPair(White, Black), + [CHECK_BOX] = ColorPair(Blue, Black), + [CHECK_MARK] = ColorPair(Blue, Black), + [CHECK_TEXT] = ColorPair(Blue, Black), + [HOSTNAME] = ColorPair(Yellow, Black), + [CPU_NICE] = ColorPair(Cyan, Black), + [CPU_NICE_TEXT] = ColorPair(Cyan, Black), + [CPU_NORMAL] = ColorPair(Green, Black), + [CPU_SYSTEM] = ColorPair(Red, Black), + [CPU_IOWAIT] = A_BOLD | ColorPair(Blue, Black), + [CPU_IRQ] = A_BOLD | ColorPair(Blue, Black), + [CPU_SOFTIRQ] = ColorPair(Blue, Black), + [CPU_STEAL] = ColorPair(Blue, Black), + [CPU_GUEST] = ColorPair(Blue, Black), + [PRESSURE_STALL_THREEHUNDRED] = ColorPair(Blue, Black), + [PRESSURE_STALL_SIXTY] = ColorPair(Blue, Black), + [PRESSURE_STALL_TEN] = ColorPair(Blue, Black), + [ZFS_MFU] = ColorPair(Cyan, Black), + [ZFS_MRU] = ColorPair(Yellow, Black), + [ZFS_ANON] = A_BOLD | ColorPair(Magenta, Black), + [ZFS_HEADER] = ColorPair(Blue, Black), + [ZFS_OTHER] = A_BOLD | ColorPair(Magenta, Black), + [ZFS_COMPRESSED] = ColorPair(Cyan, Black), + [ZFS_RATIO] = A_BOLD | ColorPair(Magenta, Black), + [ZRAM] = ColorPair(Yellow, Black), }, [COLORSCHEME_MIDNIGHT] = { - [RESET_COLOR] = ColorPair(White,Blue), - [DEFAULT_COLOR] = ColorPair(White,Blue), - [FUNCTION_BAR] = ColorPair(Black,Cyan), + [RESET_COLOR] = ColorPair(White, Blue), + [DEFAULT_COLOR] = ColorPair(White, Blue), + [FUNCTION_BAR] = ColorPair(Black, Cyan), [FUNCTION_KEY] = A_NORMAL, - [PANEL_HEADER_FOCUS] = ColorPair(Black,Cyan), - [PANEL_HEADER_UNFOCUS] = ColorPair(Black,Cyan), - [PANEL_SELECTION_FOCUS] = ColorPair(Black,White), - [PANEL_SELECTION_FOLLOW] = ColorPair(Black,Yellow), - [PANEL_SELECTION_UNFOCUS] = A_BOLD | ColorPair(Yellow,Blue), - [FAILED_SEARCH] = ColorPair(Red,Cyan), - [PAUSED] = A_BOLD | ColorPair(Yellow,Cyan), - [UPTIME] = A_BOLD | ColorPair(Yellow,Blue), - [BATTERY] = A_BOLD | ColorPair(Yellow,Blue), - [LARGE_NUMBER] = A_BOLD | ColorPair(Red,Blue), - [METER_TEXT] = ColorPair(Cyan,Blue), - [METER_VALUE] = A_BOLD | ColorPair(Cyan,Blue), - [METER_VALUE_ERROR] = A_BOLD | ColorPair(Red,Blue), - [METER_VALUE_NOTICE] = A_BOLD | ColorPair(White,Blue), - [METER_VALUE_IOREAD] = ColorPair(Green,Blue), - [METER_VALUE_IOWRITE] = ColorPair(Black,Blue), - [LED_COLOR] = ColorPair(Green,Blue), - [TASKS_RUNNING] = A_BOLD | ColorPair(Green,Blue), - [PROCESS] = ColorPair(White,Blue), - [PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Blue), - [PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Blue), - [PROCESS_MEGABYTES] = ColorPair(Cyan,Blue), - [PROCESS_GIGABYTES] = ColorPair(Green,Blue), - [PROCESS_BASENAME] = A_BOLD | ColorPair(Cyan,Blue), - [PROCESS_TREE] = ColorPair(Cyan,Blue), - [PROCESS_R_STATE] = ColorPair(Green,Blue), - [PROCESS_D_STATE] = A_BOLD | ColorPair(Red,Blue), - [PROCESS_HIGH_PRIORITY] = ColorPair(Red,Blue), - [PROCESS_LOW_PRIORITY] = ColorPair(Green,Blue), - [PROCESS_THREAD] = ColorPair(Green,Blue), - [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Green,Blue), - [BAR_BORDER] = A_BOLD | ColorPair(Yellow,Blue), - [BAR_SHADOW] = ColorPair(Cyan,Blue), - [SWAP] = ColorPair(Red,Blue), - [GRAPH_1] = A_BOLD | ColorPair(Cyan,Blue), - [GRAPH_2] = ColorPair(Cyan,Blue), - [MEMORY_USED] = A_BOLD | ColorPair(Green,Blue), - [MEMORY_BUFFERS] = A_BOLD | ColorPair(Cyan,Blue), - [MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Cyan,Blue), - [MEMORY_CACHE] = A_BOLD | ColorPair(Yellow,Blue), - [LOAD_AVERAGE_FIFTEEN] = A_BOLD | ColorPair(Black,Blue), - [LOAD_AVERAGE_FIVE] = A_NORMAL | ColorPair(White,Blue), - [LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(White,Blue), - [LOAD] = A_BOLD | ColorPair(White,Blue), - [HELP_BOLD] = A_BOLD | ColorPair(Cyan,Blue), - [CLOCK] = ColorPair(White,Blue), - [DATE] = ColorPair(White,Blue), - [DATETIME] = ColorPair(White,Blue), - [CHECK_BOX] = ColorPair(Cyan,Blue), - [CHECK_MARK] = A_BOLD | ColorPair(White,Blue), - [CHECK_TEXT] = A_NORMAL | ColorPair(White,Blue), - [HOSTNAME] = ColorPair(White,Blue), - [CPU_NICE] = A_BOLD | ColorPair(Cyan,Blue), - [CPU_NICE_TEXT] = A_BOLD | ColorPair(Cyan,Blue), - [CPU_NORMAL] = A_BOLD | ColorPair(Green,Blue), - [CPU_SYSTEM] = A_BOLD | ColorPair(Red,Blue), - [CPU_IOWAIT] = A_BOLD | ColorPair(Black,Blue), - [CPU_IRQ] = A_BOLD | ColorPair(Black,Blue), - [CPU_SOFTIRQ] = ColorPair(Black,Blue), - [CPU_STEAL] = ColorPair(White,Blue), - [CPU_GUEST] = ColorPair(White,Blue), - [PRESSURE_STALL_THREEHUNDRED] = A_BOLD | ColorPair(Black,Blue), - [PRESSURE_STALL_SIXTY] = A_NORMAL | ColorPair(White,Blue), - [PRESSURE_STALL_TEN] = A_BOLD | ColorPair(White,Blue), - [ZFS_MFU] = A_BOLD | ColorPair(White,Blue), - [ZFS_MRU] = A_BOLD | ColorPair(Yellow,Blue), - [ZFS_ANON] = A_BOLD | ColorPair(Magenta,Blue), - [ZFS_HEADER] = A_BOLD | ColorPair(Yellow,Blue), - [ZFS_OTHER] = A_BOLD | ColorPair(Magenta,Blue), - [ZFS_COMPRESSED] = A_BOLD | ColorPair(White,Blue), - [ZFS_RATIO] = A_BOLD | ColorPair(Magenta,Blue), - [ZRAM] = A_BOLD | ColorPair(Yellow,Blue), + [PANEL_HEADER_FOCUS] = ColorPair(Black, Cyan), + [PANEL_HEADER_UNFOCUS] = ColorPair(Black, Cyan), + [PANEL_SELECTION_FOCUS] = ColorPair(Black, White), + [PANEL_SELECTION_FOLLOW] = ColorPair(Black, Yellow), + [PANEL_SELECTION_UNFOCUS] = A_BOLD | ColorPair(Yellow, Blue), + [FAILED_SEARCH] = ColorPair(Red, Cyan), + [PAUSED] = A_BOLD | ColorPair(Yellow, Cyan), + [UPTIME] = A_BOLD | ColorPair(Yellow, Blue), + [BATTERY] = A_BOLD | ColorPair(Yellow, Blue), + [LARGE_NUMBER] = A_BOLD | ColorPair(Red, Blue), + [METER_TEXT] = ColorPair(Cyan, Blue), + [METER_VALUE] = A_BOLD | ColorPair(Cyan, Blue), + [METER_VALUE_ERROR] = A_BOLD | ColorPair(Red, Blue), + [METER_VALUE_NOTICE] = A_BOLD | ColorPair(White, Blue), + [METER_VALUE_IOREAD] = ColorPair(Green, Blue), + [METER_VALUE_IOWRITE] = ColorPair(Black, Blue), + [LED_COLOR] = ColorPair(Green, Blue), + [TASKS_RUNNING] = A_BOLD | ColorPair(Green, Blue), + [PROCESS] = ColorPair(White, Blue), + [PROCESS_SHADOW] = A_BOLD | ColorPair(Black, Blue), + [PROCESS_TAG] = A_BOLD | ColorPair(Yellow, Blue), + [PROCESS_MEGABYTES] = ColorPair(Cyan, Blue), + [PROCESS_GIGABYTES] = ColorPair(Green, Blue), + [PROCESS_BASENAME] = A_BOLD | ColorPair(Cyan, Blue), + [PROCESS_TREE] = ColorPair(Cyan, Blue), + [PROCESS_R_STATE] = ColorPair(Green, Blue), + [PROCESS_D_STATE] = A_BOLD | ColorPair(Red, Blue), + [PROCESS_HIGH_PRIORITY] = ColorPair(Red, Blue), + [PROCESS_LOW_PRIORITY] = ColorPair(Green, Blue), + [PROCESS_THREAD] = ColorPair(Green, Blue), + [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Green, Blue), + [BAR_BORDER] = A_BOLD | ColorPair(Yellow, Blue), + [BAR_SHADOW] = ColorPair(Cyan, Blue), + [SWAP] = ColorPair(Red, Blue), + [GRAPH_1] = A_BOLD | ColorPair(Cyan, Blue), + [GRAPH_2] = ColorPair(Cyan, Blue), + [MEMORY_USED] = A_BOLD | ColorPair(Green, Blue), + [MEMORY_BUFFERS] = A_BOLD | ColorPair(Cyan, Blue), + [MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Cyan, Blue), + [MEMORY_CACHE] = A_BOLD | ColorPair(Yellow, Blue), + [LOAD_AVERAGE_FIFTEEN] = A_BOLD | ColorPair(Black, Blue), + [LOAD_AVERAGE_FIVE] = A_NORMAL | ColorPair(White, Blue), + [LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(White, Blue), + [LOAD] = A_BOLD | ColorPair(White, Blue), + [HELP_BOLD] = A_BOLD | ColorPair(Cyan, Blue), + [CLOCK] = ColorPair(White, Blue), + [DATE] = ColorPair(White, Blue), + [DATETIME] = ColorPair(White, Blue), + [CHECK_BOX] = ColorPair(Cyan, Blue), + [CHECK_MARK] = A_BOLD | ColorPair(White, Blue), + [CHECK_TEXT] = A_NORMAL | ColorPair(White, Blue), + [HOSTNAME] = ColorPair(White, Blue), + [CPU_NICE] = A_BOLD | ColorPair(Cyan, Blue), + [CPU_NICE_TEXT] = A_BOLD | ColorPair(Cyan, Blue), + [CPU_NORMAL] = A_BOLD | ColorPair(Green, Blue), + [CPU_SYSTEM] = A_BOLD | ColorPair(Red, Blue), + [CPU_IOWAIT] = A_BOLD | ColorPair(Black, Blue), + [CPU_IRQ] = A_BOLD | ColorPair(Black, Blue), + [CPU_SOFTIRQ] = ColorPair(Black, Blue), + [CPU_STEAL] = ColorPair(White, Blue), + [CPU_GUEST] = ColorPair(White, Blue), + [PRESSURE_STALL_THREEHUNDRED] = A_BOLD | ColorPair(Black, Blue), + [PRESSURE_STALL_SIXTY] = A_NORMAL | ColorPair(White, Blue), + [PRESSURE_STALL_TEN] = A_BOLD | ColorPair(White, Blue), + [ZFS_MFU] = A_BOLD | ColorPair(White, Blue), + [ZFS_MRU] = A_BOLD | ColorPair(Yellow, Blue), + [ZFS_ANON] = A_BOLD | ColorPair(Magenta, Blue), + [ZFS_HEADER] = A_BOLD | ColorPair(Yellow, Blue), + [ZFS_OTHER] = A_BOLD | ColorPair(Magenta, Blue), + [ZFS_COMPRESSED] = A_BOLD | ColorPair(White, Blue), + [ZFS_RATIO] = A_BOLD | ColorPair(Magenta, Blue), + [ZRAM] = A_BOLD | ColorPair(Yellow, Blue), }, [COLORSCHEME_BLACKNIGHT] = { - [RESET_COLOR] = ColorPair(Cyan,Black), - [DEFAULT_COLOR] = ColorPair(Cyan,Black), - [FUNCTION_BAR] = ColorPair(Black,Green), - [FUNCTION_KEY] = ColorPair(Cyan,Black), - [PANEL_HEADER_FOCUS] = ColorPair(Black,Green), - [PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green), - [PANEL_SELECTION_FOCUS] = ColorPair(Black,Cyan), - [PANEL_SELECTION_FOLLOW] = ColorPair(Black,Yellow), - [PANEL_SELECTION_UNFOCUS] = ColorPair(Black,White), - [FAILED_SEARCH] = ColorPair(Red,Green), - [PAUSED] = A_BOLD | ColorPair(Yellow,Green), - [UPTIME] = ColorPair(Green,Black), - [BATTERY] = ColorPair(Green,Black), - [LARGE_NUMBER] = A_BOLD | ColorPair(Red,Black), - [METER_TEXT] = ColorPair(Cyan,Black), - [METER_VALUE] = ColorPair(Green,Black), - [METER_VALUE_ERROR] = A_BOLD | ColorPair(Red,Black), - [METER_VALUE_NOTICE] = A_BOLD | ColorPair(Yellow,Black), - [METER_VALUE_IOREAD] = ColorPair(Green,Black), - [METER_VALUE_IOWRITE] = ColorPair(Blue,Black), - [LED_COLOR] = ColorPair(Green,Black), - [TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black), - [PROCESS] = ColorPair(Cyan,Black), + [RESET_COLOR] = ColorPair(Cyan, Black), + [DEFAULT_COLOR] = ColorPair(Cyan, Black), + [FUNCTION_BAR] = ColorPair(Black, Green), + [FUNCTION_KEY] = ColorPair(Cyan, Black), + [PANEL_HEADER_FOCUS] = ColorPair(Black, Green), + [PANEL_HEADER_UNFOCUS] = ColorPair(Black, Green), + [PANEL_SELECTION_FOCUS] = ColorPair(Black, Cyan), + [PANEL_SELECTION_FOLLOW] = ColorPair(Black, Yellow), + [PANEL_SELECTION_UNFOCUS] = ColorPair(Black, White), + [FAILED_SEARCH] = ColorPair(Red, Green), + [PAUSED] = A_BOLD | ColorPair(Yellow, Green), + [UPTIME] = ColorPair(Green, Black), + [BATTERY] = ColorPair(Green, Black), + [LARGE_NUMBER] = A_BOLD | ColorPair(Red, Black), + [METER_TEXT] = ColorPair(Cyan, Black), + [METER_VALUE] = ColorPair(Green, Black), + [METER_VALUE_ERROR] = A_BOLD | ColorPair(Red, Black), + [METER_VALUE_NOTICE] = A_BOLD | ColorPair(Yellow, Black), + [METER_VALUE_IOREAD] = ColorPair(Green, Black), + [METER_VALUE_IOWRITE] = ColorPair(Blue, Black), + [LED_COLOR] = ColorPair(Green, Black), + [TASKS_RUNNING] = A_BOLD | ColorPair(Green, Black), + [PROCESS] = ColorPair(Cyan, Black), [PROCESS_SHADOW] = A_BOLD | ColorPairGrayBlack, - [PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black), - [PROCESS_MEGABYTES] = A_BOLD | ColorPair(Green,Black), - [PROCESS_GIGABYTES] = A_BOLD | ColorPair(Yellow,Black), - [PROCESS_BASENAME] = A_BOLD | ColorPair(Green,Black), - [PROCESS_TREE] = ColorPair(Cyan,Black), - [PROCESS_THREAD] = ColorPair(Green,Black), - [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue,Black), - [PROCESS_R_STATE] = ColorPair(Green,Black), - [PROCESS_D_STATE] = A_BOLD | ColorPair(Red,Black), - [PROCESS_HIGH_PRIORITY] = ColorPair(Red,Black), - [PROCESS_LOW_PRIORITY] = ColorPair(Green,Black), - [BAR_BORDER] = A_BOLD | ColorPair(Green,Black), - [BAR_SHADOW] = ColorPair(Cyan,Black), - [SWAP] = ColorPair(Red,Black), - [GRAPH_1] = A_BOLD | ColorPair(Green,Black), - [GRAPH_2] = ColorPair(Green,Black), - [MEMORY_USED] = ColorPair(Green,Black), - [MEMORY_BUFFERS] = ColorPair(Blue,Black), - [MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Blue,Black), - [MEMORY_CACHE] = ColorPair(Yellow,Black), - [LOAD_AVERAGE_FIFTEEN] = ColorPair(Green,Black), - [LOAD_AVERAGE_FIVE] = ColorPair(Green,Black), - [LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(Green,Black), + [PROCESS_TAG] = A_BOLD | ColorPair(Yellow, Black), + [PROCESS_MEGABYTES] = A_BOLD | ColorPair(Green, Black), + [PROCESS_GIGABYTES] = A_BOLD | ColorPair(Yellow, Black), + [PROCESS_BASENAME] = A_BOLD | ColorPair(Green, Black), + [PROCESS_TREE] = ColorPair(Cyan, Black), + [PROCESS_THREAD] = ColorPair(Green, Black), + [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue, Black), + [PROCESS_R_STATE] = ColorPair(Green, Black), + [PROCESS_D_STATE] = A_BOLD | ColorPair(Red, Black), + [PROCESS_HIGH_PRIORITY] = ColorPair(Red, Black), + [PROCESS_LOW_PRIORITY] = ColorPair(Green, Black), + [BAR_BORDER] = A_BOLD | ColorPair(Green, Black), + [BAR_SHADOW] = ColorPair(Cyan, Black), + [SWAP] = ColorPair(Red, Black), + [GRAPH_1] = A_BOLD | ColorPair(Green, Black), + [GRAPH_2] = ColorPair(Green, Black), + [MEMORY_USED] = ColorPair(Green, Black), + [MEMORY_BUFFERS] = ColorPair(Blue, Black), + [MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Blue, Black), + [MEMORY_CACHE] = ColorPair(Yellow, Black), + [LOAD_AVERAGE_FIFTEEN] = ColorPair(Green, Black), + [LOAD_AVERAGE_FIVE] = ColorPair(Green, Black), + [LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(Green, Black), [LOAD] = A_BOLD, - [HELP_BOLD] = A_BOLD | ColorPair(Cyan,Black), - [CLOCK] = ColorPair(Green,Black), - [CHECK_BOX] = ColorPair(Green,Black), - [CHECK_MARK] = A_BOLD | ColorPair(Green,Black), - [CHECK_TEXT] = ColorPair(Cyan,Black), - [HOSTNAME] = ColorPair(Green,Black), - [CPU_NICE] = ColorPair(Blue,Black), - [CPU_NICE_TEXT] = A_BOLD | ColorPair(Blue,Black), - [CPU_NORMAL] = ColorPair(Green,Black), - [CPU_SYSTEM] = ColorPair(Red,Black), - [CPU_IOWAIT] = ColorPair(Yellow,Black), - [CPU_IRQ] = A_BOLD | ColorPair(Blue,Black), - [CPU_SOFTIRQ] = ColorPair(Blue,Black), - [CPU_STEAL] = ColorPair(Cyan,Black), - [CPU_GUEST] = ColorPair(Cyan,Black), - [PRESSURE_STALL_THREEHUNDRED] = ColorPair(Green,Black), - [PRESSURE_STALL_SIXTY] = ColorPair(Green,Black), - [PRESSURE_STALL_TEN] = A_BOLD | ColorPair(Green,Black), - [ZFS_MFU] = ColorPair(Blue,Black), - [ZFS_MRU] = ColorPair(Yellow,Black), - [ZFS_ANON] = ColorPair(Magenta,Black), - [ZFS_HEADER] = ColorPair(Yellow,Black), - [ZFS_OTHER] = ColorPair(Magenta,Black), - [ZFS_COMPRESSED] = ColorPair(Blue,Black), - [ZFS_RATIO] = ColorPair(Magenta,Black), - [ZRAM] = ColorPair(Yellow,Black), + [HELP_BOLD] = A_BOLD | ColorPair(Cyan, Black), + [CLOCK] = ColorPair(Green, Black), + [CHECK_BOX] = ColorPair(Green, Black), + [CHECK_MARK] = A_BOLD | ColorPair(Green, Black), + [CHECK_TEXT] = ColorPair(Cyan, Black), + [HOSTNAME] = ColorPair(Green, Black), + [CPU_NICE] = ColorPair(Blue, Black), + [CPU_NICE_TEXT] = A_BOLD | ColorPair(Blue, Black), + [CPU_NORMAL] = ColorPair(Green, Black), + [CPU_SYSTEM] = ColorPair(Red, Black), + [CPU_IOWAIT] = ColorPair(Yellow, Black), + [CPU_IRQ] = A_BOLD | ColorPair(Blue, Black), + [CPU_SOFTIRQ] = ColorPair(Blue, Black), + [CPU_STEAL] = ColorPair(Cyan, Black), + [CPU_GUEST] = ColorPair(Cyan, Black), + [PRESSURE_STALL_THREEHUNDRED] = ColorPair(Green, Black), + [PRESSURE_STALL_SIXTY] = ColorPair(Green, Black), + [PRESSURE_STALL_TEN] = A_BOLD | ColorPair(Green, Black), + [ZFS_MFU] = ColorPair(Blue, Black), + [ZFS_MRU] = ColorPair(Yellow, Black), + [ZFS_ANON] = ColorPair(Magenta, Black), + [ZFS_HEADER] = ColorPair(Yellow, Black), + [ZFS_OTHER] = ColorPair(Magenta, Black), + [ZFS_COMPRESSED] = ColorPair(Blue, Black), + [ZFS_RATIO] = ColorPair(Magenta, Black), + [ZRAM] = ColorPair(Yellow, Black), }, [COLORSCHEME_BROKENGRAY] = { 0 } // dynamically generated. }; @@ -610,7 +610,7 @@ void CRT_init(int delay, int colorScheme, bool allowUnicode) { for (int i = 0; i < LAST_COLORELEMENT; i++) { unsigned int color = CRT_colorSchemes[COLORSCHEME_DEFAULT][i]; - CRT_colorSchemes[COLORSCHEME_BROKENGRAY][i] = color == (A_BOLD | ColorPairGrayBlack) ? ColorPair(White,Black) : color; + CRT_colorSchemes[COLORSCHEME_BROKENGRAY][i] = color == (A_BOLD | ColorPairGrayBlack) ? ColorPair(White, Black) : color; } halfdelay(CRT_delay); @@ -649,7 +649,7 @@ void CRT_init(int delay, int colorScheme, bool allowUnicode) { struct sigaction act; sigemptyset (&act.sa_mask); - act.sa_flags = (int)SA_RESETHAND|SA_NODEFER; + act.sa_flags = (int)SA_RESETHAND | SA_NODEFER; act.sa_handler = CRT_handleSIGSEGV; sigaction (SIGSEGV, &act, &old_sig_handler[SIGSEGV]); sigaction (SIGFPE, &act, &old_sig_handler[SIGFPE]); @@ -732,11 +732,11 @@ void CRT_setColors(int colorScheme) { for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { - if (ColorIndex(i,j) != ColorPairGrayBlack) { + if (ColorIndex(i, j) != ColorPairGrayBlack) { int bg = (colorScheme != COLORSCHEME_BLACKNIGHT) - ? (j==0 ? -1 : j) + ? (j == 0 ? -1 : j) : j; - init_pair(ColorIndex(i,j), i, bg); + init_pair(ColorIndex(i, j), i, bg); } } } diff --git a/CRT.h b/CRT.h index 49ed4ed0..fccf65c1 100644 --- a/CRT.h +++ b/CRT.h @@ -133,7 +133,7 @@ extern bool CRT_utf8; #endif -extern const char *const *CRT_treeStr; +extern const char* const* CRT_treeStr; extern int CRT_delay; diff --git a/ClockMeter.c b/ClockMeter.c index c6f2ab33..3cc9dd03 100644 --- a/ClockMeter.c +++ b/ClockMeter.c @@ -22,7 +22,7 @@ static const int ClockMeter_attributes[] = { static void ClockMeter_updateValues(Meter* this, char* buffer, int size) { time_t t = time(NULL); struct tm result; - struct tm *lt = localtime_r(&t, &result); + struct tm* lt = localtime_r(&t, &result); this->values[0] = lt->tm_hour * 60 + lt->tm_min; strftime(buffer, size, "%H:%M:%S", lt); } diff --git a/ColumnsPanel.c b/ColumnsPanel.c index 36127bd5..ffd4d0bb 100644 --- a/ColumnsPanel.c +++ b/ColumnsPanel.c @@ -139,7 +139,7 @@ void ColumnsPanel_update(Panel* super) { ColumnsPanel* this = (ColumnsPanel*) super; int size = Panel_size(super); this->settings->changed = true; - this->settings->fields = xRealloc(this->settings->fields, sizeof(ProcessField) * (size+1)); + this->settings->fields = xRealloc(this->settings->fields, sizeof(ProcessField) * (size + 1)); this->settings->flags = 0; for (int i = 0; i < size; i++) { int key = ((ListItem*) Panel_get(super, i))->key; diff --git a/DateMeter.c b/DateMeter.c index c1a097f6..bfe0cbf1 100644 --- a/DateMeter.c +++ b/DateMeter.c @@ -22,10 +22,10 @@ static const int DateMeter_attributes[] = { static void DateMeter_updateValues(Meter* this, char* buffer, int size) { time_t t = time(NULL); struct tm result; - struct tm *lt = localtime_r(&t, &result); + struct tm* lt = localtime_r(&t, &result); this->values[0] = lt->tm_yday; int year = lt->tm_year + 1900; - if (((year % 4 == 0) && (year % 100!= 0)) || (year%400 == 0)) { + if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) { this->total = 366; } else { diff --git a/DateTimeMeter.c b/DateTimeMeter.c index 74582191..ad5e81ea 100644 --- a/DateTimeMeter.c +++ b/DateTimeMeter.c @@ -22,9 +22,9 @@ static const int DateTimeMeter_attributes[] = { static void DateTimeMeter_updateValues(Meter* this, char* buffer, int size) { time_t t = time(NULL); struct tm result; - struct tm *lt = localtime_r(&t, &result); + struct tm* lt = localtime_r(&t, &result); int year = lt->tm_year + 1900; - if (((year % 4 == 0) && (year % 100!= 0)) || (year%400 == 0)) { + if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) { this->total = 366; } else { diff --git a/EnvScreen.c b/EnvScreen.c index cd8e0cb3..30faaaba 100644 --- a/EnvScreen.c +++ b/EnvScreen.c @@ -26,7 +26,7 @@ const InfoScreenClass EnvScreen_class = { EnvScreen* EnvScreen_new(Process* process) { EnvScreen* this = xMalloc(sizeof(EnvScreen)); Object_setClass(this, Class(EnvScreen)); - return (EnvScreen*) InfoScreen_init(&this->super, process, NULL, LINES-3, " "); + return (EnvScreen*) InfoScreen_init(&this->super, process, NULL, LINES - 3, " "); } void EnvScreen_delete(Object* this) { @@ -47,7 +47,7 @@ void EnvScreen_scan(InfoScreen* this) { char* env = Platform_getProcessEnv(this->process->pid); CRT_restorePrivileges(); if (env) { - for (char *p = env; *p; p = strrchr(p, 0)+1) + for (char* p = env; *p; p = strrchr(p, 0) + 1) InfoScreen_addLine(this, p); free(env); } diff --git a/FunctionBar.c b/FunctionBar.c index 9b454ac8..93456583 100644 --- a/FunctionBar.c +++ b/FunctionBar.c @@ -94,14 +94,14 @@ void FunctionBar_draw(const FunctionBar* this) { void FunctionBar_drawExtra(const FunctionBar* this, const char* buffer, int attr, bool setCursor) { attrset(CRT_colors[FUNCTION_BAR]); - mvhline(LINES-1, 0, ' ', COLS); + mvhline(LINES - 1, 0, ' ', COLS); int x = 0; for (int i = 0; i < this->size; i++) { attrset(CRT_colors[FUNCTION_KEY]); - mvaddstr(LINES-1, x, this->keys.constKeys[i]); + mvaddstr(LINES - 1, x, this->keys.constKeys[i]); x += strlen(this->keys.constKeys[i]); attrset(CRT_colors[FUNCTION_BAR]); - mvaddstr(LINES-1, x, this->functions[i]); + mvaddstr(LINES - 1, x, this->functions[i]); x += strlen(this->functions[i]); } @@ -110,7 +110,7 @@ void FunctionBar_drawExtra(const FunctionBar* this, const char* buffer, int attr attrset(CRT_colors[FUNCTION_BAR]); else attrset(attr); - mvaddstr(LINES-1, x, buffer); + mvaddstr(LINES - 1, x, buffer); attrset(CRT_colors[RESET_COLOR]); x += strlen(buffer); } @@ -130,7 +130,7 @@ void FunctionBar_append(const char* buffer, int attr) { attrset(CRT_colors[FUNCTION_BAR]); else attrset(attr); - mvaddstr(LINES-1, currentLen, buffer); + mvaddstr(LINES - 1, currentLen, buffer); attrset(CRT_colors[RESET_COLOR]); currentLen += strlen(buffer); diff --git a/Header.c b/Header.c index 3bb24c23..4448baa6 100644 --- a/Header.c +++ b/Header.c @@ -63,7 +63,7 @@ void Header_writeBackToSettings(const Header* this) { Vector* vec = this->columns[col]; int len = Vector_size(vec); - colSettings->names = xCalloc(len+1, sizeof(char*)); + colSettings->names = xCalloc(len + 1, sizeof(char*)); colSettings->modes = xCalloc(len, sizeof(int)); colSettings->len = len; diff --git a/HostnameMeter.c b/HostnameMeter.c index 6cf9e07e..000bc3fd 100644 --- a/HostnameMeter.c +++ b/HostnameMeter.c @@ -21,7 +21,7 @@ static const int HostnameMeter_attributes[] = { static void HostnameMeter_updateValues(Meter* this, char* buffer, int size) { (void) this; - gethostname(buffer, size-1); + gethostname(buffer, size - 1); } const MeterClass HostnameMeter_class = { diff --git a/IncSet.h b/IncSet.h index a6c1974e..b07840f7 100644 --- a/IncSet.h +++ b/IncSet.h @@ -22,7 +22,7 @@ typedef enum { } IncType; typedef struct IncMode_ { - char buffer[INCMODE_MAX+1]; + char buffer[INCMODE_MAX + 1]; int index; FunctionBar* bar; bool isFilter; diff --git a/InfoScreen.c b/InfoScreen.c index 7f4baa72..102f0ba7 100644 --- a/InfoScreen.c +++ b/InfoScreen.c @@ -65,21 +65,23 @@ void InfoScreen_addLine(InfoScreen* this, const char* line) { Vector_add(this->lines, (Object*) ListItem_new(line, 0)); const char* incFilter = IncSet_filter(this->inc); if (!incFilter || String_contains_i(line, incFilter)) - Panel_add(this->display, Vector_get(this->lines, Vector_size(this->lines)-1)); + Panel_add(this->display, Vector_get(this->lines, Vector_size(this->lines) - 1)); } void InfoScreen_appendLine(InfoScreen* this, const char* line) { - ListItem* last = (ListItem*)Vector_get(this->lines, Vector_size(this->lines)-1); + ListItem* last = (ListItem*)Vector_get(this->lines, Vector_size(this->lines) - 1); ListItem_append(last, line); const char* incFilter = IncSet_filter(this->inc); - if (incFilter && Panel_get(this->display, Panel_size(this->display)-1) != (Object*)last && String_contains_i(line, incFilter)) + if (incFilter && Panel_get(this->display, Panel_size(this->display) - 1) != (Object*)last && String_contains_i(line, incFilter)) Panel_add(this->display, (Object*)last); } void InfoScreen_run(InfoScreen* this) { Panel* panel = this->display; - if (As_InfoScreen(this)->scan) InfoScreen_scan(this); + if (As_InfoScreen(this)->scan) + InfoScreen_scan(this); + InfoScreen_draw(this); bool looping = true; @@ -88,7 +90,7 @@ void InfoScreen_run(InfoScreen* this) { Panel_draw(panel, true); if (this->inc->active) { - (void) move(LINES-1, CRT_cursorX); + (void) move(LINES - 1, CRT_cursorX); } set_escdelay(25); int ch = getch(); @@ -144,8 +146,9 @@ void InfoScreen_run(InfoScreen* this) { looping = false; break; case KEY_RESIZE: - Panel_resize(panel, COLS, LINES-2); - if (As_InfoScreen(this)->scan) InfoScreen_scan(this); + Panel_resize(panel, COLS, LINES - 2); + if (As_InfoScreen(this)->scan) + InfoScreen_scan(this); InfoScreen_draw(this); break; default: diff --git a/MainPanel.c b/MainPanel.c index 05a55e60..9322fe02 100644 --- a/MainPanel.c +++ b/MainPanel.c @@ -36,7 +36,7 @@ void MainPanel_updateTreeFunctions(MainPanel* this, bool mode) { void MainPanel_pidSearch(MainPanel* this, int ch) { Panel* super = (Panel*) this; - pid_t pid = ch-48 + this->pidSearch; + pid_t pid = ch - 48 + this->pidSearch; for (int i = 0; i < Panel_size(super); i++) { Process* p = (Process*) Panel_get(super, i); if (p && p->pid == pid) { @@ -153,7 +153,9 @@ bool MainPanel_foreachProcess(MainPanel* this, MainPanel_ForeachProcessFn fn, Ar } if (!anyTagged) { Process* p = (Process*) Panel_getSelected(super); - if (p) ok = fn(p, arg) && ok; + if (p) { + ok &= fn(p, arg); + } } if (wasAnyTagged) *wasAnyTagged = anyTagged; diff --git a/MainPanel.h b/MainPanel.h index 3c555294..03a1affd 100644 --- a/MainPanel.h +++ b/MainPanel.h @@ -24,7 +24,7 @@ typedef struct MainPanel_ { Panel super; State* state; IncSet* inc; - Htop_Action *keys; + Htop_Action* keys; pid_t pidSearch; } MainPanel; diff --git a/Meter.c b/Meter.c index 0cf7ee0b..d17ba95a 100644 --- a/Meter.c +++ b/Meter.c @@ -48,7 +48,7 @@ Meter* Meter_new(const struct ProcessList_* pl, int param, const MeterClass* typ } int Meter_humanUnit(char* buffer, unsigned long int value, int size) { - const char * prefix = "KMGTPEZY"; + const char* prefix = "KMGTPEZY"; unsigned long int powi = 1; unsigned int written, powj = 1, precision = 2; @@ -199,7 +199,7 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) { double value = this->values[i]; value = CLAMP(value, 0.0, this->total); if (value > 0) { - blockSizes[i] = ceil((value/this->total) * w); + blockSizes[i] = ceil((value / this->total) * w); } else { blockSizes[i] = 0; } @@ -285,11 +285,11 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) { struct timeval now; gettimeofday(&now, NULL); if (!timercmp(&now, &(data->time), <)) { - struct timeval delay = { .tv_sec = CRT_delay/10, .tv_usec = (CRT_delay-((CRT_delay/10)*10)) * 100000 }; + struct timeval delay = { .tv_sec = CRT_delay / 10, .tv_usec = (CRT_delay - ((CRT_delay / 10) * 10)) * 100000 }; timeradd(&now, &delay, &(data->time)); for (int i = 0; i < nValues - 1; i++) - data->values[i] = data->values[i+1]; + data->values[i] = data->values[i + 1]; char buffer[nValues]; Meter_updateValues(this, buffer, nValues - 1); @@ -301,15 +301,15 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) { data->values[nValues - 1] = value; } - int i = nValues - (w*2) + 2, k = 0; + int i = nValues - (w * 2) + 2, k = 0; if (i < 0) { - k = -i/2; + k = -i / 2; i = 0; } - for (; i < nValues - 1; i+=2, k++) { + for (; i < nValues - 1; i += 2, k++) { int pix = GraphMeterMode_pixPerRow * GRAPH_HEIGHT; int v1 = CLAMP((int) lround(data->values[i] * pix), 1, pix); - int v2 = CLAMP((int) lround(data->values[i+1] * pix), 1, pix); + int v2 = CLAMP((int) lround(data->values[i + 1] * pix), 1, pix); int colorIdx = GRAPH_1; for (int line = 0; line < GRAPH_HEIGHT; line++) { @@ -317,7 +317,7 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) { int line2 = CLAMP(v2 - (GraphMeterMode_pixPerRow * (GRAPH_HEIGHT - 1 - line)), 0, GraphMeterMode_pixPerRow); attrset(CRT_colors[colorIdx]); - mvaddstr(y+line, x+k, GraphMeterMode_dots[line1 * (GraphMeterMode_pixPerRow + 1) + line2]); + mvaddstr(y + line, x + k, GraphMeterMode_dots[line1 * (GraphMeterMode_pixPerRow + 1) + line2]); colorIdx = GRAPH_2; } } @@ -327,17 +327,17 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) { /* ---------- LEDMeterMode ---------- */ static const char* const LEDMeterMode_digitsAscii[] = { - " __ "," "," __ "," __ "," "," __ "," __ "," __ "," __ "," __ ", - "| |"," |"," __|"," __|","|__|","|__ ","|__ "," |","|__|","|__|", - "|__|"," |","|__ "," __|"," |"," __|","|__|"," |","|__|"," __|" + " __ ", " ", " __ ", " __ ", " ", " __ ", " __ ", " __ ", " __ ", " __ ", + "| |", " |", " __|", " __|", "|__|", "|__ ", "|__ ", " |", "|__|", "|__|", + "|__|", " |", "|__ ", " __|", " |", " __|", "|__|", " |", "|__|", " __|" }; #ifdef HAVE_LIBNCURSESW static const char* const LEDMeterMode_digitsUtf8[] = { - "┌──┐"," ┐ ","╶──┐","╶──┐","╷ ╷","┌──╴","┌──╴","╶──┐","┌──┐","┌──┐", - "│ │"," │ ","┌──┘"," ─