From 8ec5d4a3a07fe9a3c556a4abeac6645a7bb2235e Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Tue, 8 Sep 2020 17:33:50 +1000 Subject: Further, minor cleanups to headers post-MakeHeaders Remove leftover empty ifdef/endif pairs, whitespace. The generated htop.h file was also unused - removed. --- Action.h | 3 --- Affinity.h | 2 -- AffinityPanel.h | 18 ------------------ AvailableColumnsPanel.h | 1 - AvailableMetersPanel.h | 1 - CPUMeter.h | 1 - CRT.c | 2 -- CRT.h | 2 -- CategoriesPanel.h | 1 - CheckItem.h | 1 - ColorsPanel.h | 1 - ColumnsPanel.h | 1 - DisplayOptionsPanel.h | 1 - FunctionBar.h | 3 --- Header.h | 3 --- IncSet.h | 2 -- ListItem.h | 1 - MainPanel.h | 1 - Makefile.am | 2 +- Meter.h | 6 ------ Object.h | 1 - OpenFilesScreen.h | 1 - Panel.c | 3 --- Panel.h | 3 --- ScreenManager.h | 1 - Settings.h | 3 --- SignalsPanel.h | 2 -- Vector.h | 6 ------ darwin/Battery.h | 1 - darwin/DarwinCRT.h | 1 - darwin/DarwinProcess.h | 1 - darwin/DarwinProcessList.h | 1 - dragonflybsd/DragonFlyBSDCRT.h | 4 ---- dragonflybsd/DragonFlyBSDProcess.h | 8 -------- dragonflybsd/DragonFlyBSDProcessList.h | 7 +------ dragonflybsd/Platform.h | 1 - freebsd/FreeBSDCRT.h | 1 - freebsd/FreeBSDProcess.h | 10 +--------- freebsd/FreeBSDProcessList.h | 4 ---- freebsd/Platform.h | 1 - htop.h | 17 ----------------- linux/Battery.h | 18 ------------------ linux/IOPriority.h | 2 -- linux/LinuxCRT.h | 3 --- linux/LinuxProcess.h | 7 ------- linux/LinuxProcessList.h | 34 ---------------------------------- openbsd/OpenBSDCRT.h | 1 - openbsd/OpenBSDProcess.h | 8 +------- openbsd/OpenBSDProcessList.h | 6 ------ openbsd/Platform.h | 12 +----------- solaris/Battery.h | 1 - solaris/Platform.h | 1 - solaris/SolarisCRT.h | 3 --- solaris/SolarisProcess.h | 9 +-------- solaris/SolarisProcessList.h | 2 -- unsupported/Battery.h | 1 - unsupported/UnsupportedCRT.h | 1 - unsupported/UnsupportedProcess.h | 2 -- unsupported/UnsupportedProcessList.h | 2 -- zfs/ZfsArcMeter.h | 2 -- zfs/ZfsArcStats.h | 3 --- zfs/ZfsCompressedArcMeter.h | 2 -- zfs/openzfs_sysctl.h | 2 -- 63 files changed, 6 insertions(+), 246 deletions(-) delete mode 100644 htop.h diff --git a/Action.h b/Action.h index ed13612c..cf0169c4 100644 --- a/Action.h +++ b/Action.h @@ -7,7 +7,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - #include "IncSet.h" #include "Settings.h" #include "Header.h" @@ -36,7 +35,6 @@ typedef struct State_ { Header* header; } State; - Object* Action_pickFromVector(State* st, Panel* list, int x, bool followProcess); // ---------------------------------------- @@ -49,7 +47,6 @@ Htop_Reaction Action_setSortKey(Settings* settings, ProcessField sortKey); Htop_Reaction Action_follow(State* st); - void Action_setBindings(Htop_Action* keys); #endif diff --git a/Affinity.h b/Affinity.h index 8ee158d6..6bdd9750 100644 --- a/Affinity.h +++ b/Affinity.h @@ -14,7 +14,6 @@ in the source distribution for its full text. #else #define HTOP_HWLOC_CPUBIND_FLAG HWLOC_CPUBIND_PROCESS #endif -#elif HAVE_LINUX_AFFINITY #endif #include "Process.h" @@ -27,7 +26,6 @@ typedef struct Affinity_ { int* cpus; } Affinity; - Affinity* Affinity_new(ProcessList* pl); void Affinity_delete(Affinity* this); diff --git a/AffinityPanel.h b/AffinityPanel.h index f6ed350d..61e4287a 100644 --- a/AffinityPanel.h +++ b/AffinityPanel.h @@ -7,28 +7,10 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#ifdef HAVE_LIBHWLOC -#endif - #include "Panel.h" #include "Affinity.h" #include "ProcessList.h" - - -#ifdef HAVE_LIBHWLOC - -#endif - - -#ifdef HAVE_LIBHWLOC - -#endif - -#ifdef HAVE_LIBHWLOC - -#endif - extern PanelClass AffinityPanel_class; Panel* AffinityPanel_new(ProcessList* pl, Affinity* affinity, int* width); diff --git a/AvailableColumnsPanel.h b/AvailableColumnsPanel.h index ad70fbbb..62928058 100644 --- a/AvailableColumnsPanel.h +++ b/AvailableColumnsPanel.h @@ -14,7 +14,6 @@ typedef struct AvailableColumnsPanel_ { Panel* columns; } AvailableColumnsPanel; - extern PanelClass AvailableColumnsPanel_class; AvailableColumnsPanel* AvailableColumnsPanel_new(Panel* columns); diff --git a/AvailableMetersPanel.h b/AvailableMetersPanel.h index 93db0dac..ecebb28d 100644 --- a/AvailableMetersPanel.h +++ b/AvailableMetersPanel.h @@ -22,7 +22,6 @@ typedef struct AvailableMetersPanel_ { Panel* rightPanel; } AvailableMetersPanel; - extern PanelClass AvailableMetersPanel_class; AvailableMetersPanel* AvailableMetersPanel_new(Settings* settings, Header* header, Panel* leftMeters, Panel* rightMeters, ScreenManager* scr, ProcessList* pl); diff --git a/CPUMeter.h b/CPUMeter.h index 56353c69..2caa8291 100644 --- a/CPUMeter.h +++ b/CPUMeter.h @@ -22,7 +22,6 @@ typedef enum { CPU_METER_ITEMCOUNT = 9, // number of entries in this enum } CPUMeterValues; - extern int CPUMeter_attributes[]; #ifndef MIN diff --git a/CRT.c b/CRT.c index a9147f9a..2a7c7912 100644 --- a/CRT.c +++ b/CRT.c @@ -43,8 +43,6 @@ in the source distribution for its full text. #define KEY_WHEELDOWN KEY_F(21) #define KEY_RECLICK KEY_F(22) -//#link curses - const char *CRT_treeStrAscii[TREE_STR_COUNT] = { "-", // TREE_STR_HORZ "|", // TREE_STR_VERT diff --git a/CRT.h b/CRT.h index 398fed31..2e21e91e 100644 --- a/CRT.h +++ b/CRT.h @@ -30,8 +30,6 @@ in the source distribution for its full text. #define KEY_WHEELDOWN KEY_F(21) #define KEY_RECLICK KEY_F(22) -//#link curses - #include typedef enum TreeStr_ { diff --git a/CategoriesPanel.h b/CategoriesPanel.h index e6c7026d..fefc3e93 100644 --- a/CategoriesPanel.h +++ b/CategoriesPanel.h @@ -21,7 +21,6 @@ typedef struct CategoriesPanel_ { ProcessList* pl; } CategoriesPanel; - void CategoriesPanel_makeMetersPage(CategoriesPanel* this); extern PanelClass CategoriesPanel_class; diff --git a/CheckItem.h b/CheckItem.h index 654c21f4..11ac35f5 100644 --- a/CheckItem.h +++ b/CheckItem.h @@ -16,7 +16,6 @@ typedef struct CheckItem_ { bool value; } CheckItem; - extern ObjectClass CheckItem_class; CheckItem* CheckItem_newByRef(char* text, bool* ref); diff --git a/ColorsPanel.h b/ColorsPanel.h index 96a82a42..9977dc0b 100644 --- a/ColorsPanel.h +++ b/ColorsPanel.h @@ -24,7 +24,6 @@ typedef struct ColorsPanel_ { ScreenManager* scr; } ColorsPanel; - extern PanelClass ColorsPanel_class; ColorsPanel* ColorsPanel_new(Settings* settings, ScreenManager* scr); diff --git a/ColumnsPanel.h b/ColumnsPanel.h index 89f500ab..be139a6e 100644 --- a/ColumnsPanel.h +++ b/ColumnsPanel.h @@ -17,7 +17,6 @@ typedef struct ColumnsPanel_ { bool moving; } ColumnsPanel; - extern PanelClass ColumnsPanel_class; ColumnsPanel* ColumnsPanel_new(Settings* settings); diff --git a/DisplayOptionsPanel.h b/DisplayOptionsPanel.h index 69b8a3d5..499b2fc1 100644 --- a/DisplayOptionsPanel.h +++ b/DisplayOptionsPanel.h @@ -18,7 +18,6 @@ typedef struct DisplayOptionsPanel_ { ScreenManager* scr; } DisplayOptionsPanel; - extern PanelClass DisplayOptionsPanel_class; DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager* scr); diff --git a/FunctionBar.h b/FunctionBar.h index 8971d1a5..486990fc 100644 --- a/FunctionBar.h +++ b/FunctionBar.h @@ -7,7 +7,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - #include typedef struct FunctionBar_ { @@ -18,8 +17,6 @@ typedef struct FunctionBar_ { bool staticData; } FunctionBar; - - FunctionBar* FunctionBar_newEnterEsc(const char* enter, const char* esc); FunctionBar* FunctionBar_new(const char* const* functions, const char* const* keys, const int* events); diff --git a/Header.h b/Header.h index 73f264dc..e281a0c2 100644 --- a/Header.h +++ b/Header.h @@ -20,14 +20,11 @@ typedef struct Header_ { int height; } Header; - #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) #endif -#ifndef Header_forEachColumn #define Header_forEachColumn(this_, i_) for (int (i_)=0; (i_) < (this_)->nrColumns; ++(i_)) -#endif Header* Header_new(struct ProcessList_* pl, Settings* settings, int nrColumns); diff --git a/IncSet.h b/IncSet.h index 75949b0a..2fb22c49 100644 --- a/IncSet.h +++ b/IncSet.h @@ -7,7 +7,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - #include "FunctionBar.h" #include "Panel.h" #include @@ -38,7 +37,6 @@ typedef struct IncSet_ { typedef const char* (*IncMode_GetPanelValue)(Panel*, int); - void IncSet_reset(IncSet* this, IncType type); IncSet* IncSet_new(FunctionBar* bar); diff --git a/ListItem.h b/ListItem.h index 253f991c..3fea7257 100644 --- a/ListItem.h +++ b/ListItem.h @@ -16,7 +16,6 @@ typedef struct ListItem_ { bool moving; } ListItem; - extern ObjectClass ListItem_class; ListItem* ListItem_new(const char* value, int key); diff --git a/MainPanel.h b/MainPanel.h index 321f130c..582dd2ec 100644 --- a/MainPanel.h +++ b/MainPanel.h @@ -24,7 +24,6 @@ typedef bool(*MainPanel_ForeachProcessFn)(Process*, Arg); #define MainPanel_getFunctionBar(this_) (((Panel*)(this_))->defaultBar) - void MainPanel_updateTreeFunctions(MainPanel* this, bool mode); void MainPanel_pidSearch(MainPanel* this, int ch); diff --git a/Makefile.am b/Makefile.am index 5bf172b0..fbbf7bef 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,7 +29,7 @@ InfoScreen.c XAlloc.c myhtopheaders = AvailableColumnsPanel.h AvailableMetersPanel.h \ CategoriesPanel.h CheckItem.h ClockMeter.h ColorsPanel.h ColumnsPanel.h \ CPUMeter.h CRT.h MainPanel.h DisplayOptionsPanel.h FunctionBar.h \ -Hashtable.h Header.h htop.h ListItem.h LoadAverageMeter.h MemoryMeter.h \ +Hashtable.h Header.h ListItem.h LoadAverageMeter.h MemoryMeter.h \ BatteryMeter.h Meter.h MetersPanel.h Object.h Panel.h ProcessList.h RichString.h \ ScreenManager.h Settings.h SignalsPanel.h StringUtils.h SwapMeter.h \ TasksMeter.h UptimeMeter.h TraceScreen.h UsersTable.h Vector.h Process.h \ diff --git a/Meter.h b/Meter.h index 1708a8ab..7936fb78 100644 --- a/Meter.h +++ b/Meter.h @@ -94,7 +94,6 @@ typedef struct GraphData_ { double values[METER_BUFFER_LEN]; } GraphData; - #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif @@ -126,7 +125,6 @@ ListItem* Meter_toListItem(Meter* this, bool moving); /* ---------- GraphMeterMode ---------- */ #ifdef HAVE_LIBNCURSESW - #define PIXPERROW_UTF8 4 #endif @@ -134,10 +132,6 @@ ListItem* Meter_toListItem(Meter* this, bool moving); /* ---------- LEDMeterMode ---------- */ -#ifdef HAVE_LIBNCURSESW - -#endif - extern MeterMode* Meter_modes[]; /* Blank meter */ diff --git a/Object.h b/Object.h index f6874295..e73230c0 100644 --- a/Object.h +++ b/Object.h @@ -45,7 +45,6 @@ typedef union { void* v; } Arg; - extern ObjectClass Object_class; #ifdef DEBUG diff --git a/OpenFilesScreen.h b/OpenFilesScreen.h index 9fc1216b..2c83cf1d 100644 --- a/OpenFilesScreen.h +++ b/OpenFilesScreen.h @@ -29,7 +29,6 @@ typedef struct OpenFilesScreen_ { pid_t pid; } OpenFilesScreen; - extern InfoScreenClass OpenFilesScreen_class; OpenFilesScreen* OpenFilesScreen_new(Process* process); diff --git a/Panel.c b/Panel.c index 297dc89c..73fa7858 100644 --- a/Panel.c +++ b/Panel.c @@ -19,9 +19,6 @@ in the source distribution for its full text. #include #include -//#link curses - - #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif diff --git a/Panel.h b/Panel.h index be8646ab..17b65c95 100644 --- a/Panel.h +++ b/Panel.h @@ -7,8 +7,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -//#link curses - #include "Object.h" #include "Vector.h" #include "FunctionBar.h" @@ -61,7 +59,6 @@ struct Panel_ { #define Panel_setDefaultBar(this_) do{ (this_)->currentBar = (this_)->defaultBar; }while(0) - #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif diff --git a/ScreenManager.h b/ScreenManager.h index 5907ce55..69d983a0 100644 --- a/ScreenManager.h +++ b/ScreenManager.h @@ -32,7 +32,6 @@ typedef struct ScreenManager_ { bool allowFocusChange; } ScreenManager; - ScreenManager* ScreenManager_new(int x1, int y1, int x2, int y2, Orientation orientation, const Header* header, const Settings* settings, bool owner); void ScreenManager_delete(ScreenManager* this); diff --git a/Settings.h b/Settings.h index 63b6e8a3..0188b614 100644 --- a/Settings.h +++ b/Settings.h @@ -58,10 +58,7 @@ typedef struct Settings_ { bool changed; } Settings; -#ifndef Settings_cpuId #define Settings_cpuId(settings, cpu) ((settings)->countCPUsFromZero ? (cpu) : (cpu)+1) -#endif - void Settings_delete(Settings* this); diff --git a/SignalsPanel.h b/SignalsPanel.h index 94077ed0..3d910cee 100644 --- a/SignalsPanel.h +++ b/SignalsPanel.h @@ -7,13 +7,11 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - typedef struct SignalItem_ { const char* name; int number; } SignalItem; - Panel* SignalsPanel_new(); #endif diff --git a/Vector.h b/Vector.h index 7d1436aa..32cd809e 100644 --- a/Vector.h +++ b/Vector.h @@ -24,7 +24,6 @@ typedef struct Vector_ { bool owner; } Vector; - Vector* Vector_new(ObjectClass* type, bool owner, int size); void Vector_delete(Vector* this); @@ -37,11 +36,6 @@ int Vector_count(Vector* this); void Vector_prune(Vector* this); -// If I were to use only one sorting algorithm for both cases, it would probably be this one: -/* - -*/ - void Vector_quickSort(Vector* this); void Vector_insertionSort(Vector* this); diff --git a/darwin/Battery.h b/darwin/Battery.h index 24d8f5c2..21a1579a 100644 --- a/darwin/Battery.h +++ b/darwin/Battery.h @@ -3,5 +3,4 @@ void Battery_getData(double* level, ACPresence* isOnAC); - #endif diff --git a/darwin/DarwinCRT.h b/darwin/DarwinCRT.h index d79e34c8..5e08422b 100644 --- a/darwin/DarwinCRT.h +++ b/darwin/DarwinCRT.h @@ -9,5 +9,4 @@ in the source distribution for its full text. void CRT_handleSIGSEGV(int sgn); - #endif diff --git a/darwin/DarwinProcess.h b/darwin/DarwinProcess.h index f885ccc5..cf76fa8d 100644 --- a/darwin/DarwinProcess.h +++ b/darwin/DarwinProcess.h @@ -20,7 +20,6 @@ typedef struct DarwinProcess_ { bool taskAccess; } DarwinProcess; - extern ProcessClass DarwinProcess_class; DarwinProcess* DarwinProcess_new(Settings* settings); diff --git a/darwin/DarwinProcessList.h b/darwin/DarwinProcessList.h index d6c33276..7d6f5343 100644 --- a/darwin/DarwinProcessList.h +++ b/darwin/DarwinProcessList.h @@ -37,7 +37,6 @@ typedef struct DarwinProcessList_ { ZfsArcStats zfs; } DarwinProcessList; - void ProcessList_getHostInfo(host_basic_info_data_t *p); void ProcessList_freeCPULoadInfo(processor_cpu_load_info_t *p); diff --git a/dragonflybsd/DragonFlyBSDCRT.h b/dragonflybsd/DragonFlyBSDCRT.h index 2b98effb..2bf85f71 100644 --- a/dragonflybsd/DragonFlyBSDCRT.h +++ b/dragonflybsd/DragonFlyBSDCRT.h @@ -8,10 +8,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#ifdef HAVE_EXECINFO_H -#endif - void CRT_handleSIGSEGV(int sgn); - #endif diff --git a/dragonflybsd/DragonFlyBSDProcess.h b/dragonflybsd/DragonFlyBSDProcess.h index a0381c67..d5e5a6ee 100644 --- a/dragonflybsd/DragonFlyBSDProcess.h +++ b/dragonflybsd/DragonFlyBSDProcess.h @@ -8,7 +8,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - typedef enum DragonFlyBSDProcessFields { // Add platform-specific fields here, with ids >= 100 JID = 100, @@ -16,7 +15,6 @@ typedef enum DragonFlyBSDProcessFields { LAST_PROCESSFIELD = 102, } DragonFlyBSDProcessField; - typedef struct DragonFlyBSDProcess_ { Process super; int kernel; @@ -24,16 +22,10 @@ typedef struct DragonFlyBSDProcess_ { char* jname; } DragonFlyBSDProcess; - -#ifndef Process_isKernelThread #define Process_isKernelThread(_process) (_process->kernel == 1) -#endif -#ifndef Process_isUserlandThread //#define Process_isUserlandThread(_process) (_process->pid != _process->tgid) #define Process_isUserlandThread(_process) (_process->nlwp > 1) -#endif - extern ProcessClass DragonFlyBSDProcess_class; diff --git a/dragonflybsd/DragonFlyBSDProcessList.h b/dragonflybsd/DragonFlyBSDProcessList.h index f677c3e4..403aa096 100644 --- a/dragonflybsd/DragonFlyBSDProcessList.h +++ b/dragonflybsd/DragonFlyBSDProcessList.h @@ -8,7 +8,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - #include #include #include @@ -21,17 +20,15 @@ in the source distribution for its full text. #include "DragonFlyBSDProcess.h" #define JAIL_ERRMSGLEN 1024 -char jail_errmsg[JAIL_ERRMSGLEN]; +extern char jail_errmsg[JAIL_ERRMSGLEN]; typedef struct CPUData_ { - double userPercent; double nicePercent; double systemPercent; double irqPercent; double idlePercent; double systemAllPercent; - } CPUData; typedef struct DragonFlyBSDProcessList_ { @@ -54,10 +51,8 @@ typedef struct DragonFlyBSDProcessList_ { Hashtable *jails; } DragonFlyBSDProcessList; - #define _UNUSED_ __attribute__((unused)) - ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); void ProcessList_delete(ProcessList* this); diff --git a/dragonflybsd/Platform.h b/dragonflybsd/Platform.h index aa00d656..c6792a28 100644 --- a/dragonflybsd/Platform.h +++ b/dragonflybsd/Platform.h @@ -14,7 +14,6 @@ in the source distribution for its full text. extern ProcessFieldData Process_fields[]; - #ifndef CLAMP #define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) #endif diff --git a/freebsd/FreeBSDCRT.h b/freebsd/FreeBSDCRT.h index d0c21659..eb88fcc1 100644 --- a/freebsd/FreeBSDCRT.h +++ b/freebsd/FreeBSDCRT.h @@ -9,5 +9,4 @@ in the source distribution for its full text. void CRT_handleSIGSEGV(int sgn); - #endif diff --git a/freebsd/FreeBSDProcess.h b/freebsd/FreeBSDProcess.h index b269b779..897c5329 100644 --- a/freebsd/FreeBSDProcess.h +++ b/freebsd/FreeBSDProcess.h @@ -7,15 +7,13 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - -typedef enum FreeBSDProcessFields { +typedef enum FreeBSDProcessFields_ { // Add platform-specific fields here, with ids >= 100 JID = 100, JAIL = 101, LAST_PROCESSFIELD = 102, } FreeBSDProcessField; - typedef struct FreeBSDProcess_ { Process super; int kernel; @@ -23,15 +21,9 @@ typedef struct FreeBSDProcess_ { char* jname; } FreeBSDProcess; - -#ifndef Process_isKernelThread #define Process_isKernelThread(_process) (_process->kernel == 1) -#endif -#ifndef Process_isUserlandThread #define Process_isUserlandThread(_process) (_process->pid != _process->tgid) -#endif - extern ProcessClass FreeBSDProcess_class; diff --git a/freebsd/FreeBSDProcessList.h b/freebsd/FreeBSDProcessList.h index c9764630..1805c5af 100644 --- a/freebsd/FreeBSDProcessList.h +++ b/freebsd/FreeBSDProcessList.h @@ -7,7 +7,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - #include "zfs/ZfsArcStats.h" #include @@ -20,14 +19,12 @@ in the source distribution for its full text. extern char jail_errmsg[JAIL_ERRMSGLEN]; typedef struct CPUData_ { - double userPercent; double nicePercent; double systemPercent; double irqPercent; double idlePercent; double systemAllPercent; - } CPUData; typedef struct FreeBSDProcessList_ { @@ -51,7 +48,6 @@ typedef struct FreeBSDProcessList_ { } FreeBSDProcessList; - ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); void ProcessList_delete(ProcessList* this); diff --git a/freebsd/Platform.h b/freebsd/Platform.h index f453e68e..fd704539 100644 --- a/freebsd/Platform.h +++ b/freebsd/Platform.h @@ -13,7 +13,6 @@ in the source distribution for its full text. extern ProcessFieldData Process_fields[]; - #ifndef CLAMP #define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) #endif diff --git a/htop.h b/htop.h deleted file mode 100644 index c51f9650..00000000 --- a/htop.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef HEADER_htop -#define HEADER_htop -/* -htop - htop.h -(C) 2004-2011 Hisham H. Muhammad -Released under the GNU GPL, see the COPYING file -in the source distribution for its full text. -*/ - -//#link m - -// ---------------------------------------- - - -int main(int argc, char** argv); - -#endif diff --git a/linux/Battery.h b/linux/Battery.h index 065895c5..8ca0d7fb 100644 --- a/linux/Battery.h +++ b/linux/Battery.h @@ -9,24 +9,6 @@ in the source distribution for its full text. Linux battery readings written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com). */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - -#define SYS_POWERSUPPLY_DIR "/sys/class/power_supply" - -// ---------------------------------------- -// READ FROM /proc -// ---------------------------------------- - -// This implementation reading from from /proc/acpi is really inefficient, -// but I think this is on the way out so I did not rewrite it. -// The /sys implementation below does things the right way. - -// ---------------------------------------- -// READ FROM /sys -// ---------------------------------------- - void Battery_getData(double* level, ACPresence* isOnAC); #endif diff --git a/linux/IOPriority.h b/linux/IOPriority.h index 4e2c379e..7c4f3b63 100644 --- a/linux/IOPriority.h +++ b/linux/IOPriority.h @@ -11,7 +11,6 @@ Copyright (C) 2005 Jens Axboe Released under the terms of the GNU General Public License version 2 */ - enum { IOPRIO_CLASS_NONE, IOPRIO_CLASS_RT, @@ -36,5 +35,4 @@ typedef int IOPriority; #define IOPriority_None IOPriority_tuple(IOPRIO_CLASS_NONE, 0) #define IOPriority_Idle IOPriority_tuple(IOPRIO_CLASS_IDLE, 7) - #endif diff --git a/linux/LinuxCRT.h b/linux/LinuxCRT.h index 61304dac..c379a8f6 100644 --- a/linux/LinuxCRT.h +++ b/linux/LinuxCRT.h @@ -7,9 +7,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#ifdef HAVE_EXECINFO_H -#endif - void CRT_handleSIGSEGV(int sgn); #endif diff --git a/linux/LinuxProcess.h b/linux/LinuxProcess.h index 8ee49f46..021cae7c 100644 --- a/linux/LinuxProcess.h +++ b/linux/LinuxProcess.h @@ -8,7 +8,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - #define PROCESS_FLAG_LINUX_IOPRIO 0x0100 #define PROCESS_FLAG_LINUX_OPENVZ 0x0200 #define PROCESS_FLAG_LINUX_VSERVER 0x0400 @@ -141,16 +140,10 @@ typedef struct LinuxProcess_ { #endif } LinuxProcess; -#ifndef Process_isKernelThread #define Process_isKernelThread(_process) (((LinuxProcess*)(_process))->isKernelThread) -#endif -#ifndef Process_isUserlandThread #define Process_isUserlandThread(_process) (_process->pid != _process->tgid) -#endif - -/* semi-global */ extern long long btime; extern ProcessFieldData Process_fields[]; diff --git a/linux/LinuxProcessList.h b/linux/LinuxProcessList.h index b63f19aa..d689d4ac 100644 --- a/linux/LinuxProcessList.h +++ b/linux/LinuxProcessList.h @@ -7,14 +7,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#ifdef MAJOR_IN_MKDEV -#elif defined(MAJOR_IN_SYSMACROS) -#endif - -#ifdef HAVE_DELAYACCT -#endif - - #include "ProcessList.h" #include "zfs/ZfsArcStats.h" @@ -100,40 +92,14 @@ typedef struct LinuxProcessList_ { #define PROC_LINE_LENGTH 4096 #endif - #ifndef CLAMP #define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x))) #endif -#ifdef HAVE_DELAYACCT - -#endif - ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); void ProcessList_delete(ProcessList* pl); - -#ifdef HAVE_TASKSTATS - -#endif - -#ifdef HAVE_OPENVZ - -#endif - -#ifdef HAVE_CGROUP - -#endif - -#ifdef HAVE_VSERVER - -#endif - -#ifdef HAVE_DELAYACCT - -#endif - void ProcessList_goThroughEntries(ProcessList* super); #endif diff --git a/openbsd/OpenBSDCRT.h b/openbsd/OpenBSDCRT.h index 66684c53..85860a96 100644 --- a/openbsd/OpenBSDCRT.h +++ b/openbsd/OpenBSDCRT.h @@ -10,5 +10,4 @@ in the source distribution for its full text. void CRT_handleSIGSEGV(int sgn); - #endif diff --git a/openbsd/OpenBSDProcess.h b/openbsd/OpenBSDProcess.h index b4fd82db..fede6f87 100644 --- a/openbsd/OpenBSDProcess.h +++ b/openbsd/OpenBSDProcess.h @@ -8,8 +8,7 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - -typedef enum OpenBSDProcessFields { +typedef enum OpenBSDProcessFields_ { // Add platform-specific fields here, with ids >= 100 LAST_PROCESSFIELD = 100, } OpenBSDProcessField; @@ -18,14 +17,9 @@ typedef struct OpenBSDProcess_ { Process super; } OpenBSDProcess; -#ifndef Process_isKernelThread #define Process_isKernelThread(_process) (_process->pgrp == 0) -#endif -#ifndef Process_isUserlandThread #define Process_isUserlandThread(_process) (_process->pid != _process->tgid) -#endif - extern ProcessClass OpenBSDProcess_class; diff --git a/openbsd/OpenBSDProcessList.h b/openbsd/OpenBSDProcessList.h index 4b5203c7..038a263d 100644 --- a/openbsd/OpenBSDProcessList.h +++ b/openbsd/OpenBSDProcessList.h @@ -8,7 +8,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - #include typedef struct CPUData_ { @@ -39,7 +38,6 @@ typedef struct OpenBSDProcessList_ { } OpenBSDProcessList; - /* * avoid relying on or conflicting with MIN() and MAX() in sys/param.h */ @@ -61,10 +59,6 @@ void ProcessList_delete(ProcessList* this); char *OpenBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kproc, int* basenameEnd); -/* - * Taken from OpenBSD's ps(1). - */ void ProcessList_goThroughEntries(ProcessList* this); - #endif diff --git a/openbsd/Platform.h b/openbsd/Platform.h index da1a1740..f51d6bc6 100644 --- a/openbsd/Platform.h +++ b/openbsd/Platform.h @@ -14,14 +14,11 @@ in the source distribution for its full text. extern ProcessFieldData Process_fields[]; - extern ProcessField Platform_defaultFields[]; extern int Platform_numberOfFields; -/* - * See /usr/include/sys/signal.h - */ +/* see /usr/include/sys/signal.h */ extern const SignalItem Platform_signals[]; extern const unsigned int Platform_numberOfSignals; @@ -30,7 +27,6 @@ void Platform_setBindings(Htop_Action* keys); extern MeterClass* Platform_meterTypes[]; -// preserved from FreeBSD port int Platform_getUptime(); void Platform_getLoadAverage(double* one, double* five, double* fifteen); @@ -41,12 +37,6 @@ double Platform_setCPUValues(Meter* this, int cpu); void Platform_setMemoryValues(Meter* this); -/* - * Copyright (c) 1994 Thorsten Lockert - * All rights reserved. - * - * Taken almost directly from OpenBSD's top(1) - */ void Platform_setSwapValues(Meter* this); void Platform_setTasksValues(Meter* this); diff --git a/solaris/Battery.h b/solaris/Battery.h index 24d8f5c2..21a1579a 100644 --- a/solaris/Battery.h +++ b/solaris/Battery.h @@ -3,5 +3,4 @@ void Battery_getData(double* level, ACPresence* isOnAC); - #endif diff --git a/solaris/Platform.h b/solaris/Platform.h index 041bf3fb..dd8614dc 100644 --- a/solaris/Platform.h +++ b/solaris/Platform.h @@ -29,7 +29,6 @@ typedef struct envAccum_ { char *env; } envAccum; - extern double plat_loadavg[3]; extern const SignalItem Platform_signals[]; diff --git a/solaris/SolarisCRT.h b/solaris/SolarisCRT.h index 01b75696..4e37b7f6 100644 --- a/solaris/SolarisCRT.h +++ b/solaris/SolarisCRT.h @@ -8,9 +8,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#ifdef HAVE_EXECINFO_H -#endif - void CRT_handleSIGSEGV(int sgn); #endif diff --git a/solaris/SolarisProcess.h b/solaris/SolarisProcess.h index a1064a30..d36dea3e 100644 --- a/solaris/SolarisProcess.h +++ b/solaris/SolarisProcess.h @@ -13,7 +13,7 @@ in the source distribution for its full text. #include #include -typedef enum SolarisProcessFields { +typedef enum SolarisProcessField_ { // Add platform-specific fields here, with ids >= 100 ZONEID = 100, ZONE = 101, @@ -25,7 +25,6 @@ typedef enum SolarisProcessFields { LAST_PROCESSFIELD = 107, } SolarisProcessField; - typedef struct SolarisProcess_ { Process super; int kernel; @@ -41,15 +40,9 @@ typedef struct SolarisProcess_ { pid_t lwpid; } SolarisProcess; - -#ifndef Process_isKernelThread #define Process_isKernelThread(_process) (_process->kernel == 1) -#endif -#ifndef Process_isUserlandThread #define Process_isUserlandThread(_process) (_process->pid != _process->tgid) -#endif - extern ProcessClass SolarisProcess_class; diff --git a/solaris/SolarisProcessList.h b/solaris/SolarisProcessList.h index 89ec46b2..25962685 100644 --- a/solaris/SolarisProcessList.h +++ b/solaris/SolarisProcessList.h @@ -46,7 +46,6 @@ typedef struct SolarisProcessList_ { ZfsArcStats zfs; } SolarisProcessList; - char* SolarisProcessList_readZoneName(kstat_ctl_t* kd, SolarisProcess* sproc); ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); @@ -63,5 +62,4 @@ int SolarisProcessList_walkproc(psinfo_t *_psinfo, lwpsinfo_t *_lwpsinfo, void * void ProcessList_goThroughEntries(ProcessList* this); - #endif diff --git a/unsupported/Battery.h b/unsupported/Battery.h index 24d8f5c2..21a1579a 100644 --- a/unsupported/Battery.h +++ b/unsupported/Battery.h @@ -3,5 +3,4 @@ void Battery_getData(double* level, ACPresence* isOnAC); - #endif diff --git a/unsupported/UnsupportedCRT.h b/unsupported/UnsupportedCRT.h index c8eff180..24d63e5c 100644 --- a/unsupported/UnsupportedCRT.h +++ b/unsupported/UnsupportedCRT.h @@ -9,5 +9,4 @@ in the source distribution for its full text. void CRT_handleSIGSEGV(int sgn); - #endif diff --git a/unsupported/UnsupportedProcess.h b/unsupported/UnsupportedProcess.h index 467297b5..dbe9bf5e 100644 --- a/unsupported/UnsupportedProcess.h +++ b/unsupported/UnsupportedProcess.h @@ -11,10 +11,8 @@ in the source distribution for its full text. #define Process_delete UnsupportedProcess_delete - Process* UnsupportedProcess_new(Settings* settings); void UnsupportedProcess_delete(Object* cast); - #endif diff --git a/unsupported/UnsupportedProcessList.h b/unsupported/UnsupportedProcessList.h index 093a8c43..69a7c1c7 100644 --- a/unsupported/UnsupportedProcessList.h +++ b/unsupported/UnsupportedProcessList.h @@ -7,8 +7,6 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ - - ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId); void ProcessList_delete(ProcessList* this); diff --git a/zfs/ZfsArcMeter.h b/zfs/ZfsArcMeter.h index c52083df..e6b59d5b 100644 --- a/zfs/ZfsArcMeter.h +++ b/zfs/ZfsArcMeter.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_ZfsArcMeter #define HEADER_ZfsArcMeter /* diff --git a/zfs/ZfsArcStats.h b/zfs/ZfsArcStats.h index 9368ba9d..087f3fc0 100644 --- a/zfs/ZfsArcStats.h +++ b/zfs/ZfsArcStats.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_ZfsArcStats #define HEADER_ZfsArcStats /* @@ -23,5 +21,4 @@ typedef struct ZfsArcStats_ { unsigned long long int uncompressed; } ZfsArcStats; - #endif diff --git a/zfs/ZfsCompressedArcMeter.h b/zfs/ZfsCompressedArcMeter.h index 5afcc99e..8e644935 100644 --- a/zfs/ZfsCompressedArcMeter.h +++ b/zfs/ZfsCompressedArcMeter.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_ZfsCompressedArcMeter #define HEADER_ZfsCompressedArcMeter /* diff --git a/zfs/openzfs_sysctl.h b/zfs/openzfs_sysctl.h index 6e44ac3b..adb4b24c 100644 --- a/zfs/openzfs_sysctl.h +++ b/zfs/openzfs_sysctl.h @@ -1,5 +1,3 @@ -/* Do not edit this file. It was automatically generated. */ - #ifndef HEADER_openzfs_sysctl #define HEADER_openzfs_sysctl /* -- cgit v1.2.3