xref: /original-bsd/bin/ps/ps.h (revision 2932bec8)
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.4 (Berkeley) 04/03/92
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	timeval u_start;
15 	struct	rusage u_ru;
16 	struct	rusage u_cru;
17 	char	u_acflag;
18 	char	u_valid;
19 };
20 
21 #define KI_PROC(ki) (&(ki)->ki_p->kp_proc)
22 #define KI_EPROC(ki) (&(ki)->ki_p->kp_eproc)
23 
24 typedef struct _kinfo {
25 	struct kinfo_proc *ki_p;	/* proc structure */
26 	struct usave ki_u;	/* interesting parts of user */
27 	char *ki_args;		/* exec args */
28 	char *ki_env;		/* environment */
29 } KINFO;
30 
31 /* Variables. */
32 typedef struct _var {
33 	char	*name;		/* name(s) of variable */
34 	char	*header;	/* default header */
35 	char	*alias;		/* aliases */
36 #define	COMM	0x01		/* needs exec arguments and environment (XXX) */
37 #define	LJUST	0x02		/* left adjust on output (trailing blanks) */
38 #define	USER	0x04		/* needs user structure */
39 	u_int	flag;
40 	int	(*oproc)();	/* output routine */
41 	short	width;		/* printing width */
42 	/*
43 	 * The following (optional) elements are hooks for passing information
44 	 * to the generic output routines: pvar, evar, uvar (those which print
45 	 * simple elements from well known structures: proc, eproc, usave)
46 	 */
47 	int	off;		/* offset in structure */
48 	enum	type type;	/* type of element */
49 	char	*fmt;		/* printf format */
50 	char	*time;		/* time format */
51 	/*
52 	 * glue to link selected fields together
53 	 */
54 } VAR;
55 
56 struct varent {
57 	VAR *var;
58 	struct varent *next;
59 };
60 
61 #include "extern.h"
62