xref: /original-bsd/bin/ps/ps.h (revision 3b4109a4)
1 /*-
2  * Copyright (c) 1990 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)ps.h	5.1 (Berkeley) 02/08/91
8  */
9 
10 #define	UNLIMITED	0	/* unlimited terminal width */
11 enum type { CHAR, UCHAR, SHORT, USHORT, LONG, ULONG, KPTR };
12 
13 struct usave {
14 	struct	proc *u_procp;
15 	struct	timeval u_start;
16 	struct	rusage u_ru;
17 	struct	rusage u_cru;
18 	char	u_acflag;
19 };
20 
21 typedef struct _kinfo {
22 	struct proc *ki_p;	/* proc structure */
23 	struct eproc *ki_e;	/* extra stuff */
24 	struct usave *ki_u;	/* interesting parts of user */
25 	char *ki_args;		/* exec args (should be char **) */
26 	char *ki_env;		/* environment (should be char **) */
27 } KINFO;
28 
29 /* Variables. */
30 typedef struct _var {
31 	char	*name;		/* name(s) of variable */
32 	char	*header;	/* default header */
33 	char	*alias;		/* aliases */
34 #define	COMM	0x01		/* needs exec arguments and environment (XXX) */
35 #define	LJUST	0x02		/* left adjust on output (trailing blanks) */
36 #define	USER	0x04		/* needs user structure */
37 	u_int	flag;
38 	int	(*oproc)();	/* output routine */
39 	short	width;		/* printing width */
40 	/*
41 	 * The following (optional) elements are hooks for passing information
42 	 * to the generic output routines: pvar, evar, uvar (those which print
43 	 * simple elements from well known structures: proc, eproc, usave)
44 	 */
45 	int	off;		/* offset in structure */
46 	enum	type type;	/* type of element */
47 	char	*fmt;		/* printf format */
48 	char	*time;		/* time format */
49 	/*
50 	 * glue to link selected fields together
51 	 */
52 	struct _var *next;
53 } VAR;
54 
55 extern VAR var[], *vhead, *vtail;
56