Skip to content

Commit

Permalink
platform-dependent files included relative to main source directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurdahibhate authored and BenBE committed May 10, 2021
1 parent 1b74dfe commit 3f86a01
Show file tree
Hide file tree
Showing 41 changed files with 97 additions and 91 deletions.
1 change: 1 addition & 0 deletions Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ in the source distribution for its full text.
#include "Settings.h"
#include "Vector.h"


typedef struct Header_ {
Vector** columns;
Settings* settings;
Expand Down
4 changes: 2 additions & 2 deletions darwin/DarwinProcess.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.
*/

#include "DarwinProcess.h"
#include "darwin/DarwinProcess.h"

#include <libproc.h>
#include <stdio.h>
Expand All @@ -14,8 +14,8 @@ in the source distribution for its full text.
#include <mach/mach.h>

#include "CRT.h"
#include "Platform.h"
#include "Process.h"
#include "darwin/Platform.h"


const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
Expand Down
3 changes: 1 addition & 2 deletions darwin/DarwinProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ in the source distribution for its full text.

#include <sys/sysctl.h>

#include "DarwinProcessList.h"
#include "Settings.h"

#include "darwin/DarwinProcessList.h"

typedef struct DarwinProcess_ {
Process super;
Expand Down
6 changes: 3 additions & 3 deletions darwin/DarwinProcessList.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.
*/

#include "DarwinProcessList.h"
#include "darwin/DarwinProcessList.h"

#include <errno.h>
#include <libproc.h>
Expand All @@ -19,9 +19,9 @@ in the source distribution for its full text.
#include <sys/sysctl.h>

#include "CRT.h"
#include "DarwinProcess.h"
#include "Platform.h"
#include "ProcessList.h"
#include "darwin/DarwinProcess.h"
#include "darwin/Platform.h"
#include "generic/openzfs_sysctl.h"
#include "zfs/ZfsArcStats.h"

Expand Down
4 changes: 2 additions & 2 deletions darwin/Platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ in the source distribution for its full text.

#include "config.h" // IWYU pragma: keep

#include "Platform.h"
#include "darwin/Platform.h"

#include <errno.h>
#include <math.h>
Expand All @@ -22,7 +22,6 @@ in the source distribution for its full text.
#include "ClockMeter.h"
#include "CPUMeter.h"
#include "CRT.h"
#include "DarwinProcessList.h"
#include "DateMeter.h"
#include "DateTimeMeter.h"
#include "HostnameMeter.h"
Expand All @@ -34,6 +33,7 @@ in the source distribution for its full text.
#include "SysArchMeter.h"
#include "TasksMeter.h"
#include "UptimeMeter.h"
#include "darwin/DarwinProcessList.h"
#include "zfs/ZfsArcMeter.h"
#include "zfs/ZfsCompressedArcMeter.h"

Expand Down
2 changes: 1 addition & 1 deletion darwin/Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ in the source distribution for its full text.
#include "Action.h"
#include "BatteryMeter.h"
#include "CPUMeter.h"
#include "DarwinProcess.h"
#include "DiskIOMeter.h"
#include "NetworkIOMeter.h"
#include "ProcessLocksScreen.h"
#include "SignalsPanel.h"
#include "darwin/DarwinProcess.h"
#include "generic/gettime.h"
#include "generic/hostname.h"
#include "generic/uname.h"
Expand Down
10 changes: 5 additions & 5 deletions dragonflybsd/DragonFlyBSDProcess.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.
*/

#include "Process.h"
#include "ProcessList.h"
#include "DragonFlyBSDProcess.h"
#include "Platform.h"
#include "CRT.h"
#include "dragonflybsd/DragonFlyBSDProcess.h"

#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/syscall.h>

#include "Process.h"
#include "ProcessList.h"
#include "dragonflybsd/Platform.h"
#include "CRT.h"

const ProcessFieldData Process_fields[LAST_PROCESSFIELD] = {
[0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, },
Expand Down
6 changes: 3 additions & 3 deletions dragonflybsd/DragonFlyBSDProcessList.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.
*/

#include "ProcessList.h"
#include "DragonFlyBSDProcessList.h"
#include "DragonFlyBSDProcess.h"
#include "dragonflybsd/DragonFlyBSDProcessList.h"

#include <unistd.h>
#include <stdlib.h>
Expand All @@ -22,6 +20,8 @@ in the source distribution for its full text.

#include "CRT.h"
#include "Macros.h"
#include "ProcessList.h"
#include "dragonflybsd/DragonFlyBSDProcess.h"


static int MIB_hw_physmem[2];
Expand Down
3 changes: 2 additions & 1 deletion dragonflybsd/DragonFlyBSDProcessList.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ in the source distribution for its full text.
#include <sys/uio.h>
#include <sys/resource.h>
#include "Hashtable.h"
#include "DragonFlyBSDProcess.h"

#include "dragonflybsd/DragonFlyBSDProcess.h"


typedef struct CPUData_ {
Expand Down
39 changes: 20 additions & 19 deletions dragonflybsd/Platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,31 @@ Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.
*/

#include "Platform.h"
#include "Macros.h"
#include "Meter.h"
#include "CPUMeter.h"
#include "MemoryMeter.h"
#include "SwapMeter.h"
#include "TasksMeter.h"
#include "LoadAverageMeter.h"
#include "UptimeMeter.h"
#include "dragonflybsd/Platform.h"

#include <math.h>
#include <time.h>
#include <sys/resource.h>
#include <sys/sysctl.h>
#include <sys/time.h>
#include <sys/types.h>
#include <vm/vm_param.h>

#include "ClockMeter.h"
#include "CPUMeter.h"
#include "DateMeter.h"
#include "DateTimeMeter.h"
#include "HostnameMeter.h"
#include "LoadAverageMeter.h"
#include "Macros.h"
#include "MemoryMeter.h"
#include "Meter.h"
#include "SwapMeter.h"
#include "SysArchMeter.h"
#include "DragonFlyBSDProcess.h"
#include "DragonFlyBSDProcessList.h"

#include <sys/types.h>
#include <sys/sysctl.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <vm/vm_param.h>
#include <time.h>
#include <math.h>
#include "TasksMeter.h"
#include "UptimeMeter.h"
#include "dragonflybsd/DragonFlyBSDProcess.h"
#include "dragonflybsd/DragonFlyBSDProcessList.h"


const ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_VIRT, M_RESIDENT, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 };
Expand Down
2 changes: 1 addition & 1 deletion freebsd/FreeBSDProcess.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.
*/

#include "FreeBSDProcess.h"
#include "freebsd/FreeBSDProcess.h"

#include <stdlib.h>

Expand Down
2 changes: 1 addition & 1 deletion freebsd/FreeBSDProcessList.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ in the source distribution for its full text.

#include "config.h" // IWYU pragma: keep

#include "FreeBSDProcessList.h"
#include "freebsd/FreeBSDProcessList.h"

#include <assert.h>
#include <limits.h>
Expand Down
6 changes: 3 additions & 3 deletions freebsd/Platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ in the source distribution for its full text.

#include "config.h" // IWYU pragma: keep

#include "Platform.h"
#include "freebsd/Platform.h"

#include <devstat.h>
#include <math.h>
Expand All @@ -31,8 +31,6 @@ in the source distribution for its full text.
#include "DateMeter.h"
#include "DateTimeMeter.h"
#include "DiskIOMeter.h"
#include "FreeBSDProcess.h"
#include "FreeBSDProcessList.h"
#include "HostnameMeter.h"
#include "LoadAverageMeter.h"
#include "Macros.h"
Expand All @@ -46,6 +44,8 @@ in the source distribution for its full text.
#include "TasksMeter.h"
#include "UptimeMeter.h"
#include "XUtils.h"
#include "freebsd/FreeBSDProcess.h"
#include "freebsd/FreeBSDProcessList.h"
#include "zfs/ZfsArcMeter.h"
#include "zfs/ZfsCompressedArcMeter.h"

Expand Down
4 changes: 2 additions & 2 deletions generic/gettime.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ in the source distribution for its full text.
*/
#include "config.h" // IWYU pragma: keep

#include "generic/gettime.h"

#include <string.h>
#include <time.h>

#include "generic/gettime.h"


void Generic_gettime_realtime(struct timeval* tvp, uint64_t* msec) {

Expand Down
3 changes: 2 additions & 1 deletion generic/uname.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ in the source distribution for its full text.
*/
#include "config.h" // IWYU pragma: keep

#include "generic/uname.h"

#include <stdbool.h>
#include <stdio.h>
#include <string.h>

#include "Macros.h"
#include "XUtils.h"
#include "generic/uname.h"

#ifdef HAVE_SYS_UTSNAME_H
#include <sys/utsname.h>
Expand Down
4 changes: 2 additions & 2 deletions linux/HugePageMeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.
*/

#include "HugePageMeter.h"
#include "linux/HugePageMeter.h"

#include <assert.h>
#include <limits.h>
#include <math.h>
#include <stddef.h>

#include "CRT.h"
#include "LinuxProcessList.h"
#include "Macros.h"
#include "Object.h"
#include "ProcessList.h"
#include "RichString.h"
#include "linux/LinuxProcessList.h"


static const char *HugePageMeter_active_labels[4] = { NULL, NULL, NULL, NULL };
Expand Down
3 changes: 2 additions & 1 deletion linux/IOPriorityPanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.
*/

#include "IOPriorityPanel.h"
#include "linux/IOPriorityPanel.h"

#include <stdbool.h>
#include <stddef.h>
Expand All @@ -14,6 +14,7 @@ in the source distribution for its full text.
#include "ListItem.h"
#include "Object.h"
#include "XUtils.h"
#include "IOPriority.h"


Panel* IOPriorityPanel_new(IOPriority currPrio) {
Expand Down
2 changes: 1 addition & 1 deletion linux/IOPriorityPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ in the source distribution for its full text.
*/

#include "Panel.h"
#include "IOPriority.h"
#include "linux/IOPriority.h"

Panel* IOPriorityPanel_new(IOPriority currPrio);

Expand Down
2 changes: 1 addition & 1 deletion linux/LibSensors.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "LibSensors.h"
#include "linux/LibSensors.h"

#ifdef HAVE_SENSORS_SENSORS_H

Expand Down
2 changes: 1 addition & 1 deletion linux/LibSensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <stdio.h>

#include "LinuxProcessList.h"
#include "linux/LinuxProcessList.h"


int LibSensors_init(FILE* input);
Expand Down
3 changes: 2 additions & 1 deletion linux/LinuxProcess.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.
*/

#include "LinuxProcess.h"
#include "linux/LinuxProcess.h"

#include <assert.h>
#include <math.h>
Expand All @@ -22,6 +22,7 @@ in the source distribution for its full text.
#include "ProvideCurses.h"
#include "RichString.h"
#include "XUtils.h"
#include "linux/IOPriority.h"


/* semi-global */
Expand Down
2 changes: 1 addition & 1 deletion linux/LinuxProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ in the source distribution for its full text.

#include <stdbool.h>

#include "IOPriority.h"
#include "linux/IOPriority.h"
#include "Object.h"
#include "Process.h"
#include "Settings.h"
Expand Down
6 changes: 3 additions & 3 deletions linux/LinuxProcessList.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ in the source distribution for its full text.

#include "config.h" // IWYU pragma: keep

#include "LinuxProcessList.h"
#include "linux/LinuxProcessList.h"

#include <assert.h>
#include <dirent.h>
Expand Down Expand Up @@ -41,13 +41,13 @@ in the source distribution for its full text.

#include "Compat.h"
#include "CRT.h"
#include "LinuxProcess.h"
#include "Macros.h"
#include "Object.h"
#include "Platform.h" // needed for GNU/hurd to get PATH_MAX
#include "Process.h"
#include "Settings.h"
#include "XUtils.h"
#include "linux/LinuxProcess.h"
#include "linux/Platform.h" // needed for GNU/hurd to get PATH_MAX

#if defined(MAJOR_IN_MKDEV)
#include <sys/mkdev.h>
Expand Down
Loading

0 comments on commit 3f86a01

Please sign in to comment.