forked from htop-dev/htop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move generic (shared) code into its own sub-directory
Code that is shared across some (but not all) platforms is moved into a 'generic' home. Makefile.am cleanups to match plus some minor alphabetic reordering/formatting. As discussed in htop-dev#553
- Loading branch information
Showing
15 changed files
with
143 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
htop - generic/hostname.c | ||
(C) 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 "generic/hostname.h" | ||
|
||
#include <unistd.h> | ||
|
||
|
||
void Generic_hostname(char* buffer, size_t size) { | ||
gethostname(buffer, size - 1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
#ifndef HEADER_Generic | ||
#define HEADER_Generic | ||
#ifndef HEADER_hostname | ||
#define HEADER_hostname | ||
/* | ||
htop - Generic.h | ||
htop - generic/hostname.h | ||
(C) 2021 htop dev team | ||
Released under the GNU GPLv2, see the COPYING file | ||
in the source distribution for its full text. | ||
*/ | ||
|
||
#include <stddef.h> | ||
|
||
void Generic_Hostname(char* buffer, size_t size); | ||
|
||
char* Generic_OSRelease(void); | ||
void Generic_hostname(char* buffer, size_t size); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.