2004-07-01 09:12:38 +00:00
|
|
|
/*
|
|
|
|
* $FreeBSD$
|
|
|
|
*/
|
1997-03-23 18:51:21 +00:00
|
|
|
/*
|
|
|
|
* Top - a top users display for Berkeley Unix
|
|
|
|
*
|
|
|
|
* General (global) definitions
|
|
|
|
*/
|
|
|
|
|
2016-05-22 04:17:00 +00:00
|
|
|
#ifndef TOP_H
|
|
|
|
#define TOP_H
|
|
|
|
|
2018-05-20 23:37:30 +00:00
|
|
|
#define Default_DELAY 2
|
1997-03-23 18:51:21 +00:00
|
|
|
|
|
|
|
/* Number of lines of header information on the standard screen */
|
2008-01-18 01:43:14 +00:00
|
|
|
extern int Header_lines; /* 7 */
|
1997-03-23 18:51:21 +00:00
|
|
|
|
|
|
|
/* Maximum number of columns allowed for display */
|
2012-12-13 06:45:45 +00:00
|
|
|
#define MAX_COLS 512
|
1997-03-23 18:51:21 +00:00
|
|
|
|
|
|
|
/* Special atoi routine returns either a non-negative number or one of: */
|
|
|
|
#define Infinity -1
|
|
|
|
#define Invalid -2
|
|
|
|
|
|
|
|
/* maximum number we can have */
|
|
|
|
#define Largest 0x7fffffff
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The entire display is based on these next numbers being defined as is.
|
|
|
|
*/
|
|
|
|
|
2018-06-02 15:52:18 +00:00
|
|
|
/* Exit code for system errors */
|
|
|
|
#define TOP_EX_SYS_ERROR 23
|
|
|
|
|
2004-07-01 09:12:38 +00:00
|
|
|
enum displaymodes { DISP_CPU = 0, DISP_IO, DISP_MAX };
|
|
|
|
|
2007-04-14 10:16:52 +00:00
|
|
|
/*
|
|
|
|
* Format modifiers
|
|
|
|
*/
|
|
|
|
#define FMT_SHOWARGS 0x00000001
|
|
|
|
|
2004-07-01 09:12:38 +00:00
|
|
|
extern enum displaymodes displaymode;
|
2008-01-18 01:43:14 +00:00
|
|
|
|
|
|
|
extern int pcpu_stats;
|
2018-05-21 01:16:26 +00:00
|
|
|
extern int overstrike;
|
|
|
|
|
2018-05-21 03:36:16 +00:00
|
|
|
extern const char * myname;
|
|
|
|
|
2018-05-21 01:16:26 +00:00
|
|
|
extern int (*compares[])(const void*, const void*);
|
2016-05-22 04:17:00 +00:00
|
|
|
|
top(1): Quiesce several warnings
This is all warnings at level six (6) that are not
char-subscripts, incompatible-pointer-types,
sign-compare, switch, int-conversion,
missing-variable-declarations, cast-qual, cast-align
Some warnings that are fixed by this commit are:
shadow, strict-prototypes, missing-prototypes, pointer-arith,
unused-parameter, unused-const-variable, and several others
2018-05-20 02:14:27 +00:00
|
|
|
char* kill_procs(char *);
|
|
|
|
char* renice_procs(char *);
|
|
|
|
|
2018-05-21 09:25:21 +00:00
|
|
|
extern char copyright[];
|
2018-05-21 01:16:26 +00:00
|
|
|
/* internal routines */
|
|
|
|
void quit(int);
|
|
|
|
|
|
|
|
|
2018-05-20 23:37:30 +00:00
|
|
|
/*
|
|
|
|
* The space command forces an immediate update. Sometimes, on loaded
|
|
|
|
* systems, this update will take a significant period of time (because all
|
|
|
|
* the output is buffered). So, if the short-term load average is above
|
|
|
|
* "LoadMax", then top will put the cursor home immediately after the space
|
|
|
|
* is pressed before the next update is attempted. This serves as a visual
|
|
|
|
* acknowledgement of the command.
|
|
|
|
*/
|
|
|
|
#define LoadMax 5.0
|
|
|
|
|
|
|
|
/*
|
|
|
|
* "Nominal_TOPN" is used as the default TOPN when
|
|
|
|
* the output is a dumb terminal. If we didn't do this, then
|
|
|
|
* we will get every
|
|
|
|
* process in the system when running top on a dumb terminal (or redirected
|
|
|
|
* to a file). Note that Nominal_TOPN is a default: it can still be
|
|
|
|
* overridden on the command line, even with the value "infinity".
|
|
|
|
*/
|
|
|
|
#define Nominal_TOPN 18
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If the local system's getpwnam interface uses random access to retrieve
|
|
|
|
* a record (i.e.: 4.3 systems, Sun "yellow pages"), then defining
|
|
|
|
* RANDOM_PW will take advantage of that fact.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define RANDOM_PW 1
|
|
|
|
|
2016-05-22 04:17:00 +00:00
|
|
|
#endif /* TOP_H */
|