top.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*-
  2. * Top - a top users display for Berkeley Unix
  3. */
  4. #ifndef TOP_H
  5. #define TOP_H
  6. #include <unistd.h>
  7. /* Number of lines of header information on the standard screen */
  8. extern int Header_lines;
  9. /* Special atoi routine returns either a non-negative number or one of: */
  10. #define Infinity -1
  11. #define Invalid -2
  12. /* maximum number we can have */
  13. #define Largest 0x7fffffff
  14. /* Exit code for system errors */
  15. #define TOP_EX_SYS_ERROR 23
  16. enum displaymodes { DISP_CPU = 0, DISP_IO, DISP_MAX };
  17. /*
  18. * Format modifiers
  19. */
  20. #define FMT_SHOWARGS 0x00000001
  21. extern enum displaymodes displaymode;
  22. extern int pcpu_stats;
  23. extern int overstrike;
  24. extern pid_t mypid;
  25. extern int (*compares[])(const void*, const void*);
  26. extern int show_args;
  27. const char* kill_procs(char *);
  28. const char* renice_procs(char *);
  29. extern char copyright[];
  30. void quit(int);
  31. /*
  32. * The space command forces an immediate update. Sometimes, on loaded
  33. * systems, this update will take a significant period of time (because all
  34. * the output is buffered). So, if the short-term load average is above
  35. * "LoadMax", then top will put the cursor home immediately after the space
  36. * is pressed before the next update is attempted. This serves as a visual
  37. * acknowledgement of the command.
  38. */
  39. #define LoadMax 5.0
  40. /*
  41. * "Nominal_TOPN" is used as the default TOPN when
  42. * the output is a dumb terminal. If we didn't do this, then
  43. * we will get every
  44. * process in the system when running top on a dumb terminal (or redirected
  45. * to a file). Note that Nominal_TOPN is a default: it can still be
  46. * overridden on the command line, even with the value "infinity".
  47. */
  48. #define Nominal_TOPN 18
  49. #endif /* TOP_H */