summaryrefslogtreecommitdiffstats
path: root/bin/ps/ps.h
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2011-09-29 06:31:42 +0000
committertrasz <trasz@FreeBSD.org>2011-09-29 06:31:42 +0000
commit5240e157ba7c37a35b695548523aad7d5b48fb0e (patch)
tree460e7da8b308ec464bd6db60915674271421b7b3 /bin/ps/ps.h
parentfc02252004dd6a6ce876d766ffe38222616705ca (diff)
downloadFreeBSD-src-5240e157ba7c37a35b695548523aad7d5b48fb0e.zip
FreeBSD-src-5240e157ba7c37a35b695548523aad7d5b48fb0e.tar.gz
Make ps(1) automatically size its column widths.
Diffstat (limited to 'bin/ps/ps.h')
-rw-r--r--bin/ps/ps.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/bin/ps/ps.h b/bin/ps/ps.h
index b1e9d9b..86aaeb0 100644
--- a/bin/ps/ps.h
+++ b/bin/ps/ps.h
@@ -35,6 +35,11 @@
#define UNLIMITED 0 /* unlimited terminal width */
enum type { CHAR, UCHAR, SHORT, USHORT, INT, UINT, LONG, ULONG, KPTR, PGTOK };
+typedef struct kinfo_str {
+ STAILQ_ENTRY(kinfo_str) ks_next;
+ char *ks_str; /* formatted string */
+} KINFO_STR;
+
typedef struct kinfo {
struct kinfo_proc *ki_p; /* kinfo_proc structure */
char *ki_args; /* exec args */
@@ -46,6 +51,7 @@ typedef struct kinfo {
int level; /* used in decendant_sort() */
char *prefix; /* calculated in decendant_sort() */
} ki_d;
+ STAILQ_HEAD(, kinfo_str) ki_ks;
} KINFO;
/* Variables. */
@@ -65,10 +71,7 @@ typedef struct var {
#define INF127 0x10 /* values >127 displayed as 127 */
u_int flag;
/* output routine */
- void (*oproc)(struct kinfo *, struct varent *);
- /* sizing routine */
- int (*sproc)(struct kinfo *);
- short width; /* printing width */
+ char *(*oproc)(struct kinfo *, struct varent *);
/*
* The following (optional) elements are hooks for passing information
* to the generic output routine pvar (which prints simple elements
@@ -77,10 +80,8 @@ typedef struct var {
size_t off; /* offset in structure */
enum type type; /* type of element */
const char *fmt; /* printf format */
- short dwidth; /* dynamic printing width */
- /*
- * glue to link selected fields together
- */
+
+ short width; /* calculated width */
} VAR;
#include "extern.h"
OpenPOWER on IntegriCloud