From f18215deb8e43f2cf968ac0e21a4de36ae77e295 Mon Sep 17 00:00:00 2001 From: gad Date: Mon, 29 Mar 2004 00:12:03 +0000 Subject: Sort the declarations of global variables. --- bin/ps/ps.c | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) (limited to 'bin') diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 691d8de..5b68347 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -80,21 +80,36 @@ __FBSDID("$FreeBSD$"); #define W_SEP " \t" /* "Whitespace" list separators */ #define T_SEP "," /* "Terminate-element" list separators */ -static KINFO *kinfo; +#ifdef LAZY_PS +#define DEF_UREAD 0; +#define OPT_LAZY_f "f" +#else +#define DEF_UREAD 1; /* Always do the more-expensive read. */ +#define OPT_LAZY_f /* I.e., the `-f' option is not added. */ +#endif + +int cflag; /* -c */ +int eval; /* Exit value */ +time_t now; /* Current time(3) value */ +int rawcpu; /* -C */ +int sumrusage; /* -S */ +int termwidth; /* Width of the screen (0 == infinity). */ +int totwidth; /* Calculated-width of requested variables. */ + struct varent *vhead; -int eval; /* exit value */ -int cflag; /* -c */ -int optfatal; /* Fatal error parsing some list-option */ -int rawcpu; /* -C */ -int sumrusage; /* -S */ -int termwidth; /* width of screen (0 == infinity) */ -int totwidth; /* calculated width of requested variables */ +static int forceuread = DEF_UREAD; /* Do extra work to get u-area. */ +static kvm_t *kd; +static KINFO *kinfo; +static int needcomm; /* -o "command" */ +static int needenv; /* -e */ +static int needuser; /* -o "user" */ +static int optfatal; /* Fatal error parsing some list-option. */ -time_t now; /* current time(3) value */ +static enum sort { DEFAULT, SORTMEM, SORTCPU } sortby = DEFAULT; struct listinfo; -typedef int addelem_rtn(struct listinfo *_inf, const char *elem); +typedef int addelem_rtn(struct listinfo *_inf, const char *_elem); struct listinfo { int count; @@ -111,18 +126,6 @@ struct listinfo { }; }; -static int needuser, needcomm, needenv; - -#ifdef LAZY_PS -static int forceuread = 0; -#define OPT_LAZY_f "f" -#else -static int forceuread = 1; -#define OPT_LAZY_f /* Ie, the `-f' option is not added. */ -#endif - -static enum sort { DEFAULT, SORTMEM, SORTCPU } sortby = DEFAULT; - static int addelem_gid(struct listinfo *, const char *); static int addelem_pid(struct listinfo *, const char *); static int addelem_tty(struct listinfo *, const char *); @@ -150,8 +153,6 @@ static char ufmt[] = "user,pid,%cpu,%mem,vsz,rss,tt,state,start,time,command"; static char vfmt[] = "pid,state,time,sl,re,pagein,vsz,rss,lim,tsiz,%cpu,%mem,command"; static char Zfmt[] = "label"; -static kvm_t *kd; - #define PS_ARGS "AaCc" OPT_LAZY_f "G:gHhjLlM:mN:O:o:p:rSTt:U:uvwXxZ" int -- cgit v1.1