Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
84281bdc
Commit
84281bdc
authored
Dec 26, 2011
by
Hisham Muhammad
Browse files
major header cleanup
parent
81e44312
Changes
80
Show whitespace changes
Inline
Side-by-side
ColorsPanel.h
View file @
84281bdc
...
@@ -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
;
...
...
ColumnsPanel.c
View file @
84281bdc
/*
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;
...
...
ColumnsPanel.h
View file @
84281bdc
...
@@ -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
;
...
...
DebugMemory.c
View file @
84281bdc
/*
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>
...
...
DebugMemory.h
View file @
84281bdc
...
@@ -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
#
in
clude <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_
{
...
...
DisplayOptionsPanel.c
View file @
84281bdc
/*
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;
...
...
DisplayOptionsPanel.h
View file @
84281bdc
...
@@ -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
;
...
...
FunctionBar.c
View file @
84281bdc
...
@@ -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;
...
...
FunctionBar.h
View file @
84281bdc
...
@@ -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
;
...
...
Hashtable.c
View file @
84281bdc
/*
/*
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*);
...
...
Hashtable.h
View file @
84281bdc
...
@@ -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
;
...
...
Header.c
View file @
84281bdc
...
@@ -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,
...
...
Header.h
View file @
84281bdc
...
@@ -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
...
...
HostnameMeter.c
View file @
84281bdc
/*
/*
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
...
...
HostnameMeter.h
View file @
84281bdc
...
@@ -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
;
...
...
ListItem.c
View file @
84281bdc
...
@@ -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;
...
...
ListItem.h
View file @
84281bdc
...
@@ -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
;
...
...
LoadAverageMeter.c
View file @
84281bdc
/*
/*
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
...
...
LoadAverageMeter.h
View file @
84281bdc
...
@@ -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
[];
...
...
MemoryMeter.c
View file @
84281bdc
/*
/*
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
};
};
...
...
Prev
1
2
3
4
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment