From 2f1f82ee87f42b53593575241839d6d3b277880f Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 6 Jun 2006 20:41:01 +0000 Subject: [PATCH] Updates for new version of the MakeHeader.py script. --- AvailableMetersPanel.c | 4 +-- CPUMeter.c | 7 +++--- CRT.c | 15 +++--------- CategoriesPanel.c | 18 +++++--------- CheckItem.c | 2 -- ClockMeter.c | 6 ++--- ColorsPanel.c | 1 - FunctionBar.c | 6 ----- ListItem.c | 2 -- LoadAverageMeter.c | 11 +++------ MemoryMeter.c | 6 ++--- Meter.c | 55 +++++++++++++++--------------------------- Object.c | 3 +-- Panel.c | 3 --- Process.c | 20 +++++---------- ProcessList.c | 14 +++-------- RichString.c | 3 +-- Settings.c | 6 ++--- SignalItem.c | 2 -- SwapMeter.c | 6 ++--- TasksMeter.c | 6 ++--- TraceScreen.c | 3 --- UptimeMeter.c | 6 ++--- Vector.c | 6 ++--- htop.c | 3 --- 25 files changed, 69 insertions(+), 145 deletions(-) diff --git a/AvailableMetersPanel.c b/AvailableMetersPanel.c index 030f9dce..cb87802e 100644 --- a/AvailableMetersPanel.c +++ b/AvailableMetersPanel.c @@ -3,6 +3,7 @@ #include "Settings.h" #include "Header.h" #include "ScreenManager.h" +#include "CPUMeter.h" #include "Panel.h" @@ -63,8 +64,7 @@ void AvailableMetersPanel_delete(Object* object) { free(this); } -/* private */ -inline void AvailableMetersPanel_addHeader(Header* header, Panel* panel, MeterType* type, int param, HeaderSide side) { +static inline void AvailableMetersPanel_addHeader(Header* header, Panel* panel, MeterType* type, int param, HeaderSide side) { Meter* meter = (Meter*) Header_addMeter(header, type, param, side); Panel_add(panel, (Object*) Meter_toListItem(meter)); } diff --git a/CPUMeter.c b/CPUMeter.c index 07c6a003..53fad310 100644 --- a/CPUMeter.c +++ b/CPUMeter.c @@ -18,10 +18,10 @@ in the source distribution for its full text. #include "debug.h" #include -/* private property */ -static int CPUMeter_attributes[] = { CPU_NICE, CPU_NORMAL, CPU_KERNEL }; +int CPUMeter_attributes[] = { + CPU_NICE, CPU_NORMAL, CPU_KERNEL +}; -/* private */ MeterType CPUMeter = { .setValues = CPUMeter_setValues, .display = CPUMeter_display, @@ -35,7 +35,6 @@ MeterType CPUMeter = { .init = CPUMeter_init }; -/* private */ MeterType AllCPUsMeter = { .mode = 0, .items = 1, diff --git a/CRT.c b/CRT.c index 6b1d120c..836c75ee 100644 --- a/CRT.c +++ b/CRT.c @@ -96,24 +96,15 @@ typedef enum ColorElements_ { LAST_COLORELEMENT } ColorElements; -extern int CRT_delay; - -extern int CRT_colors[LAST_COLORELEMENT]; - -extern int CRT_colorScheme; - }*/ // TODO: centralize these in Settings. -/* private property */ -int CRT_delay; +int CRT_delay = 0; -/* private property */ -int CRT_colorScheme; +int CRT_colorScheme = 0; -/* private property */ -int CRT_colors[LAST_COLORELEMENT]; +int CRT_colors[LAST_COLORELEMENT] = { 0 }; // TODO: pass an instance of Settings instead. diff --git a/CategoriesPanel.c b/CategoriesPanel.c index f25e8511..89e93385 100644 --- a/CategoriesPanel.c +++ b/CategoriesPanel.c @@ -23,23 +23,17 @@ typedef struct CategoriesPanel_ { }*/ -/* private property */ -char* MetersFunctions[10] = {" ", " ", " ", "Type ", " ", " ", "MoveUp", "MoveDn", "Remove", "Done "}; +static char* MetersFunctions[10] = {" ", " ", " ", "Type ", " ", " ", "MoveUp", "MoveDn", "Remove", "Done "}; -/* private property */ -char* AvailableMetersFunctions[10] = {" ", " ", " ", " ", "Add L ", "Add R ", " ", " ", " ", "Done "}; +static char* AvailableMetersFunctions[10] = {" ", " ", " ", " ", "Add L ", "Add R ", " ", " ", " ", "Done "}; -/* private property */ -char* DisplayOptionsFunctions[10] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done "}; +static char* DisplayOptionsFunctions[10] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done "}; -/* private property */ -char* ColumnsFunctions[10] = {" ", " ", " ", " ", " ", " ", "MoveUp", "MoveDn", "Remove", "Done "}; +static char* ColumnsFunctions[10] = {" ", " ", " ", " ", " ", " ", "MoveUp", "MoveDn", "Remove", "Done "}; -/* private property */ -char* ColorsFunctions[10] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done "}; +static char* ColorsFunctions[10] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done "}; -/* private property */ -char* AvailableColumnsFunctions[10] = {" ", " ", " ", " ", "Add ", " ", " ", " ", " ", "Done "}; +static char* AvailableColumnsFunctions[10] = {" ", " ", " ", " ", "Add ", " ", " ", " ", " ", "Done "}; CategoriesPanel* CategoriesPanel_new(Settings* settings, ScreenManager* scr) { CategoriesPanel* this = (CategoriesPanel*) malloc(sizeof(CategoriesPanel)); diff --git a/CheckItem.c b/CheckItem.c index ba5bd20d..73148f32 100644 --- a/CheckItem.c +++ b/CheckItem.c @@ -19,10 +19,8 @@ typedef struct CheckItem_ { bool* value; } CheckItem; -extern char* CHECKITEM_CLASS; }*/ -/* private property */ char* CHECKITEM_CLASS = "CheckItem"; CheckItem* CheckItem_new(char* text, bool* value) { diff --git a/ClockMeter.c b/ClockMeter.c index 9e48c295..847a09b1 100644 --- a/ClockMeter.c +++ b/ClockMeter.c @@ -12,10 +12,10 @@ in the source distribution for its full text. #include "debug.h" -/* private */ -static int ClockMeter_attributes[] = { CLOCK }; +int ClockMeter_attributes[] = { + CLOCK +}; -/* private */ MeterType ClockMeter = { .setValues = ClockMeter_setValues, .display = NULL, diff --git a/ColorsPanel.c b/ColorsPanel.c index e41cd802..e62583cd 100644 --- a/ColorsPanel.c +++ b/ColorsPanel.c @@ -28,7 +28,6 @@ typedef struct ColorsPanel_ { }*/ -/* private */ static char* ColorSchemes[] = { "Default", "Monochromatic", diff --git a/FunctionBar.c b/FunctionBar.c index 7f04d8e8..7764136c 100644 --- a/FunctionBar.c +++ b/FunctionBar.c @@ -28,20 +28,14 @@ typedef struct FunctionBar_ { bool staticData; } FunctionBar; -extern char* FUNCTIONBAR_CLASS; - }*/ -/* private property */ char* FUNCTIONBAR_CLASS = "FunctionBar"; -/* private property */ static char* FunctionBar_FKeys[10] = {"F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10"}; -/* private property */ static char* FunctionBar_FLabels[10] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", " "}; -/* private property */ static int FunctionBar_FEvents[10] = {KEY_F(1), KEY_F(2), KEY_F(3), KEY_F(4), KEY_F(5), KEY_F(6), KEY_F(7), KEY_F(8), KEY_F(9), KEY_F(10)}; FunctionBar* FunctionBar_new(int size, char** functions, char** keys, int* events) { diff --git a/ListItem.c b/ListItem.c index 1889a352..13d94d00 100644 --- a/ListItem.c +++ b/ListItem.c @@ -21,10 +21,8 @@ typedef struct ListItem_ { int key; } ListItem; -extern char* LISTITEM_CLASS; }*/ -/* private property */ char* LISTITEM_CLASS = "ListItem"; ListItem* ListItem_new(char* value, int key) { diff --git a/LoadAverageMeter.c b/LoadAverageMeter.c index 4f62260e..1fbfd4ac 100644 --- a/LoadAverageMeter.c +++ b/LoadAverageMeter.c @@ -12,10 +12,10 @@ in the source distribution for its full text. #include "debug.h" -/* private property */ -int LoadAverageMeter_attributes[] = { LOAD_AVERAGE_FIFTEEN, LOAD_AVERAGE_FIVE, LOAD_AVERAGE_ONE }; +int LoadAverageMeter_attributes[] = { + LOAD_AVERAGE_FIFTEEN, LOAD_AVERAGE_FIVE, LOAD_AVERAGE_ONE +}; -/* private */ MeterType LoadAverageMeter = { .setValues = LoadAverageMeter_setValues, .display = LoadAverageMeter_display, @@ -28,10 +28,8 @@ MeterType LoadAverageMeter = { .caption = "Load average: " }; -/* private property */ int LoadMeter_attributes[] = { LOAD }; -/* private */ MeterType LoadMeter = { .setValues = LoadMeter_setValues, .display = LoadMeter_display, @@ -44,8 +42,7 @@ MeterType LoadMeter = { .caption = "Load: " }; -/* private */ -inline static void LoadAverageMeter_scan(double* one, double* five, double* fifteen) { +static inline void LoadAverageMeter_scan(double* one, double* five, double* fifteen) { int activeProcs, totalProcs, lastProc; FILE *fd = fopen(PROCDIR "/loadavg", "r"); int read = fscanf(fd, "%lf %lf %lf %d/%d %d", one, five, fifteen, diff --git a/MemoryMeter.c b/MemoryMeter.c index d4f67225..a0498f51 100644 --- a/MemoryMeter.c +++ b/MemoryMeter.c @@ -19,10 +19,10 @@ in the source distribution for its full text. #include "debug.h" #include -/* private property */ -static int MemoryMeter_attributes[] = { MEMORY_USED, MEMORY_BUFFERS, MEMORY_CACHE }; +int MemoryMeter_attributes[] = { + MEMORY_USED, MEMORY_BUFFERS, MEMORY_CACHE +}; -/* private */ MeterType MemoryMeter = { .setValues = MemoryMeter_setValues, .display = MemoryMeter_display, diff --git a/Meter.c b/Meter.c index 973a63e1..437dd681 100644 --- a/Meter.c +++ b/Meter.c @@ -76,18 +76,6 @@ struct Meter_ { double total; }; -extern char* METER_CLASS; - -extern MeterType CPUMeter; -extern MeterType ClockMeter; -extern MeterType LoadAverageMeter; -extern MeterType LoadMeter; -extern MeterType MemoryMeter; -extern MeterType SwapMeter; -extern MeterType TasksMeter; -extern MeterType UptimeMeter; -extern MeterType AllCPUsMeter; - typedef enum { CUSTOM_METERMODE = 0, BAR_METERMODE, @@ -99,11 +87,16 @@ typedef enum { LAST_METERMODE } MeterModeId; -extern MeterType* Meter_types[]; -extern MeterMode* Meter_modes[]; - }*/ +#include "CPUMeter.h" +#include "MemoryMeter.h" +#include "SwapMeter.h" +#include "TasksMeter.h" +#include "LoadAverageMeter.h" +#include "UptimeMeter.h" +#include "ClockMeter.h" + #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif @@ -111,10 +104,8 @@ extern MeterMode* Meter_modes[]; #define MAX(a,b) ((a)>(b)?(a):(b)) #endif -/* private property */ char* METER_CLASS = "Meter"; -/* private */ MeterType* Meter_types[] = { &CPUMeter, &ClockMeter, @@ -128,14 +119,12 @@ MeterType* Meter_types[] = { NULL }; -/* private */ static MeterMode BarMeterMode = { .uiName = "Bar", .h = 1, .draw = BarMeterMode_draw, }; -/* private */ static MeterMode TextMeterMode = { .uiName = "Text", .h = 1, @@ -143,22 +132,21 @@ static MeterMode TextMeterMode = { }; #ifdef USE_FUNKY_MODES -/* private */ + static MeterMode GraphMeterMode = { .uiName = "Graph", .h = 3, .draw = GraphMeterMode_draw, }; -/* private */ static MeterMode LEDMeterMode = { .uiName = "LED", .h = 3, .draw = LEDMeterMode_draw, }; + #endif -/* private */ MeterMode* Meter_modes[] = { NULL, &BarMeterMode, @@ -170,7 +158,6 @@ MeterMode* Meter_modes[] = { NULL }; -/* private property */ static RichString Meter_stringBuffer; Meter* Meter_new(ProcessList* pl, int param, MeterType* type) { @@ -209,8 +196,7 @@ void Meter_setCaption(Meter* this, char* caption) { this->caption = strdup(caption); } -/* private */ -inline static void Meter_displayToStringBuffer(Meter* this, char* buffer) { +static inline void Meter_displayToStringBuffer(Meter* this, char* buffer) { MeterType* type = this->type; Object_Display display = ((Object*)this)->display; if (display) { @@ -281,8 +267,7 @@ void TextMeterMode_draw(Meter* this, int x, int y, int w) { /* ---------- BarMeterMode ---------- */ -/* private property */ -char BarMeterMode_characters[] = "|#*@$%&"; +static char BarMeterMode_characters[] = "|#*@$%&"; void BarMeterMode_draw(Meter* this, int x, int y, int w) { MeterType* type = this->type; @@ -360,14 +345,16 @@ void BarMeterMode_draw(Meter* this, int x, int y, int w) { #define DrawDot(a,y,c) do { attrset(a); mvaddch(y, x+k, c); } while(0) -/* private */ -static int GraphMeterMode_colors[21] = {GRAPH_1, GRAPH_1, GRAPH_1, - GRAPH_2, GRAPH_2, GRAPH_2, GRAPH_3, GRAPH_3, GRAPH_3, - GRAPH_4, GRAPH_4, GRAPH_4, GRAPH_5, GRAPH_5, GRAPH_6, - GRAPH_7, GRAPH_7, GRAPH_7, GRAPH_8, GRAPH_8, GRAPH_9 +static int GraphMeterMode_colors[21] = { + GRAPH_1, GRAPH_1, GRAPH_1, + GRAPH_2, GRAPH_2, GRAPH_2, + GRAPH_3, GRAPH_3, GRAPH_3, + GRAPH_4, GRAPH_4, GRAPH_4, + GRAPH_5, GRAPH_5, GRAPH_6, + GRAPH_7, GRAPH_7, GRAPH_7, + GRAPH_8, GRAPH_8, GRAPH_9 }; -/* private property */ static char* GraphMeterMode_characters = "^`'-.,_~'`-.,_~'`-.,_"; void GraphMeterMode_draw(Meter* this, int x, int y, int w) { @@ -405,14 +392,12 @@ void GraphMeterMode_draw(Meter* this, int x, int y, int w) { /* ---------- LEDMeterMode ---------- */ -/* private */ static char* LEDMeterMode_digits[3][10] = { { " __ "," "," __ "," __ "," "," __ "," __ "," __ "," __ "," __ "}, { "| |"," |"," __|"," __|","|__|","|__ ","|__ "," |","|__|","|__|"}, { "|__|"," |","|__ "," __|"," |"," __|","|__|"," |","|__|"," __|"}, }; -/* private */ static void LEDMeterMode_drawDigit(int x, int y, int n) { for (int i = 0; i < 3; i++) mvaddstr(y+i, x, LEDMeterMode_digits[i][n]); diff --git a/Object.c b/Object.c index c368b9cc..62a1c3a3 100644 --- a/Object.c +++ b/Object.c @@ -29,8 +29,7 @@ struct Object_ { }; }*/ -/* private property */ -char* OBJECT_CLASS = "Object"; +static char* OBJECT_CLASS = "Object"; void Object_new() { Object* this; diff --git a/Panel.c b/Panel.c index 32da2110..081306cf 100644 --- a/Panel.c +++ b/Panel.c @@ -45,8 +45,6 @@ struct Panel_ { Panel_EventHandler eventHandler; }; -extern char* PANEL_CLASS; - }*/ #ifndef MIN @@ -56,7 +54,6 @@ extern char* PANEL_CLASS; #define MAX(a,b) ((a)>(b)?(a):(b)) #endif -/* private property */ char* PANEL_CLASS = "Panel"; Panel* Panel_new(int x, int y, int w, int h, char* type, bool owner) { diff --git a/Process.c b/Process.c index 0396151c..a97d5d13 100644 --- a/Process.c +++ b/Process.c @@ -104,17 +104,13 @@ typedef struct Process_ { char user[PROCESS_USER_LEN + 1]; } Process; -extern char* PROCESS_CLASS; - -extern char* Process_fieldNames[]; - }*/ -/* private property */ char* PROCESS_CLASS = "Process"; -/* private property */ -char *Process_fieldNames[] = { "", "PID", "Command", "STATE", "PPID", "PGRP", "SESSION", "TTY_NR", "TPGID", "FLAGS", "MINFLT", "CMINFLT", "MAJFLT", "CMAJFLT", "UTIME", "STIME", "CUTIME", "CSTIME", "PRIORITY", "NICE", "ITREALVALUE", "STARTTIME", "VSIZE", "RSS", "RLIM", "STARTCODE", "ENDCODE", "STARTSTACK", "KSTKESP", "KSTKEIP", "SIGNAL", "BLOCKED", "SIGIGNORE", "SIGCATCH", "WCHAN", "NSWAP", "CNSWAP", "EXIT_SIGNAL", "PROCESSOR", "M_SIZE", "M_RESIDENT", "M_SHARE", "M_TRS", "M_DRS", "M_LRS", "M_DT", "ST_UID", "PERCENT_CPU", "PERCENT_MEM", "USER", "TIME", "*** report bug! ***"}; +char *Process_fieldNames[] = { + "", "PID", "Command", "STATE", "PPID", "PGRP", "SESSION", "TTY_NR", "TPGID", "FLAGS", "MINFLT", "CMINFLT", "MAJFLT", "CMAJFLT", "UTIME", "STIME", "CUTIME", "CSTIME", "PRIORITY", "NICE", "ITREALVALUE", "STARTTIME", "VSIZE", "RSS", "RLIM", "STARTCODE", "ENDCODE", "STARTSTACK", "KSTKESP", "KSTKEIP", "SIGNAL", "BLOCKED", "SIGIGNORE", "SIGCATCH", "WCHAN", "NSWAP", "CNSWAP", "EXIT_SIGNAL", "PROCESSOR", "M_SIZE", "M_RESIDENT", "M_SHARE", "M_TRS", "M_DRS", "M_LRS", "M_DT", "ST_UID", "PERCENT_CPU", "PERCENT_MEM", "USER", "TIME", "*** report bug! ***" +}; Process* Process_new(struct ProcessList_ *pl) { Process* this = malloc(sizeof(Process)); @@ -177,8 +173,7 @@ void Process_sendSignal(Process* this, int signal) { #define ONE_M (ONE_K * ONE_K) #define ONE_G (ONE_M * ONE_K) -/* private */ -void Process_printLargeNumber(Process* this, RichString *str, unsigned int number) { +static void Process_printLargeNumber(Process* this, RichString *str, unsigned int number) { char buffer[11]; int len; if(number >= (1000 * ONE_M)) { @@ -202,10 +197,8 @@ void Process_printLargeNumber(Process* this, RichString *str, unsigned int numbe } } -/* private property */ -double jiffy = 0.0; +static double jiffy = 0.0; -/* private */ static void Process_printTime(RichString* str, unsigned long t) { if(jiffy == 0.0) jiffy = sysconf(_SC_CLK_TCK); double jiffytime = 1.0 / jiffy; @@ -228,8 +221,7 @@ static void Process_printTime(RichString* str, unsigned long t) { RichString_append(str, CRT_colors[DEFAULT_COLOR], buffer); } -/* private */ -inline static void Process_writeCommand(Process* this, int attr, RichString* str) { +static inline void Process_writeCommand(Process* this, int attr, RichString* str) { if (this->pl->highlightBaseName) { char* firstSpace = strchr(this->comm, ' '); if (firstSpace) { diff --git a/ProcessList.c b/ProcessList.c index 7c7874cd..fb7f8e9d 100644 --- a/ProcessList.c +++ b/ProcessList.c @@ -104,24 +104,20 @@ typedef struct ProcessList_ { } ProcessList; }*/ -/* private property */ -ProcessField defaultHeaders[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, M_SHARE, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 }; +static ProcessField defaultHeaders[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, M_SHARE, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 }; #ifdef DEBUG -/* private property */ typedef int(*vxscanf)(void*, const char*, va_list); #define ProcessList_read(this, buffer, format, ...) ProcessList_xread(this, (vxscanf) vsscanf, buffer, format, ## __VA_ARGS__ ) #define ProcessList_fread(this, file, format, ...) ProcessList_xread(this, (vxscanf) vfscanf, file, format, ## __VA_ARGS__ ) -/* private */ -FILE* ProcessList_fopen(ProcessList* this, const char* path, const char* mode) { +static FILE* ProcessList_fopen(ProcessList* this, const char* path, const char* mode) { fprintf(this->traceFile, "[%s]\n", path); return fopen(path, mode); } -/* private */ static inline int ProcessList_xread(ProcessList* this, vxscanf fn, void* buffer, char* format, ...) { va_list ap; va_start(ap, format); @@ -305,8 +301,7 @@ int ProcessList_size(ProcessList* this) { return (Vector_size(this->processes)); } -/* private */ -void ProcessList_buildTree(ProcessList* this, int pid, int level, int indent, int direction) { +static void ProcessList_buildTree(ProcessList* this, int pid, int level, int indent, int direction) { Vector* children = Vector_new(PROCESS_CLASS, false, DEFAULT_SIZE); for (int i = 0; i < Vector_size(this->processes); i++) { @@ -355,8 +350,7 @@ void ProcessList_sort(ProcessList* this) { } } -/* private */ -int ProcessList_readStatFile(ProcessList* this, Process *proc, FILE *f, char *command) { +static int ProcessList_readStatFile(ProcessList* this, Process *proc, FILE *f, char *command) { static char buf[MAX_READ]; long int zero; diff --git a/RichString.c b/RichString.c index 7a92e081..1ee22bfa 100644 --- a/RichString.c +++ b/RichString.c @@ -23,8 +23,7 @@ typedef struct RichString_ { #define MIN(a,b) ((a)<(b)?(a):(b)) #endif -/* private property */ -WINDOW* workArea = NULL; +static WINDOW* workArea = NULL; RichString RichString_new() { RichString this; diff --git a/Settings.c b/Settings.c index 91a833e8..ca07389b 100644 --- a/Settings.c +++ b/Settings.c @@ -65,8 +65,7 @@ void Settings_delete(Settings* this) { free(this); } -/* private */ -void Settings_readMeters(Settings* this, char* line, HeaderSide side) { +static void Settings_readMeters(Settings* this, char* line, HeaderSide side) { char* trim = String_trim(line); char** ids = String_split(trim, ' '); free(trim); @@ -77,8 +76,7 @@ void Settings_readMeters(Settings* this, char* line, HeaderSide side) { String_freeArray(ids); } -/* private */ -void Settings_readMeterModes(Settings* this, char* line, HeaderSide side) { +static void Settings_readMeterModes(Settings* this, char* line, HeaderSide side) { char* trim = String_trim(line); char** ids = String_split(trim, ' '); free(trim); diff --git a/SignalItem.c b/SignalItem.c index 5a39d3b0..ae84fa86 100644 --- a/SignalItem.c +++ b/SignalItem.c @@ -23,10 +23,8 @@ typedef struct Signal_ { int number; } Signal; -extern char* SIGNAL_CLASS; }*/ -/* private property */ char* SIGNAL_CLASS = "Signal"; Signal* Signal_new(char* name, int number) { diff --git a/SwapMeter.c b/SwapMeter.c index 7b295e96..b66197e1 100644 --- a/SwapMeter.c +++ b/SwapMeter.c @@ -19,10 +19,10 @@ in the source distribution for its full text. #include "debug.h" #include -/* private property */ -static int SwapMeter_attributes[] = { SWAP }; +int SwapMeter_attributes[] = { + SWAP +}; -/* private */ MeterType SwapMeter = { .setValues = SwapMeter_setValues, .display = SwapMeter_display, diff --git a/TasksMeter.c b/TasksMeter.c index d970de06..9766ddfa 100644 --- a/TasksMeter.c +++ b/TasksMeter.c @@ -14,10 +14,10 @@ in the source distribution for its full text. #include "debug.h" -/* private property */ -int TasksMeter_attributes[] = { TASKS_RUNNING }; +int TasksMeter_attributes[] = { + TASKS_RUNNING +}; -/* private */ MeterType TasksMeter = { .setValues = TasksMeter_setValues, .display = TasksMeter_display, diff --git a/TraceScreen.c b/TraceScreen.c index c6967b13..001ef571 100644 --- a/TraceScreen.c +++ b/TraceScreen.c @@ -32,13 +32,10 @@ typedef struct TraceScreen_ { }*/ -/* private property */ static char* tbFunctions[3] = {"AutoScroll ", "Stop Tracing ", "Done "}; -/* private property */ static char* tbKeys[3] = {"F4", "F5", "Esc"}; -/* private property */ static int tbEvents[3] = {KEY_F(4), KEY_F(5), 27}; TraceScreen* TraceScreen_new(Process* process) { diff --git a/UptimeMeter.c b/UptimeMeter.c index 4b212450..c2fc0b81 100644 --- a/UptimeMeter.c +++ b/UptimeMeter.c @@ -14,10 +14,10 @@ in the source distribution for its full text. #include "debug.h" -/* private property */ -static int UptimeMeter_attributes[] = { UPTIME }; +int UptimeMeter_attributes[] = { + UPTIME +}; -/* private */ MeterType UptimeMeter = { .setValues = UptimeMeter_setValues, .display = NULL, diff --git a/Vector.c b/Vector.c index 3e637db5..349dd127 100644 --- a/Vector.c +++ b/Vector.c @@ -58,8 +58,7 @@ void Vector_delete(Vector* this) { free(this); } -/* private */ -bool Vector_isConsistent(Vector* this) { +static inline bool Vector_isConsistent(Vector* this) { if (this->owner) { for (int i = 0; i < this->items; i++) if (this->array[i] && this->array[i]->class != this->vectorType) @@ -107,8 +106,7 @@ void Vector_sort(Vector* this) { */ } -/* private */ -void Vector_checkArraySize(Vector* this) { +static void Vector_checkArraySize(Vector* this) { assert(Vector_isConsistent(this)); if (this->items >= this->arraySize) { int i; diff --git a/htop.c b/htop.c index 89516f06..de3f14eb 100644 --- a/htop.c +++ b/htop.c @@ -33,9 +33,6 @@ in the source distribution for its full text. #define INCSEARCH_MAX 40 -/* private property */ -char htop_barCharacters[] = "|#*@$%&"; - void printVersionFlag() { clear(); printf("htop " VERSION " - (C) 2004-2006 Hisham Muhammad.\n");