From 84281bdc44ea42e110efd256cdcdd37a84276204 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 26 Dec 2011 21:35:57 +0000 Subject: major header cleanup --- Affinity.c | 8 +++++++- AffinityPanel.c | 19 ++++++++++++++++--- AffinityPanel.h | 14 +++++++++----- AvailableColumnsPanel.c | 18 +++++++++++++----- AvailableColumnsPanel.h | 15 +++++++-------- AvailableMetersPanel.c | 20 ++++++++++++++------ AvailableMetersPanel.h | 15 +++++++-------- BatteryMeter.c | 18 ++++++++++++------ BatteryMeter.h | 15 +++++---------- CPUMeter.c | 9 ++++++--- CPUMeter.h | 10 ---------- CRT.c | 15 +++++++-------- CRT.h | 14 +------------- CategoriesPanel.c | 15 ++++++++++++--- CategoriesPanel.h | 19 ++++++++----------- CheckItem.c | 9 ++++++--- CheckItem.h | 6 +----- ClockMeter.c | 10 +++++++--- ClockMeter.h | 6 +----- ColorsPanel.c | 19 +++++++++++++------ ColorsPanel.h | 20 +++++++++----------- ColumnsPanel.c | 17 +++++++++++++---- ColumnsPanel.h | 11 ++++++----- DebugMemory.c | 6 ++++++ DebugMemory.h | 13 ++++++------- DisplayOptionsPanel.c | 16 ++++++++++++---- DisplayOptionsPanel.h | 12 ++++++------ FunctionBar.c | 6 +++--- FunctionBar.h | 10 ---------- Hashtable.c | 9 +++++---- Hashtable.h | 7 +------ Header.c | 17 ++++++++++++++++- Header.h | 6 +----- HostnameMeter.c | 10 +++++++--- HostnameMeter.h | 6 +----- ListItem.c | 10 +++++++--- ListItem.h | 6 ------ LoadAverageMeter.c | 11 ++++++++--- LoadAverageMeter.h | 6 +----- MemoryMeter.c | 11 +++++++---- MemoryMeter.h | 13 +------------ Meter.c | 33 ++++++++++++++++----------------- Meter.h | 29 ++--------------------------- MetersPanel.c | 15 +++++++++++---- MetersPanel.h | 11 ++++++----- Object.c | 9 +++++---- Object.h | 9 +-------- OpenFilesScreen.c | 14 +++++++++----- OpenFilesScreen.h | 12 ------------ Panel.c | 14 +++++++++----- Panel.h | 16 ++-------------- Process.c | 12 +++++++----- Process.h | 27 +++------------------------ ProcessList.c | 27 +++++++++++++-------------- ProcessList.h | 25 ++----------------------- RichString.c | 20 +++++++++++--------- RichString.h | 16 +++++++--------- ScreenManager.c | 13 +++++++------ ScreenManager.h | 13 ++----------- Settings.c | 14 ++++++++++---- Settings.h | 10 +++------- SignalsPanel.c | 12 ++++++++++-- SignalsPanel.h | 14 ++++++-------- String.c | 9 +++++---- String.h | 10 +--------- SwapMeter.c | 11 +++++++---- SwapMeter.h | 13 +------------ TasksMeter.c | 9 +++++---- TasksMeter.h | 8 +------- TraceScreen.c | 15 +++++++++------ TraceScreen.h | 12 ------------ UptimeMeter.c | 11 +++++++---- UptimeMeter.h | 8 +------- UsersTable.c | 9 +++++---- UsersTable.h | 10 ---------- Vector.c | 11 ++++++----- Vector.h | 9 +-------- htop.c | 26 +++++++++++++++----------- htop.h | 27 --------------------------- scripts/MakeHeader.py | 12 ++++++++++++ 80 files changed, 486 insertions(+), 586 deletions(-) diff --git a/Affinity.c b/Affinity.c index 0b2bd465..ce30aed3 100644 --- a/Affinity.c +++ b/Affinity.c @@ -1,6 +1,12 @@ +/* +htop - Affinity.c +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ -#include "config.h" #include "Affinity.h" + #include /*{ diff --git a/AffinityPanel.c b/AffinityPanel.c index 655af607..db1fd572 100644 --- a/AffinityPanel.c +++ b/AffinityPanel.c @@ -1,11 +1,24 @@ +/* +htop - AffinityPanel.c +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ -#include "ProcessList.h" #include "AffinityPanel.h" -#include "Panel.h" -#include "CheckItem.h" +#include "CheckItem.h" #include "debug.h" + #include +#include + +/*{ +#include "Panel.h" +#include "Affinity.h" +#include "ProcessList.h" +#include "ListItem.h" +}*/ static HandlerResult AffinityPanel_eventHandler(Panel* this, int ch) { CheckItem* selected = (CheckItem*) Panel_getSelected(this); diff --git a/AffinityPanel.h b/AffinityPanel.h index 8ab39633..392a2597 100644 --- a/AffinityPanel.h +++ b/AffinityPanel.h @@ -2,13 +2,17 @@ #ifndef HEADER_AffinityPanel #define HEADER_AffinityPanel +/* +htop - AffinityPanel.h +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ -#include "ProcessList.h" #include "Panel.h" -#include "CheckItem.h" - -#include "debug.h" -#include +#include "Affinity.h" +#include "ProcessList.h" +#include "ListItem.h" Panel* AffinityPanel_new(ProcessList* pl, Affinity* affinity); diff --git a/AvailableColumnsPanel.c b/AvailableColumnsPanel.c index 5ed9ffcf..036503fd 100644 --- a/AvailableColumnsPanel.c +++ b/AvailableColumnsPanel.c @@ -1,16 +1,24 @@ +/* +htop - AvailableColumnsPanel.c +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ #include "AvailableColumnsPanel.h" -#include "Settings.h" + #include "Header.h" -#include "ScreenManager.h" #include "ColumnsPanel.h" - -#include "Panel.h" - #include "debug.h" + #include +#include +#include /*{ +#include "Panel.h" +#include "Settings.h" +#include "ScreenManager.h" typedef struct AvailableColumnsPanel_ { Panel super; diff --git a/AvailableColumnsPanel.h b/AvailableColumnsPanel.h index d07acf80..6a32f9fb 100644 --- a/AvailableColumnsPanel.h +++ b/AvailableColumnsPanel.h @@ -2,17 +2,16 @@ #ifndef HEADER_AvailableColumnsPanel #define HEADER_AvailableColumnsPanel +/* +htop - AvailableColumnsPanel.h +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ +#include "Panel.h" #include "Settings.h" -#include "Header.h" #include "ScreenManager.h" -#include "ColumnsPanel.h" - -#include "Panel.h" - -#include "debug.h" -#include - typedef struct AvailableColumnsPanel_ { Panel super; diff --git a/AvailableMetersPanel.c b/AvailableMetersPanel.c index cfed46e6..5eedf21f 100644 --- a/AvailableMetersPanel.c +++ b/AvailableMetersPanel.c @@ -1,16 +1,24 @@ +/* +htop - AvailableMetersPanel.c +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ #include "AvailableMetersPanel.h" -#include "Settings.h" -#include "Header.h" -#include "ScreenManager.h" -#include "CPUMeter.h" - -#include "Panel.h" +#include "CPUMeter.h" +#include "Header.h" +#include "ListItem.h" #include "debug.h" + #include +#include /*{ +#include "Settings.h" +#include "Panel.h" +#include "ScreenManager.h" typedef struct AvailableMetersPanel_ { Panel super; diff --git a/AvailableMetersPanel.h b/AvailableMetersPanel.h index 25d4c08b..c34f0b2c 100644 --- a/AvailableMetersPanel.h +++ b/AvailableMetersPanel.h @@ -2,17 +2,16 @@ #ifndef HEADER_AvailableMetersPanel #define HEADER_AvailableMetersPanel +/* +htop - AvailableMetersPanel.h +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ #include "Settings.h" -#include "Header.h" -#include "ScreenManager.h" -#include "CPUMeter.h" - #include "Panel.h" - -#include "debug.h" -#include - +#include "ScreenManager.h" typedef struct AvailableMetersPanel_ { Panel super; diff --git a/BatteryMeter.c b/BatteryMeter.c index f7323aa9..45c07b33 100644 --- a/BatteryMeter.c +++ b/BatteryMeter.c @@ -1,20 +1,26 @@ /* - htop - (C) 2004-2011 Hisham H. Muhammad - Released under the GNU GPL, see the COPYING file - in the source distribution for its full text. +htop - BatteryMeter.c +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. - This "Meter" written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com). +This meter written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com). */ #include "BatteryMeter.h" -#include "Meter.h" + #include "ProcessList.h" #include "CRT.h" #include "String.h" #include "debug.h" +#include +#include +#include +#include + /*{ +#include "Meter.h" typedef enum ACPresence_ { AC_ABSENT, diff --git a/BatteryMeter.h b/BatteryMeter.h index 9bef8df6..56ed951e 100644 --- a/BatteryMeter.h +++ b/BatteryMeter.h @@ -3,20 +3,15 @@ #ifndef HEADER_BatteryMeter #define HEADER_BatteryMeter /* - htop - (C) 2004-2011 Hisham H. Muhammad - Released under the GNU GPL, see the COPYING file - in the source distribution for its full text. +htop - BatteryMeter.h +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. - This "Meter" written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com). +This meter written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com). */ #include "Meter.h" -#include "ProcessList.h" -#include "CRT.h" -#include "String.h" -#include "debug.h" - typedef enum ACPresence_ { AC_ABSENT, diff --git a/CPUMeter.c b/CPUMeter.c index f2a4fe34..2239250c 100644 --- a/CPUMeter.c +++ b/CPUMeter.c @@ -6,17 +6,20 @@ in the source distribution for its full text. */ #include "CPUMeter.h" -#include "Meter.h" +#include "CRT.h" #include "ProcessList.h" +#include "debug.h" +#include #include #include #include #include -#include "debug.h" -#include +/*{ +#include "Meter.h" +}*/ int CPUMeter_attributes[] = { CPU_NICE, CPU_NORMAL, CPU_KERNEL, CPU_IRQ, CPU_SOFTIRQ, CPU_IOWAIT, CPU_STEAL, CPU_GUEST diff --git a/CPUMeter.h b/CPUMeter.h index 47ef8882..251fbdc4 100644 --- a/CPUMeter.h +++ b/CPUMeter.h @@ -11,16 +11,6 @@ in the source distribution for its full text. #include "Meter.h" -#include "ProcessList.h" - -#include -#include -#include -#include - -#include "debug.h" -#include - extern int CPUMeter_attributes[]; #ifndef MIN diff --git a/CRT.c b/CRT.c index 949b543e..459a9c2e 100644 --- a/CRT.c +++ b/CRT.c @@ -7,19 +7,17 @@ in the source distribution for its full text. #include "CRT.h" +#include "config.h" +#include "String.h" +#include "debug.h" + #include #include #include -#include #ifdef HAVE_EXECINFO_H #include #endif -#include "String.h" - -#include "config.h" -#include "debug.h" - #define ColorPair(i,j) COLOR_PAIR((7-i)*8+j) #define COLORSCHEME_DEFAULT 0 @@ -40,9 +38,8 @@ in the source distribution for its full text. //#link curses -bool CRT_hasColors; - /*{ +#include typedef enum ColorElements_ { RESET_COLOR, @@ -112,6 +109,8 @@ typedef enum ColorElements_ { // TODO: centralize these in Settings. +static bool CRT_hasColors; + int CRT_delay = 0; int CRT_colorScheme = 0; diff --git a/CRT.h b/CRT.h index 55728c87..1fe3d248 100644 --- a/CRT.h +++ b/CRT.h @@ -9,20 +9,9 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - -#include -#include -#include -#include #ifdef HAVE_EXECINFO_H -#include #endif -#include "String.h" - -#include "config.h" -#include "debug.h" - #define ColorPair(i,j) COLOR_PAIR((7-i)*8+j) #define COLORSCHEME_DEFAULT 0 @@ -43,8 +32,7 @@ in the source distribution for its full text. //#link curses -bool CRT_hasColors; - +#include typedef enum ColorElements_ { RESET_COLOR, diff --git a/CategoriesPanel.c b/CategoriesPanel.c index b3cb3aa9..ccdda9c4 100644 --- a/CategoriesPanel.c +++ b/CategoriesPanel.c @@ -1,18 +1,27 @@ +/* +htop - CategoriesPanel.c +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ #include "CategoriesPanel.h" + #include "AvailableMetersPanel.h" #include "MetersPanel.h" #include "DisplayOptionsPanel.h" #include "ColumnsPanel.h" #include "ColorsPanel.h" #include "AvailableColumnsPanel.h" - -#include "Panel.h" - #include "debug.h" + #include +#include /*{ +#include "Panel.h" +#include "Settings.h" +#include "ScreenManager.h" typedef struct CategoriesPanel_ { Panel super; diff --git a/CategoriesPanel.h b/CategoriesPanel.h index 7748fe1f..1311fe2e 100644 --- a/CategoriesPanel.h +++ b/CategoriesPanel.h @@ -2,19 +2,16 @@ #ifndef HEADER_CategoriesPanel #define HEADER_CategoriesPanel - -#include "AvailableMetersPanel.h" -#include "MetersPanel.h" -#include "DisplayOptionsPanel.h" -#include "ColumnsPanel.h" -#include "ColorsPanel.h" -#include "AvailableColumnsPanel.h" +/* +htop - CategoriesPanel.h +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ #include "Panel.h" - -#include "debug.h" -#include - +#include "Settings.h" +#include "ScreenManager.h" typedef struct CategoriesPanel_ { Panel super; diff --git a/CheckItem.c b/CheckItem.c index 2d87aded..0a171f7b 100644 --- a/CheckItem.c +++ b/CheckItem.c @@ -1,17 +1,20 @@ /* -htop +htop - CheckItem.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "CheckItem.h" -#include "Object.h" -#include "CRT.h" +#include "CRT.h" #include "debug.h" +#include +#include + /*{ +#include "Object.h" typedef struct CheckItem_ { Object super; diff --git a/CheckItem.h b/CheckItem.h index 32156238..6c70790e 100644 --- a/CheckItem.h +++ b/CheckItem.h @@ -3,17 +3,13 @@ #ifndef HEADER_CheckItem #define HEADER_CheckItem /* -htop +htop - CheckItem.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Object.h" -#include "CRT.h" - -#include "debug.h" - typedef struct CheckItem_ { Object super; diff --git a/ClockMeter.c b/ClockMeter.c index 3764ca7c..51742538 100644 --- a/ClockMeter.c +++ b/ClockMeter.c @@ -1,16 +1,20 @@ /* -htop +htop - ClockMeter.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "ClockMeter.h" -#include "Meter.h" + +#include "CRT.h" +#include "debug.h" #include -#include "debug.h" +/*{ +#include "Meter.h" +}*/ int ClockMeter_attributes[] = { CLOCK diff --git a/ClockMeter.h b/ClockMeter.h index d4c8f82b..ed19786c 100644 --- a/ClockMeter.h +++ b/ClockMeter.h @@ -3,7 +3,7 @@ #ifndef HEADER_ClockMeter #define HEADER_ClockMeter /* -htop +htop - ClockMeter.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. @@ -11,10 +11,6 @@ in the source distribution for its full text. #include "Meter.h" -#include - -#include "debug.h" - extern int ClockMeter_attributes[]; extern MeterType ClockMeter; diff --git a/ColorsPanel.c b/ColorsPanel.c index 374e1df2..aa9292d9 100644 --- a/ColorsPanel.c +++ b/ColorsPanel.c @@ -1,15 +1,19 @@ +/* +htop - ColorsPanel.c +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ -#include "config.h" -#include "CRT.h" #include "ColorsPanel.h" -#include "Panel.h" +#include "CRT.h" #include "CheckItem.h" -#include "Settings.h" -#include "ScreenManager.h" - #include "debug.h" + #include +#include +#include // TO ADD A NEW SCHEME: // * Increment the size of bool check in ColorsPanel.h @@ -18,6 +22,9 @@ // * Add the colors in CRT_setColors /*{ +#include "Panel.h" +#include "Settings.h" +#include "ScreenManager.h" typedef struct ColorsPanel_ { Panel super; diff --git a/ColorsPanel.h b/ColorsPanel.h index f32152bf..61b89c0c 100644 --- a/ColorsPanel.h +++ b/ColorsPanel.h @@ -2,17 +2,12 @@ #ifndef HEADER_ColorsPanel #define HEADER_ColorsPanel - -#include "config.h" -#include "CRT.h" - -#include "Panel.h" -#include "CheckItem.h" -#include "Settings.h" -#include "ScreenManager.h" - -#include "debug.h" -#include +/* +htop - ColorsPanel.h +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ // TO ADD A NEW SCHEME: // * Increment the size of bool check in ColorsPanel.h @@ -20,6 +15,9 @@ // * Add a define in CRT.h that matches the order of the array // * Add the colors in CRT_setColors +#include "Panel.h" +#include "Settings.h" +#include "ScreenManager.h" typedef struct ColorsPanel_ { Panel super; diff --git a/ColumnsPanel.c b/ColumnsPanel.c index e1a75587..ec25d466 100644 --- a/ColumnsPanel.c +++ b/ColumnsPanel.c @@ -1,14 +1,23 @@ +/* +htop - ColumnsPanel.c +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ #include "ColumnsPanel.h" -#include "Panel.h" -#include "Settings.h" -#include "ScreenManager.h" - +#include "String.h" #include "debug.h" + #include +#include +#include /*{ +#include "Panel.h" +#include "Settings.h" +#include "ScreenManager.h" typedef struct ColumnsPanel_ { Panel super; diff --git a/ColumnsPanel.h b/ColumnsPanel.h index a0ed16a1..2ebb3873 100644 --- a/ColumnsPanel.h +++ b/ColumnsPanel.h @@ -2,16 +2,17 @@ #ifndef HEADER_ColumnsPanel #define HEADER_ColumnsPanel - +/* +htop - ColumnsPanel.h +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ #include "Panel.h" #include "Settings.h" #include "ScreenManager.h" -#include "debug.h" -#include - - typedef struct ColumnsPanel_ { Panel super; diff --git a/DebugMemory.c b/DebugMemory.c index 7a0f584d..f45e25da 100644 --- a/DebugMemory.c +++ b/DebugMemory.c @@ -1,3 +1,9 @@ +/* +htop - DebugMemory.c +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ #include #include diff --git a/DebugMemory.h b/DebugMemory.h index a67a5f2b..d0b8a3d2 100644 --- a/DebugMemory.h +++ b/DebugMemory.h @@ -2,12 +2,12 @@ #ifndef HEADER_DebugMemory #define HEADER_DebugMemory - -#include -#include -#include -#include -#include +/* +htop - DebugMemory.h +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ #undef strdup #undef malloc @@ -16,7 +16,6 @@ #undef free - typedef struct DebugMemoryItem_ DebugMemoryItem; struct DebugMemoryItem_ { diff --git a/DisplayOptionsPanel.c b/DisplayOptionsPanel.c index c2c0d33e..a895125d 100644 --- a/DisplayOptionsPanel.c +++ b/DisplayOptionsPanel.c @@ -1,15 +1,23 @@ +/* +htop - DisplayOptionsPanel.c +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ #include "DisplayOptionsPanel.h" -#include "Panel.h" #include "CheckItem.h" -#include "Settings.h" -#include "ScreenManager.h" - #include "debug.h" + #include +#include +#include /*{ +#include "Panel.h" +#include "Settings.h" +#include "ScreenManager.h" typedef struct DisplayOptionsPanel_ { Panel super; diff --git a/DisplayOptionsPanel.h b/DisplayOptionsPanel.h index a908f53e..1e013f35 100644 --- a/DisplayOptionsPanel.h +++ b/DisplayOptionsPanel.h @@ -2,17 +2,17 @@ #ifndef HEADER_DisplayOptionsPanel #define HEADER_DisplayOptionsPanel - +/* +htop - DisplayOptionsPanel.h +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ #include "Panel.h" -#include "CheckItem.h" #include "Settings.h" #include "ScreenManager.h" -#include "debug.h" -#include - - typedef struct DisplayOptionsPanel_ { Panel super; diff --git a/FunctionBar.c b/FunctionBar.c index ba657492..fae05556 100644 --- a/FunctionBar.c +++ b/FunctionBar.c @@ -5,19 +5,19 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "Object.h" #include "FunctionBar.h" -#include "CRT.h" +#include "CRT.h" #include "debug.h" -#include +#include #include #include #include #include /*{ +#include "Object.h" typedef struct FunctionBar_ { Object super; diff --git a/FunctionBar.h b/FunctionBar.h index e7fcb4f6..584d7fde 100644 --- a/FunctionBar.h +++ b/FunctionBar.h @@ -10,16 +10,6 @@ in the source distribution for its full text. */ #include "Object.h" -#include "CRT.h" - -#include "debug.h" -#include - -#include -#include -#include -#include - typedef struct FunctionBar_ { Object super; diff --git a/Hashtable.c b/Hashtable.c index f2f87d20..55070033 100644 --- a/Hashtable.c +++ b/Hashtable.c @@ -1,5 +1,5 @@ /* -htop +htop - Hashtable.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. @@ -7,13 +7,14 @@ in the source distribution for its full text. #include "Hashtable.h" +#include "debug.h" + #include -#include #include -#include "debug.h" - /*{ +#include + typedef struct Hashtable_ Hashtable; typedef void(*Hashtable_PairFunction)(int, void*, void*); diff --git a/Hashtable.h b/Hashtable.h index 5f4a261f..25608961 100644 --- a/Hashtable.h +++ b/Hashtable.h @@ -3,18 +3,13 @@ #ifndef HEADER_Hashtable #define HEADER_Hashtable /* -htop +htop - Hashtable.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - -#include #include -#include - -#include "debug.h" typedef struct Hashtable_ Hashtable; diff --git a/Header.c b/Header.c index 9a14b156..4203a171 100644 --- a/Header.c +++ b/Header.c @@ -6,13 +6,28 @@ in the source distribution for its full text. */ #include "Header.h" -#include "Meter.h" +#include "CRT.h" +#include "CPUMeter.h" +#include "MemoryMeter.h" +#include "SwapMeter.h" +#include "TasksMeter.h" +#include "LoadAverageMeter.h" +#include "UptimeMeter.h" +#include "BatteryMeter.h" +#include "ClockMeter.h" +#include "HostnameMeter.h" +#include "String.h" #include "debug.h" + #include #include +#include +#include /*{ +#include "ProcessList.h" +#include "Meter.h" typedef enum HeaderSide_ { LEFT_HEADER, diff --git a/Header.h b/Header.h index 0fb5a735..938d1417 100644 --- a/Header.h +++ b/Header.h @@ -9,13 +9,9 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ +#include "ProcessList.h" #include "Meter.h" -#include "debug.h" -#include -#include - - typedef enum HeaderSide_ { LEFT_HEADER, RIGHT_HEADER diff --git a/HostnameMeter.c b/HostnameMeter.c index 7c4e6b1a..08e3fb60 100644 --- a/HostnameMeter.c +++ b/HostnameMeter.c @@ -1,16 +1,20 @@ /* -htop +htop - HostnameMeter.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "HostnameMeter.h" -#include "Meter.h" + +#include "CRT.h" +#include "debug.h" #include -#include "debug.h" +/*{ +#include "Meter.h" +}*/ int HostnameMeter_attributes[] = { HOSTNAME diff --git a/HostnameMeter.h b/HostnameMeter.h index ddebfcf3..addc7537 100644 --- a/HostnameMeter.h +++ b/HostnameMeter.h @@ -3,7 +3,7 @@ #ifndef HEADER_HostnameMeter #define HEADER_HostnameMeter /* -htop +htop - HostnameMeter.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. @@ -11,10 +11,6 @@ in the source distribution for its full text. #include "Meter.h" -#include - -#include "debug.h" - extern int HostnameMeter_attributes[]; extern MeterType HostnameMeter; diff --git a/ListItem.c b/ListItem.c index 500c31fa..0328f6a4 100644 --- a/ListItem.c +++ b/ListItem.c @@ -6,14 +6,18 @@ in the source distribution for its full text. */ #include "ListItem.h" + +#include "CRT.h" #include "String.h" -#include "Object.h" #include "RichString.h" -#include - #include "debug.h" +#include +#include +#include + /*{ +#include "Object.h" typedef struct ListItem_ { Object super; diff --git a/ListItem.h b/ListItem.h index de0edef6..8df792c1 100644 --- a/ListItem.h +++ b/ListItem.h @@ -9,13 +9,7 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "String.h" #include "Object.h" -#include "RichString.h" -#include - -#include "debug.h" - typedef struct ListItem_ { Object super; diff --git a/LoadAverageMeter.c b/LoadAverageMeter.c index 02c8ad5e..e307b071 100644 --- a/LoadAverageMeter.c +++ b/LoadAverageMeter.c @@ -1,16 +1,21 @@ /* -htop +htop - LoadAverageMeter.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "LoadAverageMeter.h" -#include "Meter.h" + +#include "CRT.h" +#include "debug.h" #include +#include -#include "debug.h" +/*{ +#include "Meter.h" +}*/ int LoadAverageMeter_attributes[] = { LOAD_AVERAGE_FIFTEEN, LOAD_AVERAGE_FIVE, LOAD_AVERAGE_ONE diff --git a/LoadAverageMeter.h b/LoadAverageMeter.h index 7610e60b..b30680f3 100644 --- a/LoadAverageMeter.h +++ b/LoadAverageMeter.h @@ -3,7 +3,7 @@ #ifndef HEADER_LoadAverageMeter #define HEADER_LoadAverageMeter /* -htop +htop - LoadAverageMeter.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. @@ -11,10 +11,6 @@ in the source distribution for its full text. #include "Meter.h" -#include - -#include "debug.h" - extern int LoadAverageMeter_attributes[]; extern int LoadMeter_attributes[]; diff --git a/MemoryMeter.c b/MemoryMeter.c index e9e91259..656a2b98 100644 --- a/MemoryMeter.c +++ b/MemoryMeter.c @@ -1,24 +1,27 @@ /* -htop +htop - MemoryMeter.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "MemoryMeter.h" -#include "Meter.h" +#include "CRT.h" #include "ProcessList.h" +#include "debug.h" #include #include #include #include #include - -#include "debug.h" #include +/*{ +#include "Meter.h" +}*/ + int MemoryMeter_attributes[] = { MEMORY_USED, MEMORY_BUFFERS, MEMORY_CACHE }; diff --git a/MemoryMeter.h b/MemoryMeter.h index 4f6d958a..8fa1e42b 100644 --- a/MemoryMeter.h +++ b/MemoryMeter.h @@ -3,7 +3,7 @@ #ifndef HEADER_MemoryMeter #define HEADER_MemoryMeter /* -htop +htop - MemoryMeter.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. @@ -11,17 +11,6 @@ in the source distribution for its full text. #include "Meter.h" -#include "ProcessList.h" - -#include -#include -#include -#include -#include - -#include "debug.h" -#include - extern int MemoryMeter_attributes[]; extern MeterType MemoryMeter; diff --git a/Meter.c b/Meter.c index 97b1dc4e..c67bf39e 100644 --- a/Meter.c +++ b/Meter.c @@ -5,30 +5,40 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "RichString.h" #include "Meter.h" + +#include "CPUMeter.h" +#include "MemoryMeter.h" +#include "SwapMeter.h" +#include "TasksMeter.h" +#include "LoadAverageMeter.h" +#include "UptimeMeter.h" +#include "BatteryMeter.h" +#include "ClockMeter.h" +#include "HostnameMeter.h" +#include "RichString.h" #include "Object.h" #include "CRT.h" -#include "ListItem.h" #include "String.h" -#include "ProcessList.h" +#include "ListItem.h" +#include "debug.h" #include #include #include #include - -#include "debug.h" #include +#include #ifndef USE_FUNKY_MODES -#include #define USE_FUNKY_MODES 1 #endif #define METER_BUFFER_LEN 128 /*{ +#include "ListItem.h" +#include "ProcessList.h" typedef struct Meter_ Meter; typedef struct MeterType_ MeterType; @@ -96,17 +106,6 @@ typedef enum { }*/ -#include "CPUMeter.h" -#include "MemoryMeter.h" -#include "SwapMeter.h" -#include "TasksMeter.h" -#include "LoadAverageMeter.h" -#include "UptimeMeter.h" -#include "BatteryMeter.h" -#include "ClockMeter.h" -#include "HostnameMeter.h" - - #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif diff --git a/Meter.h b/Meter.h index dc550e4d..08827240 100644 --- a/Meter.h +++ b/Meter.h @@ -9,28 +9,14 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "RichString.h" -#include "Object.h" -#include "CRT.h" -#include "ListItem.h" -#include "String.h" -#include "ProcessList.h" - -#include -#include -#include -#include - -#include "debug.h" -#include - #ifndef USE_FUNKY_MODES -#include #define USE_FUNKY_MODES 1 #endif #define METER_BUFFER_LEN 128 +#include "ListItem.h" +#include "ProcessList.h" typedef struct Meter_ Meter; typedef struct MeterType_ MeterType; @@ -97,17 +83,6 @@ typedef enum { } MeterModeId; -#include "CPUMeter.h" -#include "MemoryMeter.h" -#include "SwapMeter.h" -#include "TasksMeter.h" -#include "LoadAverageMeter.h" -#include "UptimeMeter.h" -#include "BatteryMeter.h" -#include "ClockMeter.h" -#include "HostnameMeter.h" - - #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif diff --git a/MetersPanel.c b/MetersPanel.c index df1d6fbb..20d29d79 100644 --- a/MetersPanel.c +++ b/MetersPanel.c @@ -1,14 +1,21 @@ +/* +htop - MetersPanel.c +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ #include "MetersPanel.h" -#include "Panel.h" -#include "Settings.h" -#include "ScreenManager.h" - #include "debug.h" + +#include #include /*{ +#include "Panel.h" +#include "Settings.h" +#include "ScreenManager.h" typedef struct MetersPanel_ { Panel super; diff --git a/MetersPanel.h b/MetersPanel.h index 2e6d2253..4aa2c3d4 100644 --- a/MetersPanel.h +++ b/MetersPanel.h @@ -2,16 +2,17 @@ #ifndef HEADER_MetersPanel #define HEADER_MetersPanel - +/* +htop - MetersPanel.h +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ #include "Panel.h" #include "Settings.h" #include "ScreenManager.h" -#include "debug.h" -#include - - typedef struct MetersPanel_ { Panel super; diff --git a/Object.c b/Object.c index f8eb20db..ca9de8b8 100644 --- a/Object.c +++ b/Object.c @@ -1,20 +1,21 @@ /* -htop +htop - Object.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Object.h" -#include "RichString.h" + #include "CRT.h" +#include "debug.h" + #include #include #include -#include "debug.h" - /*{ +#include "RichString.h" #ifndef DEBUG #define Object_setClass(obj, class) diff --git a/Object.h b/Object.h index 097af905..8ebc1d50 100644 --- a/Object.h +++ b/Object.h @@ -3,20 +3,13 @@ #ifndef HEADER_Object #define HEADER_Object /* -htop +htop - Object.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "RichString.h" -#include "CRT.h" -#include -#include -#include - -#include "debug.h" - #ifndef DEBUG #define Object_setClass(obj, class) diff --git a/OpenFilesScreen.c b/OpenFilesScreen.c index 98110016..9adf8b4b 100644 --- a/OpenFilesScreen.c +++ b/OpenFilesScreen.c @@ -5,23 +5,27 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ +#include "OpenFilesScreen.h" + +#include "CRT.h" +#include "ProcessList.h" +#include "ListItem.h" + +#include #include #include #include #include +#include #include #include #include -#include "OpenFilesScreen.h" -#include "ProcessList.h" +/*{ #include "Process.h" -#include "ListItem.h" #include "Panel.h" #include "FunctionBar.h" -/*{ - typedef struct OpenFiles_ProcessData_ { char* data[256]; struct OpenFiles_FileData_* files; diff --git a/OpenFilesScreen.h b/OpenFilesScreen.h index 78694054..248cac4b 100644 --- a/OpenFilesScreen.h +++ b/OpenFilesScreen.h @@ -9,22 +9,10 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "config.h" -#include -#include -#include -#include -#include -#include -#include - -#include "ProcessList.h" #include "Process.h" -#include "ListItem.h" #include "Panel.h" #include "FunctionBar.h" - typedef struct OpenFiles_ProcessData_ { char* data[256]; struct OpenFiles_FileData_* files; diff --git a/Panel.c b/Panel.c index 56e19488..74f07564 100644 --- a/Panel.c +++ b/Panel.c @@ -5,23 +5,27 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "Object.h" #include "Panel.h" -#include "Vector.h" + #include "CRT.h" #include "RichString.h" #include "ListItem.h" +#include "String.h" +#include "debug.h" #include #include - -#include "debug.h" +#include +#include +#include #include - #include + //#link curses /*{ +#include "Object.h" +#include "Vector.h" typedef struct Panel_ Panel; diff --git a/Panel.h b/Panel.h index bc838105..3f355837 100644 --- a/Panel.h +++ b/Panel.h @@ -9,21 +9,10 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "Object.h" -#include "Vector.h" -#include "CRT.h" -#include "RichString.h" -#include "ListItem.h" - -#include -#include - -#include "debug.h" -#include - -#include //#link curses +#include "Object.h" +#include "Vector.h" typedef struct Panel_ Panel; @@ -117,7 +106,6 @@ void Panel_draw(Panel* this, bool focus); bool Panel_onKey(Panel* this, int key); - HandlerResult Panel_selectByTyping(Panel* this, int ch); #endif diff --git a/Process.c b/Process.c index cadf7dd5..7c48e67a 100644 --- a/Process.c +++ b/Process.c @@ -5,29 +5,28 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ +#include "Process.h" + #include "ProcessList.h" -#include "Object.h" #include "CRT.h" #include "String.h" -#include "Process.h" #include "RichString.h" -#include "Affinity.h" - #include "debug.h" #include #include #include #include -#include #include #include +#include #include #include #include #include #include #include +#include #ifdef HAVE_LIBHWLOC #include @@ -41,6 +40,9 @@ in the source distribution for its full text. #define PAGE_SIZE_KB ( PAGE_SIZE / ONE_K ) /*{ +#include "Object.h" +#include "Affinity.h" +#include #ifndef Process_isKernelThread #define Process_isKernelThread(_process) (_process->pgrp == 0) diff --git a/Process.h b/Process.h index e72f8160..2c3e0c33 100644 --- a/Process.h +++ b/Process.h @@ -9,31 +9,7 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "ProcessList.h" -#include "Object.h" -#include "CRT.h" -#include "String.h" -#include "RichString.h" -#include "Affinity.h" - -#include "debug.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #ifdef HAVE_LIBHWLOC -#include #endif // This works only with glibc 2.1+. On earlier versions @@ -43,6 +19,9 @@ in the source distribution for its full text. #endif #define PAGE_SIZE_KB ( PAGE_SIZE / ONE_K ) +#include "Object.h" +#include "Affinity.h" +#include #ifndef Process_isKernelThread #define Process_isKernelThread(_process) (_process->pgrp == 0) diff --git a/ProcessList.c b/ProcessList.c index d33d83b8..453a77e8 100644 --- a/ProcessList.c +++ b/ProcessList.c @@ -5,20 +5,14 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#ifndef CONFIG_H -#define CONFIG_H -#include "config.h" -#endif - #include "ProcessList.h" -#include "Process.h" -#include "Vector.h" -#include "UsersTable.h" -#include "Hashtable.h" + +#include "CRT.h" #include "String.h" -#include "Panel.h" +#include "debug.h" -#include +#include +#include #include #include #include @@ -26,14 +20,19 @@ in the source distribution for its full text. #include #include #include -#include #include #include - -#include "debug.h" +#include +#include #include /*{ +#include "Vector.h" +#include "Hashtable.h" +#include "UsersTable.h" +#include "Panel.h" +#include "Process.h" +#include #ifndef PROCDIR #define PROCDIR "/proc" diff --git a/ProcessList.h b/ProcessList.h index 702f966d..719783b7 100644 --- a/ProcessList.h +++ b/ProcessList.h @@ -9,33 +9,12 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#ifndef CONFIG_H -#define CONFIG_H -#include "config.h" -#endif - -#include "Process.h" #include "Vector.h" -#include "UsersTable.h" #include "Hashtable.h" -#include "String.h" +#include "UsersTable.h" #include "Panel.h" - +#include "Process.h" #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "debug.h" -#include - #ifndef PROCDIR #define PROCDIR "/proc" diff --git a/RichString.c b/RichString.c index 4c617095..7f316b68 100644 --- a/RichString.c +++ b/RichString.c @@ -1,13 +1,19 @@ +/* +htop - RichString.c +(C) 2004,2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ #include "RichString.h" -#ifndef CONFIG_H -#define CONFIG_H -#include "config.h" -#endif - #include #include + +#define RICHSTRING_MAXLEN 300 + +/*{ +#include "config.h" #include #include "debug.h" @@ -22,10 +28,6 @@ #include #endif -#define RICHSTRING_MAXLEN 300 - -/*{ - #define RichString_size(this) ((this)->chlen) #define RichString_sizeVal(this) ((this).chlen) diff --git a/RichString.h b/RichString.h index a95726f7..9f5ebc70 100644 --- a/RichString.h +++ b/RichString.h @@ -2,15 +2,16 @@ #ifndef HEADER_RichString #define HEADER_RichString +/* +htop - RichString.h +(C) 2004,2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ +#define RICHSTRING_MAXLEN 300 -#ifndef CONFIG_H -#define CONFIG_H #include "config.h" -#endif - -#include -#include #include #include "debug.h" @@ -25,9 +26,6 @@ #include #endif -#define RICHSTRING_MAXLEN 300 - - #define RichString_size(this) ((this)->chlen) #define RichString_sizeVal(this) ((this).chlen) diff --git a/ScreenManager.c b/ScreenManager.c index 9c7b392d..4cc18e4d 100644 --- a/ScreenManager.c +++ b/ScreenManager.c @@ -1,24 +1,25 @@ /* -htop +htop - ScreenManager.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "ScreenManager.h" + #include "Panel.h" #include "Object.h" -#include "Vector.h" -#include "Header.h" -#include "FunctionBar.h" - #include "debug.h" + #include #include - +#include #include /*{ +#include "FunctionBar.h" +#include "Vector.h" +#include "Header.h" typedef enum Orientation_ { VERTICAL, diff --git a/ScreenManager.h b/ScreenManager.h index 783cf9f0..5179fe97 100644 --- a/ScreenManager.h +++ b/ScreenManager.h @@ -3,24 +3,15 @@ #ifndef HEADER_ScreenManager #define HEADER_ScreenManager /* -htop +htop - ScreenManager.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "Panel.h" -#include "Object.h" +#include "FunctionBar.h" #include "Vector.h" #include "Header.h" -#include "FunctionBar.h" - -#include "debug.h" -#include -#include - -#include - typedef enum Orientation_ { VERTICAL, diff --git a/Settings.c b/Settings.c index 81758d57..76ed2e27 100644 --- a/Settings.c +++ b/Settings.c @@ -5,17 +5,23 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "config.h" #include "Settings.h" -#include "String.h" -#include "ProcessList.h" -#include "Header.h" +#include "String.h" +#include "Vector.h" #include "debug.h" +#include +#include +#include +#include + #define DEFAULT_DELAY 15 /*{ +#include "ProcessList.h" +#include "Header.h" +#include typedef struct Settings_ { char* userSettings; diff --git a/Settings.h b/Settings.h index 9f1db00c..af542229 100644 --- a/Settings.h +++ b/Settings.h @@ -9,15 +9,11 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "config.h" -#include "String.h" -#include "ProcessList.h" -#include "Header.h" - -#include "debug.h" - #define DEFAULT_DELAY 15 +#include "ProcessList.h" +#include "Header.h" +#include typedef struct Settings_ { char* userSettings; diff --git a/SignalsPanel.c b/SignalsPanel.c index f591e63b..afc784a2 100644 --- a/SignalsPanel.c +++ b/SignalsPanel.c @@ -1,15 +1,23 @@ +/* +htop - SignalsPanel.c +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ #include "SignalsPanel.h" -#include "Panel.h" + #include "ListItem.h" #include "RichString.h" - #include "debug.h" + +#include #include #include /*{ +#include "Panel.h" typedef struct SignalItem_ { const char* name; diff --git a/SignalsPanel.h b/SignalsPanel.h index 83e8b7eb..598c70fb 100644 --- a/SignalsPanel.h +++ b/SignalsPanel.h @@ -2,16 +2,14 @@ #ifndef HEADER_SignalsPanel #define HEADER_SignalsPanel +/* +htop - SignalsPanel.h +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ #include "Panel.h" -#include "ListItem.h" -#include "RichString.h" - -#include "debug.h" -#include - -#include - typedef struct SignalItem_ { const char* name; diff --git a/String.c b/String.c index 7d8d285a..dcae2985 100644 --- a/String.c +++ b/String.c @@ -1,19 +1,20 @@ /* -htop +htop - String.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "config.h" #include "String.h" + +#include "config.h" +#include "debug.h" + #include #include #include #include -#include "debug.h" - /*{ #define String_startsWith(s, match) (strstr((s), (match)) == (s)) }*/ diff --git a/String.h b/String.h index 99b1a97f..0662aa18 100644 --- a/String.h +++ b/String.h @@ -3,20 +3,12 @@ #ifndef HEADER_String #define HEADER_String /* -htop +htop - String.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "config.h" -#include -#include -#include -#include - -#include "debug.h" - #define String_startsWith(s, match) (strstr((s), (match)) == (s)) char* String_cat(const char* s1, const char* s2); diff --git a/SwapMeter.c b/SwapMeter.c index 403b0576..14c58a89 100644 --- a/SwapMeter.c +++ b/SwapMeter.c @@ -1,24 +1,27 @@ /* -htop +htop - SwapMeter.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "SwapMeter.h" -#include "Meter.h" +#include "CRT.h" #include "ProcessList.h" +#include "debug.h" #include #include #include #include #include - -#include "debug.h" #include +/*{ +#include "Meter.h" +}*/ + #define KILOBYTE 1 #define MEGABYTE 1024 #define GIGABYTE 1048576 diff --git a/SwapMeter.h b/SwapMeter.h index 6bdd130b..5b5c9403 100644 --- a/SwapMeter.h +++ b/SwapMeter.h @@ -3,7 +3,7 @@ #ifndef HEADER_SwapMeter #define HEADER_SwapMeter /* -htop +htop - SwapMeter.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. @@ -11,17 +11,6 @@ in the source distribution for its full text. #include "Meter.h" -#include "ProcessList.h" - -#include -#include -#include -#include -#include - -#include "debug.h" -#include - #define KILOBYTE 1 #define MEGABYTE 1024 #define GIGABYTE 1048576 diff --git a/TasksMeter.c b/TasksMeter.c index 999c681d..ecff933c 100644 --- a/TasksMeter.c +++ b/TasksMeter.c @@ -1,19 +1,20 @@ /* -htop +htop - TasksMeter.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "TasksMeter.h" -#include "Meter.h" #include "ProcessList.h" - #include "CRT.h" - #include "debug.h" +/*{ +#include "Meter.h" +}*/ + int TasksMeter_attributes[] = { TASKS_RUNNING }; diff --git a/TasksMeter.h b/TasksMeter.h index ea39a417..cc6a60ab 100644 --- a/TasksMeter.h +++ b/TasksMeter.h @@ -3,7 +3,7 @@ #ifndef HEADER_TasksMeter #define HEADER_TasksMeter /* -htop +htop - TasksMeter.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. @@ -11,12 +11,6 @@ in the source distribution for its full text. #include "Meter.h" -#include "ProcessList.h" - -#include "CRT.h" - -#include "debug.h" - extern int TasksMeter_attributes[]; extern MeterType TasksMeter; diff --git a/TraceScreen.c b/TraceScreen.c index d66d20a2..468fba0a 100644 --- a/TraceScreen.c +++ b/TraceScreen.c @@ -5,24 +5,27 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "config.h" +#include "TraceScreen.h" + +#include "CRT.h" +#include "ProcessList.h" +#include "ListItem.h" + #include #include +#include +#include #include #include #include #include #include -#include "TraceScreen.h" -#include "ProcessList.h" +/*{ #include "Process.h" -#include "ListItem.h" #include "Panel.h" #include "FunctionBar.h" -/*{ - typedef struct TraceScreen_ { Process* process; Panel* display; diff --git a/TraceScreen.h b/TraceScreen.h index 7c509d27..62fb67a7 100644 --- a/TraceScreen.h +++ b/TraceScreen.h @@ -9,22 +9,10 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "config.h" -#include -#include -#include -#include -#include -#include -#include - -#include "ProcessList.h" #include "Process.h" -#include "ListItem.h" #include "Panel.h" #include "FunctionBar.h" - typedef struct TraceScreen_ { Process* process; Panel* display; diff --git a/UptimeMeter.c b/UptimeMeter.c index 3aa78977..2987864e 100644 --- a/UptimeMeter.c +++ b/UptimeMeter.c @@ -1,19 +1,22 @@ /* -htop +htop - UptimeMeter.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "UptimeMeter.h" -#include "Meter.h" #include "ProcessList.h" - #include "CRT.h" - #include "debug.h" +#include + +/*{ +#include "Meter.h" +}*/ + int UptimeMeter_attributes[] = { UPTIME }; diff --git a/UptimeMeter.h b/UptimeMeter.h index 3397bbc3..78814def 100644 --- a/UptimeMeter.h +++ b/UptimeMeter.h @@ -3,7 +3,7 @@ #ifndef HEADER_UptimeMeter #define HEADER_UptimeMeter /* -htop +htop - UptimeMeter.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. @@ -11,12 +11,6 @@ in the source distribution for its full text. #include "Meter.h" -#include "ProcessList.h" - -#include "CRT.h" - -#include "debug.h" - extern int UptimeMeter_attributes[]; extern MeterType UptimeMeter; diff --git a/UsersTable.c b/UsersTable.c index f05b815c..ecabb0ad 100644 --- a/UsersTable.c +++ b/UsersTable.c @@ -5,20 +5,21 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "config.h" #include "UsersTable.h" -#include "Hashtable.h" + +#include "config.h" #include #include #include #include #include - -#include "debug.h" +#include #include /*{ +#include "Hashtable.h" + typedef struct UsersTable_ { Hashtable* users; } UsersTable; diff --git a/UsersTable.h b/UsersTable.h index 6b3f2726..93ece0dc 100644 --- a/UsersTable.h +++ b/UsersTable.h @@ -9,18 +9,8 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "config.h" #include "Hashtable.h" -#include -#include -#include -#include -#include - -#include "debug.h" -#include - typedef struct UsersTable_ { Hashtable* users; } UsersTable; diff --git a/Vector.c b/Vector.c index e4d5d5c5..70f8afcd 100644 --- a/Vector.c +++ b/Vector.c @@ -1,20 +1,21 @@ /* -htop +htop - Vector.c (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Vector.h" -#include "Object.h" -#include -#include -#include #include "debug.h" + #include +#include +#include +#include /*{ +#include "Object.h" #define swap(a_,x_,y_) do{ void* tmp_ = a_[x_]; a_[x_] = a_[y_]; a_[y_] = tmp_; }while(0) diff --git a/Vector.h b/Vector.h index 20c0036c..24e2976c 100644 --- a/Vector.h +++ b/Vector.h @@ -3,20 +3,13 @@ #ifndef HEADER_Vector #define HEADER_Vector /* -htop +htop - Vector.h (C) 2004-2011 Hisham H. Muhammad Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ #include "Object.h" -#include -#include -#include - -#include "debug.h" -#include - #define swap(a_,x_,y_) do{ void* tmp_ = a_[x_]; a_[x_] = a_[y_]; a_[y_] = tmp_; }while(0) diff --git a/htop.c b/htop.c index cdd7d456..fec7c77e 100644 --- a/htop.c +++ b/htop.c @@ -5,17 +5,8 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include - #include "ProcessList.h" + #include "CRT.h" #include "Panel.h" #include "UsersTable.h" @@ -24,14 +15,27 @@ in the source distribution for its full text. #include "ScreenManager.h" #include "FunctionBar.h" #include "ListItem.h" +#include "String.h" +#include "ColumnsPanel.h" #include "CategoriesPanel.h" #include "SignalsPanel.h" #include "TraceScreen.h" #include "OpenFilesScreen.h" #include "AffinityPanel.h" - #include "debug.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + //#link m #define INCSEARCH_MAX 40 diff --git a/htop.h b/htop.h index 64ea21bd..227f36d3 100644 --- a/htop.h +++ b/htop.h @@ -9,33 +9,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "ProcessList.h" -#include "CRT.h" -#include "Panel.h" -#include "UsersTable.h" -#include "RichString.h" -#include "Settings.h" -#include "ScreenManager.h" -#include "FunctionBar.h" -#include "ListItem.h" -#include "CategoriesPanel.h" -#include "SignalsPanel.h" -#include "TraceScreen.h" -#include "OpenFilesScreen.h" -#include "AffinityPanel.h" - -#include "debug.h" - //#link m #define INCSEARCH_MAX 40 diff --git a/scripts/MakeHeader.py b/scripts/MakeHeader.py index a84ae74b..55eeed45 100755 --- a/scripts/MakeHeader.py +++ b/scripts/MakeHeader.py @@ -30,6 +30,7 @@ out.write( "" ) out.write( "#ifndef HEADER_" + name ) out.write( "#define HEADER_" + name ) +is_blank = False for line in file.readlines(): line = line[:-1] if state == ANY: @@ -37,6 +38,8 @@ for line in file.readlines(): state = COPY elif line == selfheader: pass + elif line.find("#include") == 0: + pass elif line.find("htop - ") == 0 and line[-2:] == ".c": out.write(line[:-2] + ".h") elif line.find("static ") != -1: @@ -58,14 +61,22 @@ for line in file.readlines(): state = SKIP else: out.write( line ) + is_blank = False + elif line == "": + if not is_blank: + out.write( line ) + is_blank = True else: out.write( line ) + is_blank = False elif state == COPY: + is_blank = False if line == "}*/": state = ANY else: out.write( line ) elif state == SKIP: + is_blank = False if len(line) >= 1 and line[0] == "}": if static == 1: state = SKIPONE @@ -73,6 +84,7 @@ for line in file.readlines(): state = ANY static = 0 elif state == SKIPONE: + is_blank = False state = ANY out.write( "" ) -- cgit v1.2.3