xref: /freebsd/usr.bin/top/top.h (revision 4928135658a9d0eaee37003df6137ab363fcb0b4)
1 /*
2  * $FreeBSD$
3  */
4 /*
5  *  Top - a top users display for Berkeley Unix
6  *
7  *  General (global) definitions
8  */
9 
10 #ifndef TOP_H
11 #define TOP_H
12 
13 #define Default_DELAY 2
14 
15 /* Number of lines of header information on the standard screen */
16 extern int Header_lines;	/* 7 */
17 
18 /* Maximum number of columns allowed for display */
19 #define MAX_COLS	512
20 
21 /* Log base 2 of 1024 is 10 (2^10 == 1024) */
22 #define LOG1024		10
23 
24 /* Special atoi routine returns either a non-negative number or one of: */
25 #define Infinity	-1
26 #define Invalid		-2
27 
28 /* maximum number we can have */
29 #define Largest		0x7fffffff
30 
31 /*
32  * The entire display is based on these next numbers being defined as is.
33  */
34 
35 #define NUM_AVERAGES    3
36 
37 enum displaymodes { DISP_CPU = 0, DISP_IO, DISP_MAX };
38 
39 /*
40  * Format modifiers
41  */
42 #define FMT_SHOWARGS 0x00000001
43 
44 extern enum displaymodes displaymode;
45 
46 extern int pcpu_stats;
47 extern int  overstrike;
48 
49 extern const char * myname;
50 
51 extern int (*compares[])(const void*, const void*);
52 
53 char* kill_procs(char *);
54 char* renice_procs(char *);
55 
56 extern char copyright[];
57 /* internal routines */
58 void quit(int);
59 
60 
61 /*
62  *  The space command forces an immediate update.  Sometimes, on loaded
63  *  systems, this update will take a significant period of time (because all
64  *  the output is buffered).  So, if the short-term load average is above
65  *  "LoadMax", then top will put the cursor home immediately after the space
66  *  is pressed before the next update is attempted.  This serves as a visual
67  *  acknowledgement of the command.
68  */
69 #define LoadMax  5.0
70 
71 /*
72  *  "Nominal_TOPN" is used as the default TOPN when
73  *  the output is a dumb terminal.  If we didn't do this, then
74  *  we will get every
75  *  process in the system when running top on a dumb terminal (or redirected
76  *  to a file).  Note that Nominal_TOPN is a default:  it can still be
77  *  overridden on the command line, even with the value "infinity".
78  */
79 #define Nominal_TOPN	18
80 
81 /*
82  *  If the local system's getpwnam interface uses random access to retrieve
83  *  a record (i.e.: 4.3 systems, Sun "yellow pages"), then defining
84  *  RANDOM_PW will take advantage of that fact.
85  */
86 
87 #define RANDOM_PW	1
88 
89 #endif /* TOP_H */
90