Annotation of src/usr.bin/top/machine.h, Revision 1.5
1.5 ! mpech 1: /* $OpenBSD: machine.h,v 1.4 2002/02/17 19:42:33 millert Exp $ */
1.1 downsj 2:
3: /*
4: * This file defines the interface between top and the machine-dependent
5: * module. It is NOT machine dependent and should not need to be changed
6: * for any specific machine.
7: */
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: #ifdef ORDER
18: char **order_names;
19: #endif
20: };
21:
22: /*
23: * the system_info struct is filled in by a machine dependent routine.
24: */
25:
26: struct system_info
27: {
1.5 ! mpech 28: pid_t last_pid;
1.1 downsj 29: double load_avg[NUM_AVERAGES];
30: int p_total;
31: int p_active; /* number of procs considered "active" */
32: int *procstates;
33: int *cpustates;
34: int *memory;
35: };
36:
37: /* cpu_states is an array of percentages * 10. For example,
38: the (integer) value 105 is 10.5% (or .105).
39: */
40:
41: /*
42: * the process_select struct tells get_process_info what processes we
43: * are interested in seeing
44: */
45:
46: struct process_select
47: {
48: int idle; /* show idle processes */
49: int system; /* show system processes */
50: int uid; /* only this uid (unless uid == -1) */
51: char *command; /* only this command (unless == NULL) */
52: };
53:
1.2 downsj 54: /* prototypes */
1.3 millert 55: extern int display_init(struct statics *);
1.1 downsj 56:
1.2 downsj 57: /* machine.c */
1.3 millert 58: extern int machine_init(struct statics *);
59: extern char *format_header(char *);
60: extern void get_system_info(struct system_info *);
1.4 millert 61: extern caddr_t get_process_info(struct system_info *, struct process_select *,
62: int (*)(const void *, const void *));
63: extern char *format_next_process(caddr_t, char *(*)());
1.3 millert 64: extern int proc_compate(const void *, const void *);
65: extern int proc_owner(pid_t);