Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / top / machine.h
1 /*
2  * $FreeBSD: src/contrib/top/machine.h,v 1.4.6.1 2002/08/11 17:09:25 dwmalone Exp $
3  */
4
5 /*
6  *  This file defines the interface between top and the machine-dependent
7  *  module.  It is NOT machine dependent and should not need to be changed
8  *  for any specific machine.
9  */
10
11 /*
12  * the statics struct is filled in by machine_init
13  */
14 struct statics
15 {
16     char **procstate_names;
17     char **cpustate_names;
18     char **memory_names;
19     char **swap_names;
20 #ifdef ORDER
21     char **order_names;
22 #endif
23 };
24
25 /*
26  * the system_info struct is filled in by a machine dependent routine.
27  */
28
29 #ifdef p_active     /* uw7 define macro p_active */
30 #define P_ACTIVE p_pactive
31 #else
32 #define P_ACTIVE p_active
33 #endif
34
35 struct system_info
36 {
37     int    last_pid;
38     double load_avg[NUM_AVERAGES];
39     int    p_total;
40     int    P_ACTIVE;     /* number of procs considered "active" */
41     int    *procstates;
42     int    *cpustates;
43     int    *memory;
44     int    *swap;
45     struct timeval boottime;
46 };
47
48 /* cpu_states is an array of percentages * 10.  For example, 
49    the (integer) value 105 is 10.5% (or .105).
50  */
51
52 /*
53  * the process_select struct tells get_process_info what processes we
54  * are interested in seeing
55  */
56
57 struct process_select
58 {
59     int idle;           /* show idle processes */
60     int self;           /* show self */
61     int system;         /* show system processes */
62     int uid;            /* only this uid (unless uid == -1) */
63     char *command;      /* only this command (unless == NULL) */
64 };
65
66 /* routines defined by the machine dependent module */
67
68 char *format_header();
69 char *format_next_process();
70
71 /* non-int routines typically used by the machine dependent module */
72 char *printable();