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
Affinity.c
View file @
84281bdc
/*
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 "Affinity.h"
#include <stdlib.h>
#include <stdlib.h>
/*{
/*{
...
...
AffinityPanel.c
View file @
84281bdc
/*
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 "AffinityPanel.h"
#include "Panel.h"
#include "CheckItem.h"
#include "CheckItem.h"
#include "debug.h"
#include "debug.h"
#include <assert.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
)
{
static
HandlerResult
AffinityPanel_eventHandler
(
Panel
*
this
,
int
ch
)
{
CheckItem
*
selected
=
(
CheckItem
*
)
Panel_getSelected
(
this
);
CheckItem
*
selected
=
(
CheckItem
*
)
Panel_getSelected
(
this
);
...
...
AffinityPanel.h
View file @
84281bdc
...
@@ -2,13 +2,17 @@
...
@@ -2,13 +2,17 @@
#ifndef HEADER_AffinityPanel
#ifndef HEADER_AffinityPanel
#define 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 "Panel.h"
#include "CheckItem.h"
#include "Affinity.h"
#include "ProcessList.h"
#include "debug.h"
#include "ListItem.h"
#include <assert.h>
Panel
*
AffinityPanel_new
(
ProcessList
*
pl
,
Affinity
*
affinity
);
Panel
*
AffinityPanel_new
(
ProcessList
*
pl
,
Affinity
*
affinity
);
...
...
AvailableColumnsPanel.c
View file @
84281bdc
/*
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 "AvailableColumnsPanel.h"
#include "Settings.h"
#include "Header.h"
#include "Header.h"
#include "ScreenManager.h"
#include "ColumnsPanel.h"
#include "ColumnsPanel.h"
#include "Panel.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 AvailableColumnsPanel_ {
typedef struct AvailableColumnsPanel_ {
Panel super;
Panel super;
...
...
AvailableColumnsPanel.h
View file @
84281bdc
...
@@ -2,17 +2,16 @@
...
@@ -2,17 +2,16 @@
#ifndef HEADER_AvailableColumnsPanel
#ifndef HEADER_AvailableColumnsPanel
#define 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 "Settings.h"
#include "Header.h"
#include "ScreenManager.h"
#include "ScreenManager.h"
#include "ColumnsPanel.h"
#include "Panel.h"
#include "debug.h"
#include <assert.h>
typedef
struct
AvailableColumnsPanel_
{
typedef
struct
AvailableColumnsPanel_
{
Panel
super
;
Panel
super
;
...
...
AvailableMetersPanel.c
View file @
84281bdc
/*
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 "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 "debug.h"
#include <assert.h>
#include <assert.h>
#include <stdlib.h>
/*{
/*{
#include "Settings.h"
#include "Panel.h"
#include "ScreenManager.h"
typedef struct AvailableMetersPanel_ {
typedef struct AvailableMetersPanel_ {
Panel super;
Panel super;
...
...
AvailableMetersPanel.h
View file @
84281bdc
...
@@ -2,17 +2,16 @@
...
@@ -2,17 +2,16 @@
#ifndef HEADER_AvailableMetersPanel
#ifndef HEADER_AvailableMetersPanel
#define 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 "Settings.h"
#include "Header.h"
#include "ScreenManager.h"
#include "CPUMeter.h"
#include "Panel.h"
#include "Panel.h"
#include "ScreenManager.h"
#include "debug.h"
#include <assert.h>
typedef
struct
AvailableMetersPanel_
{
typedef
struct
AvailableMetersPanel_
{
Panel
super
;
Panel
super
;
...
...
BatteryMeter.c
View file @
84281bdc
/*
/*
htop
htop
- BatteryMeter.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.
This
"M
eter
"
written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com).
This
m
eter written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com).
*/
*/
#include "BatteryMeter.h"
#include "BatteryMeter.h"
#include "Meter.h"
#include "ProcessList.h"
#include "ProcessList.h"
#include "CRT.h"
#include "CRT.h"
#include "String.h"
#include "String.h"
#include "debug.h"
#include "debug.h"
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
#include <unistd.h>
/*{
/*{
#include "Meter.h"
typedef enum ACPresence_ {
typedef enum ACPresence_ {
AC_ABSENT,
AC_ABSENT,
...
...
BatteryMeter.h
View file @
84281bdc
...
@@ -3,20 +3,15 @@
...
@@ -3,20 +3,15 @@
#ifndef HEADER_BatteryMeter
#ifndef HEADER_BatteryMeter
#define HEADER_BatteryMeter
#define HEADER_BatteryMeter
/*
/*
htop
htop
- BatteryMeter.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.
This
"M
eter
"
written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com).
This
m
eter written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com).
*/
*/
#include "Meter.h"
#include "Meter.h"
#include "ProcessList.h"
#include "CRT.h"
#include "String.h"
#include "debug.h"
typedef
enum
ACPresence_
{
typedef
enum
ACPresence_
{
AC_ABSENT
,
AC_ABSENT
,
...
...
CPUMeter.c
View file @
84281bdc
...
@@ -6,17 +6,20 @@ in the source distribution for its full text.
...
@@ -6,17 +6,20 @@ in the source distribution for its full text.
*/
*/
#include "CPUMeter.h"
#include "CPUMeter.h"
#include "Meter.h"
#include "CRT.h"
#include "ProcessList.h"
#include "ProcessList.h"
#include "debug.h"
#include <assert.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 "debug.h"
/*{
#include <assert.h>
#include "Meter.h"
}*/
int
CPUMeter_attributes
[]
=
{
int
CPUMeter_attributes
[]
=
{
CPU_NICE
,
CPU_NORMAL
,
CPU_KERNEL
,
CPU_IRQ
,
CPU_SOFTIRQ
,
CPU_IOWAIT
,
CPU_STEAL
,
CPU_GUEST
CPU_NICE
,
CPU_NORMAL
,
CPU_KERNEL
,
CPU_IRQ
,
CPU_SOFTIRQ
,
CPU_IOWAIT
,
CPU_STEAL
,
CPU_GUEST
...
...
CPUMeter.h
View file @
84281bdc
...
@@ -11,16 +11,6 @@ in the source distribution for its full text.
...
@@ -11,16 +11,6 @@ in the source distribution for its full text.
#include "Meter.h"
#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
[];
extern
int
CPUMeter_attributes
[];
#ifndef MIN
#ifndef MIN
...
...
CRT.c
View file @
84281bdc
...
@@ -7,19 +7,17 @@ in the source distribution for its full text.
...
@@ -7,19 +7,17 @@ in the source distribution for its full text.
#include "CRT.h"
#include "CRT.h"
#include "config.h"
#include "String.h"
#include "debug.h"
#include <curses.h>
#include <curses.h>
#include <signal.h>
#include <signal.h>
#include <stdlib.h>
#include <stdlib.h>
#include <stdbool.h>
#ifdef HAVE_EXECINFO_H
#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
#include <execinfo.h>
#endif
#endif
#include "String.h"
#include "config.h"
#include "debug.h"
#define ColorPair(i,j) COLOR_PAIR((7-i)*8+j)
#define ColorPair(i,j) COLOR_PAIR((7-i)*8+j)
#define COLORSCHEME_DEFAULT 0
#define COLORSCHEME_DEFAULT 0
...
@@ -40,9 +38,8 @@ in the source distribution for its full text.
...
@@ -40,9 +38,8 @@ in the source distribution for its full text.
//#link curses
//#link curses
bool
CRT_hasColors
;
/*{
/*{
#include <stdbool.h>
typedef enum ColorElements_ {
typedef enum ColorElements_ {
RESET_COLOR,
RESET_COLOR,
...
@@ -112,6 +109,8 @@ typedef enum ColorElements_ {
...
@@ -112,6 +109,8 @@ typedef enum ColorElements_ {
// TODO: centralize these in Settings.
// TODO: centralize these in Settings.
static
bool
CRT_hasColors
;
int
CRT_delay
=
0
;
int
CRT_delay
=
0
;
int
CRT_colorScheme
=
0
;
int
CRT_colorScheme
=
0
;
...
...
CRT.h
View file @
84281bdc
...
@@ -9,20 +9,9 @@ Released under the GNU GPL, see the COPYING file
...
@@ -9,20 +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 <curses.h>
#include <signal.h>
#include <stdlib.h>
#include <stdbool.h>
#ifdef HAVE_EXECINFO_H
#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
#endif
#endif
#include "String.h"
#include "config.h"
#include "debug.h"
#define ColorPair(i,j) COLOR_PAIR((7-i)*8+j)
#define ColorPair(i,j) COLOR_PAIR((7-i)*8+j)
#define COLORSCHEME_DEFAULT 0
#define COLORSCHEME_DEFAULT 0
...
@@ -43,8 +32,7 @@ in the source distribution for its full text.
...
@@ -43,8 +32,7 @@ in the source distribution for its full text.
//#link curses
//#link curses
bool
CRT_hasColors
;
#include <stdbool.h>
typedef
enum
ColorElements_
{
typedef
enum
ColorElements_
{
RESET_COLOR
,
RESET_COLOR
,
...
...
CategoriesPanel.c
View file @
84281bdc
/*
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 "CategoriesPanel.h"
#include "AvailableMetersPanel.h"
#include "AvailableMetersPanel.h"
#include "MetersPanel.h"
#include "MetersPanel.h"
#include "DisplayOptionsPanel.h"
#include "DisplayOptionsPanel.h"
#include "ColumnsPanel.h"
#include "ColumnsPanel.h"
#include "ColorsPanel.h"
#include "ColorsPanel.h"
#include "AvailableColumnsPanel.h"
#include "AvailableColumnsPanel.h"
#include "Panel.h"
#include "debug.h"
#include "debug.h"
#include <assert.h>
#include <assert.h>
#include <stdlib.h>
/*{
/*{
#include "Panel.h"
#include "Settings.h"
#include "ScreenManager.h"
typedef struct CategoriesPanel_ {
typedef struct CategoriesPanel_ {
Panel super;
Panel super;
...
...
CategoriesPanel.h
View file @
84281bdc
...
@@ -2,19 +2,16 @@
...
@@ -2,19 +2,16 @@
#ifndef HEADER_CategoriesPanel
#ifndef HEADER_CategoriesPanel
#define HEADER_CategoriesPanel
#define HEADER_CategoriesPanel
/*
#include "AvailableMetersPanel.h"
htop - CategoriesPanel.h
#include "MetersPanel.h"
(C) 2004-2011 Hisham H. Muhammad
#include "DisplayOptionsPanel.h"
Released under the GNU GPL, see the COPYING file
#include "ColumnsPanel.h"
in the source distribution for its full text.
#include "ColorsPanel.h"
*/
#include "AvailableColumnsPanel.h"
#include "Panel.h"
#include "Panel.h"
#include "Settings.h"
#include "debug.h"
#include "ScreenManager.h"
#include <assert.h>
typedef
struct
CategoriesPanel_
{
typedef
struct
CategoriesPanel_
{
Panel
super
;
Panel
super
;
...
...
CheckItem.c
View file @
84281bdc
/*
/*
htop
htop
- CheckItem.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 "CheckItem.h"
#include "CheckItem.h"
#include "Object.h"
#include "CRT.h"
#include "CRT.h"
#include "debug.h"
#include "debug.h"
#include <assert.h>
#include <stdlib.h>
/*{
/*{
#include "Object.h"
typedef struct CheckItem_ {
typedef struct CheckItem_ {
Object super;
Object super;
...
...
CheckItem.h
View file @
84281bdc
...
@@ -3,17 +3,13 @@
...
@@ -3,17 +3,13 @@
#ifndef HEADER_CheckItem
#ifndef HEADER_CheckItem
#define HEADER_CheckItem
#define HEADER_CheckItem
/*
/*
htop
htop
- CheckItem.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 "Object.h"
#include "Object.h"
#include "CRT.h"
#include "debug.h"
typedef
struct
CheckItem_
{
typedef
struct
CheckItem_
{
Object
super
;
Object
super
;
...
...
ClockMeter.c
View file @
84281bdc
/*
/*
htop
htop
- ClockMeter.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 "ClockMeter.h"
#include "ClockMeter.h"
#include "Meter.h"
#include "CRT.h"
#include "debug.h"
#include <time.h>
#include <time.h>
#include "debug.h"
/*{
#include "Meter.h"
}*/
int
ClockMeter_attributes
[]
=
{
int
ClockMeter_attributes
[]
=
{
CLOCK
CLOCK
...
...
ClockMeter.h
View file @
84281bdc
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#ifndef HEADER_ClockMeter
#ifndef HEADER_ClockMeter
#define HEADER_ClockMeter
#define HEADER_ClockMeter
/*
/*
htop
htop
- ClockMeter.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 <time.h>
#include "debug.h"
extern
int
ClockMeter_attributes
[];
extern
int
ClockMeter_attributes
[];
extern
MeterType
ClockMeter
;
extern
MeterType
ClockMeter
;
...
...
ColorsPanel.c
View file @
84281bdc
/*
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 "ColorsPanel.h"
#include "
Panel
.h"
#include "
CRT
.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>
// 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
...
@@ -18,6 +22,9 @@
...
@@ -18,6 +22,9 @@
// * 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;
...
...
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