Commit 84281bdc authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

major header cleanup

parent 81e44312
...@@ -2,17 +2,12 @@ ...@@ -2,17 +2,12 @@
#ifndef HEADER_ColorsPanel #ifndef HEADER_ColorsPanel
#define HEADER_ColorsPanel #define HEADER_ColorsPanel
/*
#include "config.h" htop - ColorsPanel.h
#include "CRT.h" (C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file
#include "Panel.h" in the source distribution for its full text.
#include "CheckItem.h" */
#include "Settings.h"
#include "ScreenManager.h"
#include "debug.h"
#include <assert.h>
// TO ADD A NEW SCHEME: // TO ADD A NEW SCHEME:
// * Increment the size of bool check in ColorsPanel.h // * Increment the size of bool check in ColorsPanel.h
...@@ -20,6 +15,9 @@ ...@@ -20,6 +15,9 @@
// * Add a define in CRT.h that matches the order of the array // * Add a define in CRT.h that matches the order of the array
// * Add the colors in CRT_setColors // * Add the colors in CRT_setColors
#include "Panel.h"
#include "Settings.h"
#include "ScreenManager.h"
typedef struct ColorsPanel_ { typedef struct ColorsPanel_ {
Panel super; Panel super;
......
/*
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 "ColumnsPanel.h"
#include "Panel.h" #include "String.h"
#include "Settings.h"
#include "ScreenManager.h"
#include "debug.h" #include "debug.h"
#include <assert.h> #include <assert.h>
#include <stdlib.h>
#include <ctype.h>
/*{ /*{
#include "Panel.h"
#include "Settings.h"
#include "ScreenManager.h"
typedef struct ColumnsPanel_ { typedef struct ColumnsPanel_ {
Panel super; Panel super;
......
...@@ -2,16 +2,17 @@ ...@@ -2,16 +2,17 @@
#ifndef HEADER_ColumnsPanel #ifndef HEADER_ColumnsPanel
#define 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 "Panel.h"
#include "Settings.h" #include "Settings.h"
#include "ScreenManager.h" #include "ScreenManager.h"
#include "debug.h"
#include <assert.h>
typedef struct ColumnsPanel_ { typedef struct ColumnsPanel_ {
Panel super; Panel super;
......
/*
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 <string.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
#ifndef HEADER_DebugMemory #ifndef HEADER_DebugMemory
#define HEADER_DebugMemory #define HEADER_DebugMemory
/*
#include <string.h> htop - DebugMemory.h
#include <stdlib.h> (C) 2004-2011 Hisham H. Muhammad
#include <stdio.h> Released under the GNU GPL, see the COPYING file
#include <stdbool.h> in the source distribution for its full text.
#include <assert.h> */
#undef strdup #undef strdup
#undef malloc #undef malloc
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#undef free #undef free
typedef struct DebugMemoryItem_ DebugMemoryItem; typedef struct DebugMemoryItem_ DebugMemoryItem;
struct DebugMemoryItem_ { struct DebugMemoryItem_ {
......
/*
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 "DisplayOptionsPanel.h"
#include "Panel.h"
#include "CheckItem.h" #include "CheckItem.h"
#include "Settings.h"
#include "ScreenManager.h"
#include "debug.h" #include "debug.h"
#include <assert.h> #include <assert.h>
#include <stdlib.h>
#include <string.h>
/*{ /*{
#include "Panel.h"
#include "Settings.h"
#include "ScreenManager.h"
typedef struct DisplayOptionsPanel_ { typedef struct DisplayOptionsPanel_ {
Panel super; Panel super;
......
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
#ifndef HEADER_DisplayOptionsPanel #ifndef HEADER_DisplayOptionsPanel
#define 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 "Panel.h"
#include "CheckItem.h"
#include "Settings.h" #include "Settings.h"
#include "ScreenManager.h" #include "ScreenManager.h"
#include "debug.h"
#include <assert.h>
typedef struct DisplayOptionsPanel_ { typedef struct DisplayOptionsPanel_ {
Panel super; Panel super;
......
...@@ -5,19 +5,19 @@ Released under the GNU GPL, see the COPYING file ...@@ -5,19 +5,19 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
*/ */
#include "Object.h"
#include "FunctionBar.h" #include "FunctionBar.h"
#include "CRT.h"
#include "CRT.h"
#include "debug.h" #include "debug.h"
#include <assert.h>
#include <assert.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h> #include <stdbool.h>
#include <curses.h> #include <curses.h>
/*{ /*{
#include "Object.h"
typedef struct FunctionBar_ { typedef struct FunctionBar_ {
Object super; Object super;
......
...@@ -10,16 +10,6 @@ in the source distribution for its full text. ...@@ -10,16 +10,6 @@ in the source distribution for its full text.
*/ */
#include "Object.h" #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_ { typedef struct FunctionBar_ {
Object super; Object super;
......
/* /*
htop htop - Hashtable.c
(C) 2004-2011 Hisham H. Muhammad (C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
...@@ -7,13 +7,14 @@ in the source distribution for its full text. ...@@ -7,13 +7,14 @@ in the source distribution for its full text.
#include "Hashtable.h" #include "Hashtable.h"
#include "debug.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h>
#include <assert.h> #include <assert.h>
#include "debug.h"
/*{ /*{
#include <stdbool.h>
typedef struct Hashtable_ Hashtable; typedef struct Hashtable_ Hashtable;
typedef void(*Hashtable_PairFunction)(int, void*, void*); typedef void(*Hashtable_PairFunction)(int, void*, void*);
......
...@@ -3,18 +3,13 @@ ...@@ -3,18 +3,13 @@
#ifndef HEADER_Hashtable #ifndef HEADER_Hashtable
#define HEADER_Hashtable #define HEADER_Hashtable
/* /*
htop htop - Hashtable.h
(C) 2004-2011 Hisham H. Muhammad (C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
*/ */
#include <stdlib.h>
#include <stdbool.h> #include <stdbool.h>
#include <assert.h>
#include "debug.h"
typedef struct Hashtable_ Hashtable; typedef struct Hashtable_ Hashtable;
......
...@@ -6,13 +6,28 @@ in the source distribution for its full text. ...@@ -6,13 +6,28 @@ in the source distribution for its full text.
*/ */
#include "Header.h" #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 "debug.h"
#include <assert.h> #include <assert.h>
#include <time.h> #include <time.h>
#include <string.h>
#include <stdlib.h>
/*{ /*{
#include "ProcessList.h"
#include "Meter.h"
typedef enum HeaderSide_ { typedef enum HeaderSide_ {
LEFT_HEADER, LEFT_HEADER,
......
...@@ -9,13 +9,9 @@ Released under the GNU GPL, see the COPYING file ...@@ -9,13 +9,9 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
*/ */
#include "ProcessList.h"
#include "Meter.h" #include "Meter.h"
#include "debug.h"
#include <assert.h>
#include <time.h>
typedef enum HeaderSide_ { typedef enum HeaderSide_ {
LEFT_HEADER, LEFT_HEADER,
RIGHT_HEADER RIGHT_HEADER
......
/* /*
htop htop - HostnameMeter.c
(C) 2004-2011 Hisham H. Muhammad (C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
*/ */
#include "HostnameMeter.h" #include "HostnameMeter.h"
#include "Meter.h"
#include "CRT.h"
#include "debug.h"
#include <unistd.h> #include <unistd.h>
#include "debug.h" /*{
#include "Meter.h"
}*/
int HostnameMeter_attributes[] = { int HostnameMeter_attributes[] = {
HOSTNAME HOSTNAME
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#ifndef HEADER_HostnameMeter #ifndef HEADER_HostnameMeter
#define HEADER_HostnameMeter #define HEADER_HostnameMeter
/* /*
htop htop - HostnameMeter.h
(C) 2004-2011 Hisham H. Muhammad (C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
...@@ -11,10 +11,6 @@ in the source distribution for its full text. ...@@ -11,10 +11,6 @@ in the source distribution for its full text.
#include "Meter.h" #include "Meter.h"
#include <unistd.h>
#include "debug.h"
extern int HostnameMeter_attributes[]; extern int HostnameMeter_attributes[];
extern MeterType HostnameMeter; extern MeterType HostnameMeter;
......
...@@ -6,14 +6,18 @@ in the source distribution for its full text. ...@@ -6,14 +6,18 @@ in the source distribution for its full text.
*/ */
#include "ListItem.h" #include "ListItem.h"
#include "CRT.h"
#include "String.h" #include "String.h"
#include "Object.h"
#include "RichString.h" #include "RichString.h"
#include <string.h>
#include "debug.h" #include "debug.h"
#include <string.h>
#include <assert.h>
#include <stdlib.h>
/*{ /*{
#include "Object.h"
typedef struct ListItem_ { typedef struct ListItem_ {
Object super; Object super;
......
...@@ -9,13 +9,7 @@ Released under the GNU GPL, see the COPYING file ...@@ -9,13 +9,7 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
*/ */
#include "String.h"
#include "Object.h" #include "Object.h"
#include "RichString.h"
#include <string.h>
#include "debug.h"
typedef struct ListItem_ { typedef struct ListItem_ {
Object super; Object super;
......
/* /*
htop htop - LoadAverageMeter.c
(C) 2004-2011 Hisham H. Muhammad (C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
*/ */
#include "LoadAverageMeter.h" #include "LoadAverageMeter.h"
#include "Meter.h"
#include "CRT.h"
#include "debug.h"
#include <curses.h> #include <curses.h>
#include <assert.h>
#include "debug.h" /*{
#include "Meter.h"
}*/
int LoadAverageMeter_attributes[] = { int LoadAverageMeter_attributes[] = {
LOAD_AVERAGE_FIFTEEN, LOAD_AVERAGE_FIVE, LOAD_AVERAGE_ONE LOAD_AVERAGE_FIFTEEN, LOAD_AVERAGE_FIVE, LOAD_AVERAGE_ONE
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#ifndef HEADER_LoadAverageMeter #ifndef HEADER_LoadAverageMeter
#define HEADER_LoadAverageMeter #define HEADER_LoadAverageMeter
/* /*
htop htop - LoadAverageMeter.h
(C) 2004-2011 Hisham H. Muhammad (C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
...@@ -11,10 +11,6 @@ in the source distribution for its full text. ...@@ -11,10 +11,6 @@ in the source distribution for its full text.
#include "Meter.h" #include "Meter.h"
#include <curses.h>
#include "debug.h"
extern int LoadAverageMeter_attributes[]; extern int LoadAverageMeter_attributes[];
extern int LoadMeter_attributes[]; extern int LoadMeter_attributes[];
......
/* /*
htop htop - MemoryMeter.c
(C) 2004-2011 Hisham H. Muhammad (C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file Released under the GNU GPL, see the COPYING file
in the source distribution for its full text. in the source distribution for its full text.
*/ */
#include "MemoryMeter.h" #include "MemoryMeter.h"
#include "Meter.h"
#include "CRT.h"
#include "ProcessList.h" #include "ProcessList.h"
#include "debug.h"
#include <stdlib.h> #include <stdlib.h>
#include <curses.h> #include <curses.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include <sys/param.h> #include <sys/param.h>
#include "debug.h"
#include <assert.h> #include <assert.h>
/*{
#include "Meter.h"
}*/
int MemoryMeter_attributes[] = { int MemoryMeter_attributes[] = {
MEMORY_USED, MEMORY_BUFFERS, MEMORY_CACHE MEMORY_USED, MEMORY_BUFFERS, MEMORY_CACHE
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment