home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Utilities / top-0.5-MI / machine.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-21  |  1.3 KB  |  58 lines

  1. /*
  2.  *  This file defines the interface between top and the machine-dependent
  3.  *  module.  It is NOT machine dependent and should not need to be changed
  4.  *  for any specific machine.
  5.  */
  6.  
  7. #define lock_data_t int
  8.  
  9. /*
  10.  * the statics struct is filled in by machine_init
  11.  */
  12. struct statics
  13. {
  14.     char **procstate_names;
  15.     char **cpustate_names;
  16.     char **memory_names;
  17. };
  18.  
  19. /*
  20.  * the system_info struct is filled in by a machine dependent routine.
  21.  */
  22.  
  23. struct system_info
  24. {
  25.     int    last_pid;
  26.     double load_avg[NUM_AVERAGES];
  27.     int    p_total;
  28.     int    p_active;     /* number of procs considered "active" */
  29.     int    *procstates;
  30.     int    *cpustates;
  31.     int    *memory;
  32. };
  33.  
  34. /* cpu_states is an array of percentages * 10.  For example, 
  35.    the (integer) value 105 is 10.5% (or .105).
  36.  */
  37.  
  38. /*
  39.  * the process_select struct tells get_process_info what processes we
  40.  * are interested in seeing
  41.  */
  42.  
  43. struct process_select
  44. {
  45.     int idle;        /* show idle processes */
  46.     int system;        /* show system processes */
  47.     int uid;        /* only this uid (unless uid == -1) */
  48.     char *command;    /* only this command (unless == NULL) */
  49. };
  50.  
  51. /* routines defined by the machine dependent module */
  52.  
  53. char *format_header();
  54. char *format_next_process();
  55.  
  56. /* non-int routines typically used by the machine dependent module */
  57. char *printable();
  58.