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

major header cleanup

parent 81e44312
......@@ -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;
......
......@@ -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
......
......@@ -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
......
/*
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;
......
......@@ -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;
......
/*
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)
......
......@@ -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)
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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
......@@ -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)
......
......@@ -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)
......
......@@ -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"
......
......@@ -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"
......
/*
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)
......
......@@ -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)
......
/*
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,
......
......@@ -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,
......
......@@ -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;
......
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