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