-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.h
96 lines (78 loc) · 2.18 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef _CONFIG_H_
#define _CONFIG_H_
#define HALF_DELAY_TIME 10
/* 1000ms */
#define WAIT_TIME (HALF_DELAY_TIME * 100)
/* 60s */
#define FULL_WAIT_TIME (WAIT_TIME * 60)
#define SPACE_CMDLINE 4
#define SPACE_INDENT 4
#define TRACE_TOOL "strace"
// Key bindings
#define CTRL_AND(c) ((c) & 037)
/* Navigation */
#define UP_CHAR 'k'
#define DOWN_CHAR 'j'
#define LEFT_CHAR 'h'
#define RIGHT_CHAR 'l'
#define COL_0_CHAR '0'
#define SOL_CHAR '^'
#define INFO_CHAR 'i'
#define QUIT_CHAR 'q'
#define GOTO_LOCKED_CHAR 'o'
#define GOTO_$$_CHAR 'O'
#define SCROLL_TO_TOP_CHAR 'g'
#define SCROLL_TO_BOTTOM_CHAR 'G'
#define SCROLL_TO_FIRST_CHAR 'H'
#define SCROLL_TO_LAST_CHAR 'L'
#define SCROLL_TO_MIDDLE_CHAR 'M'
#define LOCK_CHAR CTRL_AND('k')
#define REDRAW_CHAR CTRL_AND('l')
#define SEARCH_STR '/'
#define SEARCH_PID '?'
#define SEARCH_NEXT_CHAR CTRL_AND('n')
#define SEARCH_PREVIOUS_CHAR CTRL_AND('p')
#define RESET_SEARCH_CHAR CTRL_AND('u')
#define EXPOSE_ONE_MORE_LINE_BOTTOM_CHAR CTRL_AND('e')
#define EXPOSE_ONE_MORE_LINE_TOP_CHAR CTRL_AND('y')
#define BACKWARD_WINDOW_CHAR CTRL_AND('b')
#define FORWARD_WINDOW_CHAR CTRL_AND('f')
#define BACKWARD_HALF_WINDOW_CHAR CTRL_AND('u')
#define FORWARD_HALF_WINDOW_CHAR CTRL_AND('d')
#define FREEZE_CHAR 'f'
#define BASENAME_TOGGLE_CHAR 'b'
#define READ_FROM_PS_FILE_CHAR 'P'
#define FOLD_CHAR '-'
// Colors
// Default ncurses colors
// COLOR_BLACK 0
// COLOR_RED 1
// COLOR_GREEN 2
// COLOR_YELLOW 3
// COLOR_BLUE 4
// COLOR_MAGENTA 5
// COLOR_CYAN 6
// COLOR_WHITE 7
#define ATTR_SEARCH COLOR_PAIR(1 + COLOR_YELLOW)
#define ATTR_SEARCH_ALT COLOR_PAIR(1 + COLOR_BLUE)
#define ATTR_NOT_OWNED COLOR_PAIR(1 + COLOR_BLACK) | A_BOLD
#define ATTR_LOCK COLOR_PAIR(1 + COLOR_MAGENTA)
#define ATTR_JAILED COLOR_PAIR(1 + COLOR_BLUE) | A_BOLD
#define BASENAME_COL (1 + COLOR_CYAN)
#define BASENAME_ATTR A_BOLD
typedef void proc_handler(struct myproc *, struct myproc **);
proc_handler delete, renice, lsof, strace, gdb, shell;
struct
{
proc_handler *handler;
char ch;
} externals[] = {
{ delete, 'd' },
{ renice, 'r' },
{ lsof, 'I' },
{ strace, 's' },
{ gdb, 'a' },
{ shell, '!' },
{ NULL, 0 }
};
#endif