Skip to content

Commit

Permalink
Merge branch 'style-header-consistency' of https://github.com/BenBE/htop
Browse files Browse the repository at this point in the history
 into BenBE-style-header-consistency
  • Loading branch information
natoscott committed Oct 10, 2023
2 parents 4103c23 + 8e4ce18 commit 43cb4a5
Show file tree
Hide file tree
Showing 32 changed files with 126 additions and 21 deletions.
2 changes: 1 addition & 1 deletion CRT.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

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

#include <stdbool.h>

Expand Down
8 changes: 8 additions & 0 deletions CommandScreen.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
htop - CommandScreen.c
(C) 2017,2020 ryenus
(C) 2020,2021 htop dev team
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

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

#include "CommandScreen.h"
Expand Down
7 changes: 7 additions & 0 deletions CommandScreen.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#ifndef HEADER_CommandScreen
#define HEADER_CommandScreen
/*
htop - CommandScreen.h
(C) 2017,2020 ryenus
(C) 2020,2021 htop dev team
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

#include "InfoScreen.h"
#include "Object.h"
Expand Down
7 changes: 7 additions & 0 deletions DynamicMeter.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#ifndef HEADER_DynamicMeter
#define HEADER_DynamicMeter
/*
htop - DynamicMeter.h
(C) 2021 htop dev team
(C) 2021 Red Hat, Inc. All Rights Reserved.
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

#include <stdbool.h>

Expand Down
9 changes: 9 additions & 0 deletions EnvScreen.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
htop - EnvScreen.c
(C) 2015,2016 Michael Klein
(C) 2016,2017 Hisham H. Muhammad
(C) 2020,2021 htop dev team
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

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

#include "EnvScreen.h"
Expand Down
8 changes: 8 additions & 0 deletions EnvScreen.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#ifndef HEADER_EnvScreen
#define HEADER_EnvScreen
/*
htop - EnvScreen.h
(C) 2015,2016 Michael Klein
(C) 2016,2017 Hisham H. Muhammad
(C) 2020,2021 htop dev team
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

#include "InfoScreen.h"
#include "Object.h"
Expand Down
8 changes: 8 additions & 0 deletions InfoScreen.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
htop - InfoScreen.c
(C) 2016 Hisham H. Muhammad
(C) 2020,2022 htop dev team
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

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

#include "InfoScreen.h"
Expand Down
7 changes: 7 additions & 0 deletions InfoScreen.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#ifndef HEADER_InfoScreen
#define HEADER_InfoScreen
/*
htop - InfoScreen.h
(C) 2016 Hisham H. Muhammad
(C) 2020,2022 htop dev team
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

#include <stdbool.h>

Expand Down
6 changes: 6 additions & 0 deletions Macros.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#ifndef HEADER_Macros
#define HEADER_Macros
/*
htop - Macros.h
(C) 2020-2023 htop dev team
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

#include <assert.h> // IWYU pragma: keep
#include <math.h>
Expand Down
7 changes: 7 additions & 0 deletions NetworkIOMeter.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
htop - NetworkIOMeter.c
(C) 2020-2023 htop dev team
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

#include "NetworkIOMeter.h"

#include <stdbool.h>
Expand Down
6 changes: 6 additions & 0 deletions NetworkIOMeter.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#ifndef HEADER_NetworkIOMeter
#define HEADER_NetworkIOMeter
/*
htop - NetworkIOMeter.h
(C) 2020-2023 htop dev team
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

#include "Meter.h"

Expand Down
2 changes: 1 addition & 1 deletion ProvideCurses.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 "config.h"
#include "config.h" // IWYU pragma: keep

// IWYU pragma: begin_exports

Expand Down
2 changes: 1 addition & 1 deletion RichString.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

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

#include "ProvideCurses.h"

Expand Down
4 changes: 2 additions & 2 deletions SignalsPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ in the source distribution for its full text.

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

#include "Panel.h"

#ifndef HTOP_SOLARIS
#include <signal.h>
#endif

#include "Panel.h"


typedef struct SignalItem_ {
const char* name;
Expand Down
4 changes: 2 additions & 2 deletions generic/fdstat_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

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

#include "generic/fdstat_sysctl.h"

#include <math.h>
Expand All @@ -14,8 +16,6 @@ in the source distribution for its full text.
#include <sys/types.h> // Shitty FreeBSD upstream headers
#include <sys/sysctl.h>

#include "config.h"


static void Generic_getFileDescriptors_sysctl_internal(
const char* sysctlname_maxfiles,
Expand Down
1 change: 1 addition & 0 deletions generic/gettime.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ htop - generic/gettime.c
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

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

#include "generic/gettime.h"
Expand Down
1 change: 1 addition & 0 deletions generic/hostname.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ htop - generic/hostname.c
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

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

#include "generic/hostname.h"
Expand Down
1 change: 1 addition & 0 deletions generic/uname.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ htop - generic/uname.c
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

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

#include "generic/uname.h"
Expand Down
11 changes: 9 additions & 2 deletions linux/LibSensors.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#include "linux/LibSensors.h"
/*
htop - linux/LibSensors.c
(C) 2020-2023 htop dev team
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

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

#include "config.h"
#include "linux/LibSensors.h"

#ifdef HAVE_SENSORS_SENSORS_H

Expand Down
6 changes: 6 additions & 0 deletions linux/LibSensors.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#ifndef HEADER_LibSensors
#define HEADER_LibSensors
/*
htop - linux/LibSensors.h
(C) 2020-2023 htop dev team
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

#include "linux/LinuxMachine.h"

Expand Down
2 changes: 1 addition & 1 deletion linux/LinuxMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

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

#include <stdbool.h>
#include <sys/types.h>
Expand Down
2 changes: 1 addition & 1 deletion linux/LinuxProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ in the source distribution for its full text.
#include <stdbool.h>
#include <sys/types.h>

#include "linux/IOPriority.h"
#include "Machine.h"
#include "Object.h"
#include "Process.h"
#include "linux/IOPriority.h"


#define PROCESS_FLAG_LINUX_IOPRIO 0x00000100
Expand Down
2 changes: 1 addition & 1 deletion linux/LinuxProcessTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

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

#include <stdbool.h>
#include <sys/types.h>
Expand Down
5 changes: 2 additions & 3 deletions linux/Platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

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

#include "linux/Platform.h"

Expand Down Expand Up @@ -47,7 +46,6 @@ in the source distribution for its full text.
#include "Panel.h"
#include "PressureStallMeter.h"
#include "ProvideCurses.h"
#include "linux/SELinuxMeter.h"
#include "Settings.h"
#include "SwapMeter.h"
#include "SysArchMeter.h"
Expand All @@ -58,6 +56,7 @@ in the source distribution for its full text.
#include "linux/IOPriorityPanel.h"
#include "linux/LinuxMachine.h"
#include "linux/LinuxProcess.h"
#include "linux/SELinuxMeter.h"
#include "linux/SystemdMeter.h"
#include "linux/ZramMeter.h"
#include "linux/ZramStats.h"
Expand Down
3 changes: 2 additions & 1 deletion linux/Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

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

#include <limits.h>
#include <stdbool.h>
Expand All @@ -32,6 +32,7 @@ in the source distribution for its full text.
#include "generic/hostname.h"
#include "generic/uname.h"


/* GNU/Hurd does not have PATH_MAX in limits.h */
#ifndef PATH_MAX
#define PATH_MAX 4096
Expand Down
8 changes: 8 additions & 0 deletions linux/ZramMeter.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
htop - linux/ZramMeter.c
(C) 2020 Murloc Knight
(C) 2020-2023 htop dev team
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

#include "linux/ZramMeter.h"

#include <stddef.h>
Expand Down
7 changes: 7 additions & 0 deletions linux/ZramMeter.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#ifndef HEADER_ZramMeter
#define HEADER_ZramMeter
/*
htop - linux/ZramMeter.h
(C) 2020 Murloc Knight
(C) 2020-2023 htop dev team
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

#include "Meter.h"

Expand Down
1 change: 1 addition & 0 deletions pcp/PCPDynamicMeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ htop - PCPDynamicMeter.c
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

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

#include "pcp/PCPDynamicMeter.h"
Expand Down
2 changes: 1 addition & 1 deletion pcp/PCPMachine.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ in the source distribution for its full text.
#include <string.h>
#include <sys/time.h>

#include "Macros.h"
#include "Machine.h"
#include "Macros.h"
#include "Object.h"
#include "Platform.h"
#include "Settings.h"
Expand Down
2 changes: 1 addition & 1 deletion pcp/PCPProcessTable.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ in the source distribution for its full text.
#include <string.h>
#include <sys/time.h>

#include "Macros.h"
#include "Machine.h"
#include "Macros.h"
#include "Object.h"
#include "Platform.h"
#include "Process.h"
Expand Down
2 changes: 1 addition & 1 deletion solaris/Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ in the source distribution for its full text.

#include "Action.h"
#include "BatteryMeter.h"
#include "CommandLine.h"
#include "DiskIOMeter.h"
#include "Hashtable.h"
#include "NetworkIOMeter.h"
#include "ProcessLocksScreen.h"
#include "SignalsPanel.h"
#include "CommandLine.h"
#include "generic/gettime.h"
#include "generic/hostname.h"
#include "generic/uname.h"
Expand Down
4 changes: 2 additions & 2 deletions solaris/SolarisMachine.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 <stdbool.h>
#include <stdint.h>
#include <sys/param.h>
#include <sys/uio.h>
#include <sys/resource.h>
#include <sys/swap.h>
#include <sys/sysconf.h>
#include <sys/sysinfo.h>
#include <sys/swap.h>
#include <sys/uio.h>

#include "Hashtable.h"
#include "UsersTable.h"
Expand Down

0 comments on commit 43cb4a5

Please sign in to comment.