summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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"