]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/top/top.h
top(1): another pass of cleanup
[FreeBSD/FreeBSD.git] / usr.bin / top / top.h
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 /* Special atoi routine returns either a non-negative number or one of: */
22 #define Infinity        -1
23 #define Invalid         -2
24
25 /* maximum number we can have */
26 #define Largest         0x7fffffff
27
28 /*
29  * The entire display is based on these next numbers being defined as is.
30  */
31
32 /* Exit code for system errors */
33 #define TOP_EX_SYS_ERROR        23
34
35 enum displaymodes { DISP_CPU = 0, DISP_IO, DISP_MAX };
36
37 /*
38  * Format modifiers
39  */
40 #define FMT_SHOWARGS 0x00000001
41
42 extern enum displaymodes displaymode;
43
44 extern int pcpu_stats;
45 extern int  overstrike;
46
47 extern const char * myname;
48
49 extern int (*compares[])(const void*, const void*);
50
51 char* kill_procs(char *);
52 char* renice_procs(char *);
53
54 extern char copyright[];
55 /* internal routines */
56 void quit(int);
57
58
59 /*
60  *  The space command forces an immediate update.  Sometimes, on loaded
61  *  systems, this update will take a significant period of time (because all
62  *  the output is buffered).  So, if the short-term load average is above
63  *  "LoadMax", then top will put the cursor home immediately after the space
64  *  is pressed before the next update is attempted.  This serves as a visual
65  *  acknowledgement of the command.
66  */
67 #define LoadMax  5.0
68
69 /*
70  *  "Nominal_TOPN" is used as the default TOPN when 
71  *  the output is a dumb terminal.  If we didn't do this, then
72  *  we will get every
73  *  process in the system when running top on a dumb terminal (or redirected
74  *  to a file).  Note that Nominal_TOPN is a default:  it can still be
75  *  overridden on the command line, even with the value "infinity".
76  */
77 #define Nominal_TOPN    18
78
79 /*
80  *  If the local system's getpwnam interface uses random access to retrieve
81  *  a record (i.e.: 4.3 systems, Sun "yellow pages"), then defining
82  *  RANDOM_PW will take advantage of that fact.  
83  */
84
85 #define RANDOM_PW       1
86
87 #endif /* TOP_H */