home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume27 / top-3.2 / part01 / machine.h < prev    next >
C/C++ Source or Header  |  1993-08-08  |  1KB  |  56 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. /*
  8.  * the statics struct is filled in by machine_init
  9.  */
  10. struct statics
  11. {
  12.     char **procstate_names;
  13.     char **cpustate_names;
  14.     char **memory_names;
  15. };
  16.  
  17. /*
  18.  * the system_info struct is filled in by a machine dependent routine.
  19.  */
  20.  
  21. struct system_info
  22. {
  23.     int    last_pid;
  24.     double load_avg[NUM_AVERAGES];
  25.     int    p_total;
  26.     int    p_active;     /* number of procs considered "active" */
  27.     int    *procstates;
  28.     int    *cpustates;
  29.     int    *memory;
  30. };
  31.  
  32. /* cpu_states is an array of percentages * 10.  For example, 
  33.    the (integer) value 105 is 10.5% (or .105).
  34.  */
  35.  
  36. /*
  37.  * the process_select struct tells get_process_info what processes we
  38.  * are interested in seeing
  39.  */
  40.  
  41. struct process_select
  42. {
  43.     int idle;        /* show idle processes */
  44.     int system;        /* show system processes */
  45.     int uid;        /* only this uid (unless uid == -1) */
  46.     char *command;    /* only this command (unless == NULL) */
  47. };
  48.  
  49. /* routines defined by the machine dependent module */
  50.  
  51. char *format_header();
  52. char *format_next_process();
  53.  
  54. /* non-int routines typically used by the machine dependent module */
  55. char *printable();
  56.