summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2011-12-26 21:35:57 +0000
committerHisham Muhammad <hisham@gobolinux.org>2011-12-26 21:35:57 +0000
commit84281bdc44ea42e110efd256cdcdd37a84276204 (patch)
tree77b2b1f5e8bfc57bd6bdb82ac215e84d9f3179e2
parent81e44312b4976d5516f129f36a67fe381bcb6883 (diff)
major header cleanup
-rw-r--r--Affinity.c8
-rw-r--r--AffinityPanel.c19
-rw-r--r--AffinityPanel.h14
-rw-r--r--AvailableColumnsPanel.c18
-rw-r--r--AvailableColumnsPanel.h15
-rw-r--r--AvailableMetersPanel.c20
-rw-r--r--AvailableMetersPanel.h15
-rw-r--r--BatteryMeter.c18
-rw-r--r--BatteryMeter.h15
-rw-r--r--CPUMeter.c9
-rw-r--r--CPUMeter.h10
-rw-r--r--CRT.c15
-rw-r--r--CRT.h14
-rw-r--r--CategoriesPanel.c15
-rw-r--r--CategoriesPanel.h19
-rw-r--r--CheckItem.c9
-rw-r--r--CheckItem.h6
-rw-r--r--ClockMeter.c10
-rw-r--r--ClockMeter.h6
-rw-r--r--ColorsPanel.c19
-rw-r--r--ColorsPanel.h20
-rw-r--r--ColumnsPanel.c17
-rw-r--r--ColumnsPanel.h11
-rw-r--r--DebugMemory.c6
-rw-r--r--DebugMemory.h13
-rw-r--r--DisplayOptionsPanel.c16
-rw-r--r--DisplayOptionsPanel.h12
-rw-r--r--FunctionBar.c6
-rw-r--r--FunctionBar.h10
-rw-r--r--Hashtable.c9
-rw-r--r--Hashtable.h7
-rw-r--r--Header.c17
-rw-r--r--Header.h6
-rw-r--r--HostnameMeter.c10
-rw-r--r--HostnameMeter.h6
-rw-r--r--ListItem.c10
-rw-r--r--ListItem.h6
-rw-r--r--LoadAverageMeter.c11
-rw-r--r--LoadAverageMeter.h6
-rw-r--r--MemoryMeter.c11
-rw-r--r--MemoryMeter.h13
-rw-r--r--Meter.c33
-rw-r--r--Meter.h29
-rw-r--r--MetersPanel.c15
-rw-r--r--MetersPanel.h11
-rw-r--r--Object.c9
-rw-r--r--Object.h9
-rw-r--r--OpenFilesScreen.c14
-rw-r--r--OpenFilesScreen.h12
-rw-r--r--Panel.c14
-rw-r--r--Panel.h16
-rw-r--r--Process.c12
-rw-r--r--Process.h27
-rw-r--r--ProcessList.c27
-rw-r--r--ProcessList.h25
-rw-r--r--RichString.c20
-rw-r--r--RichString.h16
-rw-r--r--ScreenManager.c13
-rw-r--r--ScreenManager.h13
-rw-r--r--Settings.c14
-rw-r--r--Settings.h10
-rw-r--r--SignalsPanel.c12
-rw-r--r--SignalsPanel.h14
-rw-r--r--String.c9
-rw-r--r--String.h10
-rw-r--r--SwapMeter.c11
-rw-r--r--SwapMeter.h13
-rw-r--r--TasksMeter.c9
-rw-r--r--TasksMeter.h8
-rw-r--r--TraceScreen.c15
-rw-r--r--TraceScreen.h12
-rw-r--r--UptimeMeter.c11
-rw-r--r--UptimeMeter.h8
-rw-r--r--UsersTable.c9
-rw-r--r--UsersTable.h10
-rw-r--r--Vector.c11
-rw-r--r--Vector.h9
-rw-r--r--htop.c26
-rw-r--r--htop.h27
-rwxr-xr-xscripts/MakeHeader.py12
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 <stdlib.h>
/*{
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 <assert.h>
+#include <string.h>
+
+/*{
+#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 <assert.h>
+#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 <assert.h>
+#include <stdlib.h>
+#include <ctype.h>
/*{
+#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 <assert.h>
-
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 <assert.h>
+#include <stdlib.h>
/*{
+#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 <assert.h>
-
+#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 <string.h>
+#include <stdlib.h>
+#include <dirent.h>
+#include <unistd.h>
+
/*{
+#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 <assert.h>
#include <stdlib.h>
#include <curses.h>
#include <string.h>
#include <math.h>
-#include "debug.h"
-#include <assert.h>
+/*{
+#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 <stdlib.h>
-#include <curses.h>
-#include <string.h>
-#include <math.h>
-
-#include "debug.h"
-#include <assert.h>
-
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 <curses.h>
#include <signal.h>
#include <stdlib.h>
-#include <stdbool.h>
#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
#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 <stdbool.h>
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 <curses.h>
-#include <signal.h>
-#include <stdlib.h>
-#include <stdbool.h>
#ifdef HAVE_EXECINFO_H
-#include <execinfo.h>
#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 <stdbool.h>
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 <assert.h>
+#include <stdlib.h>
/*{
+#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 <assert.h>
-
+#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 <assert.h>
+#include <stdlib.h>
+
/*{
+#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 <time.h>
-#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 <time.h>
-
-#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 <assert.h>
+#include <stdlib.h>
+#include <string.h>
// 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 <assert.h>
+/*
+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 <assert.h>
+#include <stdlib.h>
+#include <ctype.h>
/*{
+#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 <assert.h>
-
-
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 <string.h>
#include <stdlib.h>
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 <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdbool.h>
-#include <assert.h>
+/*
+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 <assert.h>
+#include <stdlib.h>
+#include <string.h>
/*{
+#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 <assert.h>
-
-
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 <assert.h>
+#include <assert.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <curses.h>
/*{
+#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 <assert.h>
-
-#include <string.h>
-#include <stdlib.h>
-#include <stdbool.h>
-#include <curses.h>
-
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 <stdlib.h>
-#include <stdbool.h>
#include <assert.h>
-#include "debug.h"
-
/*{
+#include <stdbool.h>
+
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 <stdlib.h>
#include <stdbool.h>
-#include <assert.h>
-
-#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 <assert.h>
#include <time.h>
+#include <string.h>
+#include <stdlib.h>
/*{
+#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 <assert.h>
-#include <time.h>
-
-
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 <unistd.h>
-#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 <unistd.h>
-
-#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 <string.h>
-
#include "debug.h"
+#include <string.h>
+#include <assert.h>
+#include <stdlib.h>
+
/*{
+#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 <string.h>
-
-#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 <curses.h>
+#include <assert.h>
-#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 <curses.h>
-
-#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 <stdlib.h>
#include <curses.h>
#include <string.h>
#include <math.h>
#include <sys/param.h>
-
-#include "debug.h"
#include <assert.h>
+/*{
+#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 <stdlib.h>
-#include <curses.h>
-#include <string.h>
-#include <math.h>
-#include <sys/param.h>
-
-#include "debug.h"
-#include <assert.h>
-
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 <math.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
-
-#include "debug.h"
#include <assert.h>
+#include <time.h>
#ifndef USE_FUNKY_MODES
-#include <time.h>
#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 <math.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-#include "debug.h"
-#include <assert.h>
-
#ifndef USE_FUNKY_MODES
-#include <time.h>
#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 <stdlib.h>
#include <assert.h>
/*{
+#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 <assert.h>
-
-
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 <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
-#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 <stdlib.h>
-#include <stdio.h>
-#include <stdbool.h>
-
-#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 <string.h>
#include <stdio.h>
#include <unistd.h>
#include <stdbool.h>
#include <unistd.h>
+#include <stdlib.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/wait.h>
-#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 <stdio.h>
-#include <unistd.h>
-#include <stdbool.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/wait.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/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 <math.h>
#include <stdbool.h>
-
-#include "debug.h"
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
#include <assert.h>
-
#include <curses.h>
+
//#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 <math.h>
-#include <stdbool.h>
-
-#include "debug.h"
-#include <assert.h>
-
-#include <curses.h>
//#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 <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/param.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <stdbool.h>
#include <pwd.h>
#include <sched.h>
#include <time.h>
+#include <assert.h>
#ifdef HAVE_LIBHWLOC
#include <hwloc/linux.h>
@@ -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 <sys/types.h>
#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 <stdio.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <signal.h>
-#include <string.h>
-#include <stdbool.h>
-#include <pwd.h>
-#include <sched.h>
-#include <time.h>
-
#ifdef HAVE_LIBHWLOC
-#include <hwloc/linux.h>
#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 <sys/types.h>
#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 <sys/types.h>
+#include <sys/time.h>
+#include <sys/utsname.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
@@ -26,14 +20,19 @@ in the source distribution for its full text.
#include <stdio.h>
#include <signal.h>
#include <stdbool.h>
-#include <sys/utsname.h>
#include <stdarg.h>
#include <math.h>
-
-#include "debug.h"
+#include <string.h>
+#include <time.h>
#include <assert.h>
/*{
+#include "Vector.h"
+#include "Hashtable.h"
+#include "UsersTable.h"
+#include "Panel.h"
+#include "Process.h"
+#include <sys/types.h>
#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 <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <signal.h>
-#include <stdbool.h>
-#include <sys/utsname.h>
-#include <stdarg.h>
-#include <math.h>
-
-#include "debug.h"
-#include <assert.h>
-
#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 <stdlib.h>
#include <string.h>
+
+#define RICHSTRING_MAXLEN 300
+
+/*{
+#include "config.h"
#include <ctype.h>
#include "debug.h"
@@ -22,10 +28,6 @@
#include <curses.h>
#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 <stdlib.h>
-#include <string.h>
#include <ctype.h>
#include "debug.h"
@@ -25,9 +26,6 @@
#include <curses.h>
#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 <assert.h>
#include <time.h>
-
+#include <stdlib.h>
#include <stdbool.h>
/*{
+#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 <assert.h>
-#include <time.h>
-
-#include <stdbool.h>
-
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 <sys/stat.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
#define DEFAULT_DELAY 15
/*{
+#include "ProcessList.h"
+#include "Header.h"
+#include <stdbool.h>
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 <stdbool.h>
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 <stdlib.h>
#include <assert.h>
#include <ctype.h>
/*{
+#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 <assert.h>
-
-#include <ctype.h>
-
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 <string.h>
#include <strings.h>
#include <stdlib.h>
#include <stdio.h>
-#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 <string.h>
-#include <strings.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#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 <stdlib.h>
#include <curses.h>
#include <string.h>
#include <math.h>
#include <sys/param.h>
-
-#include "debug.h"
#include <assert.h>
+/*{
+#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 <stdlib.h>
-#include <curses.h>
-#include <string.h>
-#include <math.h>
-#include <sys/param.h>
-
-#include "debug.h"
-#include <assert.h>
-
#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 <stdio.h>
#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/wait.h>
-#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 <stdio.h>
-#include <unistd.h>
-#include <stdbool.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/wait.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/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 <math.h>
+
+/*{
+#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 <stdio.h>
#include <string.h>
#include <strings.h>
#include <pwd.h>
#include <sys/types.h>
-
-#include "debug.h"
+#include <stdlib.h>
#include <assert.h>
/*{
+#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 <stdio.h>
-#include <string.h>
-#include <strings.h>
-#include <pwd.h>
-#include <sys/types.h>
-
-#include "debug.h"
-#include <assert.h>
-
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 <stdlib.h>
-#include <string.h>
-#include <stdbool.h>
#include "debug.h"
+
#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdbool.h>
/*{
+#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 <stdlib.h>
-#include <string.h>
-#include <stdbool.h>
-
-#include "debug.h"
-#include <assert.h>
-
#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 <unistd.h>
-#include <math.h>
-#include <sys/param.h>
-#include <ctype.h>
-#include <stdbool.h>
-#include <locale.h>
-#include <getopt.h>
-
#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 <unistd.h>
+#include <math.h>
+#include <ctype.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <locale.h>
+#include <getopt.h>
+#include <pwd.h>
+#include <string.h>
+#include <sys/param.h>
+#include <sys/time.h>
+
//#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 <unistd.h>
-#include <math.h>
-#include <sys/param.h>
-#include <ctype.h>
-#include <stdbool.h>
-#include <locale.h>
-#include <getopt.h>
-
-#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( "" )

© 2014-2024 Faster IT GmbH | imprint | privacy policy