diff options
author | Hugo Musso Gualandi <hugo_musso_gualandi@hotmail.com> | 2020-09-12 18:25:25 -0300 |
---|---|---|
committer | Hugo Musso Gualandi <hugo_musso_gualandi@hotmail.com> | 2020-09-12 19:20:44 -0300 |
commit | 9207401f9711ba026a70d7dd47347d7eab168b3f (patch) | |
tree | 959ae417880dda426e3b1bfea904edc6a90fac0c /CRT.h | |
parent | cd55cfd6d263a89bbaf401481ea6bd6a5dd8f110 (diff) |
Clean up some code duplication in the header files
PR htop-dev/htop#70 got rid of the infrastructure for generating header
files, but it left behind some code duplication.
Some of cases are things that belong in the header file and don't need
to be repeated in the C file. Other cases are things that belong in the
C file and don't need to be in the header file.
In this commit I tried to fix all of these that I could find. When given
a choice I preferred keeping things out of the header file, unless they
were being used by someone else.
Diffstat (limited to 'CRT.h')
-rw-r--r-- | CRT.h | 27 |
1 files changed, 1 insertions, 26 deletions
@@ -7,31 +7,12 @@ Released under the GNU GPL, see the COPYING file in the source distribution for its full text. */ -#if HAVE_SETUID_ENABLED -#endif - -#define ColorIndex(i,j) ((7-i)*8+j) - -#define ColorPair(i,j) COLOR_PAIR(ColorIndex(i,j)) - -#define Black COLOR_BLACK -#define Red COLOR_RED -#define Green COLOR_GREEN -#define Yellow COLOR_YELLOW -#define Blue COLOR_BLUE -#define Magenta COLOR_MAGENTA -#define Cyan COLOR_CYAN -#define White COLOR_WHITE - -#define ColorPairGrayBlack ColorPair(Magenta,Magenta) -#define ColorIndexGrayBlack ColorIndex(Magenta,Magenta) +#include <stdbool.h> #define KEY_WHEELUP KEY_F(20) #define KEY_WHEELDOWN KEY_F(21) #define KEY_RECLICK KEY_F(22) -#include <stdbool.h> - typedef enum TreeStr_ { TREE_STR_HORZ, TREE_STR_VERT, @@ -158,16 +139,12 @@ extern int CRT_scrollWheelVAmount; extern char* CRT_termType; -// TODO move color scheme to Settings, perhaps? - extern int CRT_colorScheme; extern void *backtraceArray[128]; #if HAVE_SETUID_ENABLED -#define DIE(msg) do { CRT_done(); fprintf(stderr, msg); exit(1); } while(0) - void CRT_dropPrivileges(); void CRT_restorePrivileges(); @@ -183,8 +160,6 @@ void CRT_restorePrivileges(); #endif -// TODO: pass an instance of Settings instead. - void CRT_init(int delay, int colorScheme, bool allowUnicode); void CRT_done(); |