xref: /original-bsd/usr.bin/systat/systat.h (revision 0dd2f719)
1 /*-
2  * Copyright (c) 1980, 1989, 1992 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)systat.h	5.10 (Berkeley) 05/21/93
8  */
9 
10 #include <curses.h>
11 
12 struct  cmdtab {
13         char    *c_name;		/* command name */
14         void    (*c_refresh)();		/* display refresh */
15         void    (*c_fetch)();		/* sets up data structures */
16         void    (*c_label)();		/* label display */
17 	int	(*c_init)();		/* initialize namelist, etc. */
18 	WINDOW	*(*c_open)();		/* open display */
19 	void	(*c_close)();		/* close display */
20 	int	(*c_cmd)();		/* display command interpreter */
21 	char	c_flags;		/* see below */
22 };
23 
24 #define	CF_INIT		0x1		/* been initialized */
25 #define	CF_LOADAV	0x2		/* display w/ load average */
26 
27 #define	TCP	0x1
28 #define	UDP	0x2
29 
30 #define KREAD(addr, buf, len)  kvm_ckread((addr), (buf), (len))
31 #define NVAL(indx)  namelist[(indx)].n_value
32 #define NPTR(indx)  (void *)NVAL((indx))
33 #define NREAD(indx, buf, len) kvm_ckread(NPTR((indx)), (buf), (len))
34 #define LONG	(sizeof (long))
35