top: avoid name conflict in the next version of stdlib

Since its inception top has always used enumerators to
identify displayable fields. They've taken the form of
P_PID, etc. As it turns out, something has changed for
libc6-dev versions beyond 2.17-93 wherein 'P_PID' will
now be exposed via stdlib.h. I have not pinpointed the
exact cause but it may depend on header include order.

This patch just trades top's long standing 'P_' prefix
convention for that of 'EU_' (short for enumerator). I
cannot find *any* header under /usr/include/ currently
utilizing this particular three character combination.

And as a further safeguard top will henceforth include
'system' specific headers after the standard includes.

Reference(s):
http://www.freelists.org/post/procps/top-wont-compile-anymore

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner
2014-02-25 00:00:00 -06:00
committed by Craig Small
parent 2ade4b082b
commit 24f1fbd9d0
3 changed files with 268 additions and 268 deletions

280
top/top.c
View File

@ -18,12 +18,6 @@
* Sami Kerola, <kerolasa@iki.fi> * Sami Kerola, <kerolasa@iki.fi>
*/ */
#include <sys/ioctl.h>
#include <sys/resource.h>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#include <ctype.h> #include <ctype.h>
#include <curses.h> #include <curses.h>
#ifndef NUMA_DISABLE #ifndef NUMA_DISABLE
@ -37,7 +31,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <term.h> // foul sob, defines all sorts of stuff... #include <term.h> // foul sob, defines all sorts of stuff...
#undef tab #undef tab
#undef TTY #undef TTY
#include <termios.h> #include <termios.h>
@ -45,6 +39,12 @@
#include <unistd.h> #include <unistd.h>
#include <values.h> #include <values.h>
#include <sys/ioctl.h>
#include <sys/resource.h>
#include <sys/select.h> // also available via <sys/types.h>
#include <sys/time.h>
#include <sys/types.h> // also available via <stdlib.h>
#include "../include/fileutils.h" #include "../include/fileutils.h"
#include "../include/nls.h" #include "../include/nls.h"
@ -201,10 +201,10 @@ static int *PHash_sav = HHash_one, // alternating 'old/new' hash tables
/* Support for automatically sized fixed-width column expansions. /* Support for automatically sized fixed-width column expansions.
* (hopefully, the macros help clarify/document our new 'feature') */ * (hopefully, the macros help clarify/document our new 'feature') */
static int Autox_array [P_MAXPFLGS], static int Autox_array [EU_MAXPFLGS],
Autox_found; Autox_found;
#define AUTOX_NO P_MAXPFLGS #define AUTOX_NO EU_MAXPFLGS
#define AUTOX_COL(f) if (P_MAXPFLGS > f) Autox_array[f] = Autox_found = 1 #define AUTOX_COL(f) if (EU_MAXPFLGS > f) Autox_array[f] = Autox_found = 1
#define AUTOX_MODE (0 > Rc.fixed_widest) #define AUTOX_MODE (0 > Rc.fixed_widest)
/* Support for scale_mem and scale_num (to avoid duplication. */ /* Support for scale_mem and scale_num (to avoid duplication. */
@ -1688,9 +1688,9 @@ static FLD_t Fieldstab[] = {
a -1 width represents variable width columns a -1 width represents variable width columns
a 0 width represents columns set once at startup (see zap_fieldstab) a 0 width represents columns set once at startup (see zap_fieldstab)
.lflg anomalies: .lflg anomalies:
P_UED, L_NONE - natural outgrowth of 'stat()' in readproc (euid) EU_UED, L_NONE - natural outgrowth of 'stat()' in readproc (euid)
P_CPU, L_stat - never filled by libproc, but requires times (pcpu) EU_CPU, L_stat - never filled by libproc, but requires times (pcpu)
P_CMD, L_stat - may yet require L_CMDLINE in calibrate_fields (cmd/cmdline) EU_CMD, L_stat - may yet require L_CMDLINE in calibrate_fields (cmd/cmdline)
L_EITHER - must L_status, else L_stat == 64-bit math (__udivdi3) on 32-bit ! L_EITHER - must L_status, else L_stat == 64-bit math (__udivdi3) on 32-bit !
.width .scale .align .sort .lflg .width .scale .align .sort .lflg
@ -1715,11 +1715,11 @@ static FLD_t Fieldstab[] = {
{ 0, -1, A_right, SF(CPN), L_stat }, { 0, -1, A_right, SF(CPN), L_stat },
{ 0, -1, A_right, SF(CPU), L_stat }, { 0, -1, A_right, SF(CPU), L_stat },
{ 6, -1, A_right, SF(TME), L_stat }, { 6, -1, A_right, SF(TME), L_stat },
{ 9, -1, A_right, SF(TME), L_stat }, // P_TM2 slot { 9, -1, A_right, SF(TME), L_stat }, // EU_TM2 slot
#ifdef BOOST_PERCNT #ifdef BOOST_PERCNT
{ 5, -1, A_right, SF(RES), L_statm }, // P_MEM slot { 5, -1, A_right, SF(RES), L_statm }, // EU_MEM slot
#else #else
{ 4, -1, A_right, SF(RES), L_statm }, // P_MEM slot { 4, -1, A_right, SF(RES), L_statm }, // EU_MEM slot
#endif #endif
#ifndef NOBOOST_MEMS #ifndef NOBOOST_MEMS
{ 7, SK_Kb, A_right, SF(VRT), L_statm }, { 7, SK_Kb, A_right, SF(VRT), L_statm },
@ -1879,10 +1879,10 @@ static void build_headers (void) {
w->hdrcaplen += strlen(Caps_off) + strlen(w->capclr_msg); w->hdrcaplen += strlen(Caps_off) + strlen(w->capclr_msg);
} }
#else #else
if (P_MAXPFLGS <= f) continue; if (EU_MAXPFLGS <= f) continue;
#endif #endif
if (P_WCH == f) needpsdb = 1; if (EU_WCH == f) needpsdb = 1;
if (P_CMD == f && CHKw(w, Show_CMDLIN)) Frames_libflags |= L_CMDLINE; if (EU_CMD == f && CHKw(w, Show_CMDLIN)) Frames_libflags |= L_CMDLINE;
Frames_libflags |= Fieldstab[w->procflgs[i]].lflg; Frames_libflags |= Fieldstab[w->procflgs[i]].lflg;
s = scat(s, justify_pad(N_col(f) s = scat(s, justify_pad(N_col(f)
, VARcol(f) ? w->varcolsz : Fieldstab[f].width , VARcol(f) ? w->varcolsz : Fieldstab[f].width
@ -1905,7 +1905,7 @@ static void build_headers (void) {
// we must also accommodate an out of view sort field... // we must also accommodate an out of view sort field...
f = w->rc.sortindx; f = w->rc.sortindx;
Frames_libflags |= Fieldstab[f].lflg; Frames_libflags |= Fieldstab[f].lflg;
if (P_CMD == f && CHKw(w, Show_CMDLIN)) Frames_libflags |= L_CMDLINE; if (EU_CMD == f && CHKw(w, Show_CMDLIN)) Frames_libflags |= L_CMDLINE;
} // end: VIZISw(w) } // end: VIZISw(w)
if (Rc.mode_altscr) w = w->next; if (Rc.mode_altscr) w = w->next;
@ -1958,16 +1958,16 @@ static void calibrate_fields (void) {
if (VIZISw(w)) { if (VIZISw(w)) {
w->hdrcaplen = 0; // really only used with USE_X_COLHDR w->hdrcaplen = 0; // really only used with USE_X_COLHDR
// build window's pflgsall array, establish upper bounds for maxpflgs // build window's pflgsall array, establish upper bounds for maxpflgs
for (i = 0, w->totpflgs = 0; i < P_MAXPFLGS; i++) { for (i = 0, w->totpflgs = 0; i < EU_MAXPFLGS; i++) {
if (FLDviz(w, i)) { if (FLDviz(w, i)) {
f = FLDget(w, i); f = FLDget(w, i);
#ifdef USE_X_COLHDR #ifdef USE_X_COLHDR
w->pflgsall[w->totpflgs++] = f; w->pflgsall[w->totpflgs++] = f;
#else #else
if (CHKw(w, Show_HICOLS) && f == w->rc.sortindx) { if (CHKw(w, Show_HICOLS) && f == w->rc.sortindx) {
w->pflgsall[w->totpflgs++] = X_XON; w->pflgsall[w->totpflgs++] = EU_XON;
w->pflgsall[w->totpflgs++] = f; w->pflgsall[w->totpflgs++] = f;
w->pflgsall[w->totpflgs++] = X_XOF; w->pflgsall[w->totpflgs++] = EU_XOF;
} else } else
w->pflgsall[w->totpflgs++] = f; w->pflgsall[w->totpflgs++] = f;
#endif #endif
@ -1983,7 +1983,7 @@ static void calibrate_fields (void) {
f = w->pflgsall[i + w->begpflg]; f = w->pflgsall[i + w->begpflg];
w->procflgs[i] = f; w->procflgs[i] = f;
#ifndef USE_X_COLHDR #ifndef USE_X_COLHDR
if (P_MAXPFLGS <= f) continue; if (EU_MAXPFLGS <= f) continue;
#endif #endif
h = N_col(f); h = N_col(f);
len = (VARcol(f) ? (int)strlen(h) : Fieldstab[f].width) + COLPADSIZ; len = (VARcol(f) ? (int)strlen(h) : Fieldstab[f].width) + COLPADSIZ;
@ -1993,7 +1993,7 @@ static void calibrate_fields (void) {
s = scat(s, fmtmk("%*.*s", len, len, h)); s = scat(s, fmtmk("%*.*s", len, len, h));
} }
#ifndef USE_X_COLHDR #ifndef USE_X_COLHDR
if (X_XON == w->procflgs[i - 1]) --i; if (EU_XON == w->procflgs[i - 1]) --i;
#endif #endif
/* establish the final maxpflgs and prepare to grow the variable column /* establish the final maxpflgs and prepare to grow the variable column
@ -2010,7 +2010,7 @@ static void calibrate_fields (void) {
for (i = w->totpflgs - 1; -1 < i; i--) { for (i = w->totpflgs - 1; -1 < i; i--) {
f = w->pflgsall[i]; f = w->pflgsall[i];
#ifndef USE_X_COLHDR #ifndef USE_X_COLHDR
if (P_MAXPFLGS <= f) { w->endpflg = i; continue; } if (EU_MAXPFLGS <= f) { w->endpflg = i; continue; }
#endif #endif
h = N_col(f); h = N_col(f);
len = (VARcol(f) ? (int)strlen(h) : Fieldstab[f].width) + COLPADSIZ; len = (VARcol(f) ? (int)strlen(h) : Fieldstab[f].width) + COLPADSIZ;
@ -2019,7 +2019,7 @@ static void calibrate_fields (void) {
w->endpflg = i; w->endpflg = i;
} }
#ifndef USE_X_COLHDR #ifndef USE_X_COLHDR
if (X_XOF == w->pflgsall[w->endpflg]) ++w->endpflg; if (EU_XOF == w->pflgsall[w->endpflg]) ++w->endpflg;
#endif #endif
} // end: if (VIZISw(w)) } // end: if (VIZISw(w))
@ -2076,10 +2076,10 @@ static void display_fields (int focus, int extend) {
int rmax = Screen_rows - yRSVD; // total useable rows int rmax = Screen_rows - yRSVD; // total useable rows
static int col_sav, row_sav; static int col_sav, row_sav;
i = (P_MAXPFLGS % mxCOL) ? 1 : 0; i = (EU_MAXPFLGS % mxCOL) ? 1 : 0;
if (rmax < i + (P_MAXPFLGS / mxCOL)) mkERR; if (rmax < i + (EU_MAXPFLGS / mxCOL)) mkERR;
i = P_MAXPFLGS / rmax; i = EU_MAXPFLGS / rmax;
if (P_MAXPFLGS % rmax) ++i; if (EU_MAXPFLGS % rmax) ++i;
if (i > 1) { cmax /= i; xadd = 1; } if (i > 1) { cmax /= i; xadd = 1; }
if (cmax > xTOTL) cmax = xTOTL; if (cmax > xTOTL) cmax = xTOTL;
smax = cmax - xPRFX; smax = cmax - xPRFX;
@ -2094,7 +2094,7 @@ static void display_fields (int focus, int extend) {
} }
fflush(stdout); fflush(stdout);
for (i = 0; i < P_MAXPFLGS; ++i) { for (i = 0; i < EU_MAXPFLGS; ++i) {
int b = FLDviz(w, i), x = (i / rmax) * cmax, y = (i % rmax) + yRSVD; int b = FLDviz(w, i), x = (i / rmax) * cmax, y = (i % rmax) + yRSVD;
const char *e = (i == focus && extend) ? w->capclr_hdr : ""; const char *e = (i == focus && extend) ? w->capclr_hdr : "";
FLG_t f = FLDget(w, i); FLG_t f = FLDget(w, i);
@ -2169,7 +2169,7 @@ signify_that:
if (i > 0) { --i; if (p) swapEM } if (i > 0) { --i; if (p) swapEM }
break; break;
case kbd_DOWN: case kbd_DOWN:
if (i + 1 < P_MAXPFLGS) { ++i; if (p) swapEM } if (i + 1 < EU_MAXPFLGS) { ++i; if (p) swapEM }
break; break;
case kbd_LEFT: case kbd_LEFT:
case kbd_ENTER: case kbd_ENTER:
@ -2184,7 +2184,7 @@ signify_that:
break; break;
case kbd_END: case kbd_END:
case kbd_PGDN: case kbd_PGDN:
if (!p) i = P_MAXPFLGS - 1; if (!p) i = EU_MAXPFLGS - 1;
break; break;
case kbd_SPACE: case kbd_SPACE:
case 'd': case 'd':
@ -2222,7 +2222,7 @@ static inline void widths_resize (void) {
// next var may also be set by the guys that actually truncate stuff // next var may also be set by the guys that actually truncate stuff
Autox_found = 0; Autox_found = 0;
for (i = 0; i < P_MAXPFLGS; i++) { for (i = 0; i < EU_MAXPFLGS; i++) {
if (Autox_array[i]) { if (Autox_array[i]) {
Fieldstab[i].width++; Fieldstab[i].width++;
Autox_array[i] = 0; Autox_array[i] = 0;
@ -2242,29 +2242,29 @@ static void zap_fieldstab (void) {
char buf[8]; char buf[8];
if (!once) { if (!once) {
Fieldstab[P_PID].width = Fieldstab[P_PPD].width Fieldstab[EU_PID].width = Fieldstab[EU_PPD].width
= Fieldstab[P_PGD].width = Fieldstab[P_SID].width = Fieldstab[EU_PGD].width = Fieldstab[EU_SID].width
= Fieldstab[P_TGD].width = Fieldstab[P_TPG].width = 5; = Fieldstab[EU_TGD].width = Fieldstab[EU_TPG].width = 5;
if (5 < (digits = get_pid_digits())) { if (5 < (digits = get_pid_digits())) {
if (10 < digits) error_exit(N_txt(FAIL_widepid_txt)); if (10 < digits) error_exit(N_txt(FAIL_widepid_txt));
Fieldstab[P_PID].width = Fieldstab[P_PPD].width Fieldstab[EU_PID].width = Fieldstab[EU_PPD].width
= Fieldstab[P_PGD].width = Fieldstab[P_SID].width = Fieldstab[EU_PGD].width = Fieldstab[EU_SID].width
= Fieldstab[P_TGD].width = Fieldstab[P_TPG].width = digits; = Fieldstab[EU_TGD].width = Fieldstab[EU_TPG].width = digits;
} }
once = 1; once = 1;
} }
/*** hotplug_acclimated ***/ /*** hotplug_acclimated ***/
Fieldstab[P_CPN].width = 1; Fieldstab[EU_CPN].width = 1;
if (1 < (digits = (unsigned)snprintf(buf, sizeof(buf), "%u", (unsigned)smp_num_cpus))) { if (1 < (digits = (unsigned)snprintf(buf, sizeof(buf), "%u", (unsigned)smp_num_cpus))) {
if (5 < digits) error_exit(N_txt(FAIL_widecpu_txt)); if (5 < digits) error_exit(N_txt(FAIL_widecpu_txt));
Fieldstab[P_CPN].width = digits; Fieldstab[EU_CPN].width = digits;
} }
#ifdef BOOST_PERCNT #ifdef BOOST_PERCNT
Cpu_pmax = 99.9; Cpu_pmax = 99.9;
Fieldstab[P_CPU].width = 5; Fieldstab[EU_CPU].width = 5;
if (Rc.mode_irixps && smp_num_cpus > 1 && !Thread_mode) { if (Rc.mode_irixps && smp_num_cpus > 1 && !Thread_mode) {
Cpu_pmax = 100.0 * smp_num_cpus; Cpu_pmax = 100.0 * smp_num_cpus;
if (smp_num_cpus > 10) { if (smp_num_cpus > 10) {
@ -2275,7 +2275,7 @@ static void zap_fieldstab (void) {
} }
#else #else
Cpu_pmax = 99.9; Cpu_pmax = 99.9;
Fieldstab[P_CPU].width = 4; Fieldstab[EU_CPU].width = 4;
if (Rc.mode_irixps && smp_num_cpus > 1 && !Thread_mode) { if (Rc.mode_irixps && smp_num_cpus > 1 && !Thread_mode) {
Cpu_pmax = 100.0 * smp_num_cpus; Cpu_pmax = 100.0 * smp_num_cpus;
if (smp_num_cpus > 10) { if (smp_num_cpus > 10) {
@ -2283,33 +2283,33 @@ static void zap_fieldstab (void) {
} else { } else {
if (Cpu_pmax > 999.9) Cpu_pmax = 999.9; if (Cpu_pmax > 999.9) Cpu_pmax = 999.9;
} }
Fieldstab[P_CPU].width = 5; Fieldstab[EU_CPU].width = 5;
} }
#endif #endif
/* and accommodate optional wider non-scalable columns (maybe) */ /* and accommodate optional wider non-scalable columns (maybe) */
if (!AUTOX_MODE) { if (!AUTOX_MODE) {
int i; int i;
Fieldstab[P_UED].width = Fieldstab[P_URD].width Fieldstab[EU_UED].width = Fieldstab[EU_URD].width
= Fieldstab[P_USD].width = Fieldstab[P_GID].width = Fieldstab[EU_USD].width = Fieldstab[EU_GID].width
= Rc.fixed_widest ? 5 + Rc.fixed_widest : 5; = Rc.fixed_widest ? 5 + Rc.fixed_widest : 5;
Fieldstab[P_UEN].width = Fieldstab[P_URN].width Fieldstab[EU_UEN].width = Fieldstab[EU_URN].width
= Fieldstab[P_USN].width = Fieldstab[P_GRP].width = Fieldstab[EU_USN].width = Fieldstab[EU_GRP].width
= Rc.fixed_widest ? 8 + Rc.fixed_widest : 8; = Rc.fixed_widest ? 8 + Rc.fixed_widest : 8;
Fieldstab[P_TTY].width Fieldstab[EU_TTY].width
= Rc.fixed_widest ? 8 + Rc.fixed_widest : 8; = Rc.fixed_widest ? 8 + Rc.fixed_widest : 8;
Fieldstab[P_WCH].width Fieldstab[EU_WCH].width
= Rc.fixed_widest ? 10 + Rc.fixed_widest : 10; = Rc.fixed_widest ? 10 + Rc.fixed_widest : 10;
for (i = P_NS1; i < P_NS1 + NUM_NS; i++) for (i = EU_NS1; i < EU_NS1 + NUM_NS; i++)
Fieldstab[i].width Fieldstab[i].width
= Rc.fixed_widest ? 10 + Rc.fixed_widest : 10; = Rc.fixed_widest ? 10 + Rc.fixed_widest : 10;
} }
/* plus user selectable scaling */ /* plus user selectable scaling */
Fieldstab[P_VRT].scale = Fieldstab[P_SWP].scale Fieldstab[EU_VRT].scale = Fieldstab[EU_SWP].scale
= Fieldstab[P_RES].scale = Fieldstab[P_COD].scale = Fieldstab[EU_RES].scale = Fieldstab[EU_COD].scale
= Fieldstab[P_DAT].scale = Fieldstab[P_SHR].scale = Fieldstab[EU_DAT].scale = Fieldstab[EU_SHR].scale
= Fieldstab[P_USE].scale = Rc.task_mscale; = Fieldstab[EU_USE].scale = Rc.task_mscale;
// lastly, ensure we've got proper column headers... // lastly, ensure we've got proper column headers...
calibrate_fields(); calibrate_fields();
@ -3491,8 +3491,8 @@ static void configs_read (void) {
default: // and future versions? default: // and future versions?
if (strlen(w->rc.fieldscur) != sizeof(DEF_FIELDS) - 1) if (strlen(w->rc.fieldscur) != sizeof(DEF_FIELDS) - 1)
goto default_or_error; goto default_or_error;
for (x = 0; x < P_MAXPFLGS; ++x) for (x = 0; x < EU_MAXPFLGS; ++x)
if (P_MAXPFLGS <= FLDget(w, x)) if (EU_MAXPFLGS <= FLDget(w, x))
goto default_or_error; goto default_or_error;
break; break;
} }
@ -3671,16 +3671,16 @@ static void parse_args (char **args) {
else error_exit(fmtmk(N_fmt(MISSING_args_fmt), ch)); else error_exit(fmtmk(N_fmt(MISSING_args_fmt), ch));
if (*cp == '+') { SETw(Curwin, Qsrt_NORMAL); ++cp; } if (*cp == '+') { SETw(Curwin, Qsrt_NORMAL); ++cp; }
else if (*cp == '-') { OFFw(Curwin, Qsrt_NORMAL); ++cp; } else if (*cp == '-') { OFFw(Curwin, Qsrt_NORMAL); ++cp; }
for (i = 0; i < P_MAXPFLGS; i++) for (i = 0; i < EU_MAXPFLGS; i++)
if (!STRCMP(cp, N_col(i))) break; if (!STRCMP(cp, N_col(i))) break;
if (i == P_MAXPFLGS) if (i == EU_MAXPFLGS)
error_exit(fmtmk(N_fmt(XTRA_badflds_fmt), cp)); error_exit(fmtmk(N_fmt(XTRA_badflds_fmt), cp));
OFFw(Curwin, Show_FOREST); OFFw(Curwin, Show_FOREST);
Curwin->rc.sortindx = i; Curwin->rc.sortindx = i;
cp += strlen(cp); cp += strlen(cp);
break; break;
case 'O': case 'O':
for (i = 0; i < P_MAXPFLGS; i++) for (i = 0; i < EU_MAXPFLGS; i++)
puts(N_col(i)); puts(N_col(i));
bye_bye(NULL); bye_bye(NULL);
case 'p': case 'p':
@ -4244,9 +4244,9 @@ static void other_selection (int ch) {
} }
ops = *(pval); ops = *(pval);
*(pval++) = '\0'; *(pval++) = '\0';
for (enu = 0; enu < P_MAXPFLGS; enu++) // #4: is this a valid field? for (enu = 0; enu < EU_MAXPFLGS; enu++) // #4: is this a valid field?
if (!STRCMP(N_col(enu), glob)) break; if (!STRCMP(N_col(enu), glob)) break;
if (enu == P_MAXPFLGS) { if (enu == EU_MAXPFLGS) {
show_msg(fmtmk(N_fmt(XTRA_badflds_fmt), glob)); show_msg(fmtmk(N_fmt(XTRA_badflds_fmt), glob));
return; return;
} }
@ -4521,7 +4521,7 @@ static void keys_task (int ch) {
if (*p == w->rc.sortindx) { if (*p == w->rc.sortindx) {
--p; --p;
#ifndef USE_X_COLHDR #ifndef USE_X_COLHDR
if (P_MAXPFLGS < *p) --p; if (EU_MAXPFLGS < *p) --p;
#endif #endif
if (p >= w->procflgs) { if (p >= w->procflgs) {
w->rc.sortindx = *p; w->rc.sortindx = *p;
@ -4542,7 +4542,7 @@ static void keys_task (int ch) {
if (*p == w->rc.sortindx) { if (*p == w->rc.sortindx) {
++p; ++p;
#ifndef USE_X_COLHDR #ifndef USE_X_COLHDR
if (P_MAXPFLGS < *p) ++p; if (EU_MAXPFLGS < *p) ++p;
#endif #endif
if (p < w->procflgs + w->maxpflgs) { if (p < w->procflgs + w->maxpflgs) {
w->rc.sortindx = *p; w->rc.sortindx = *p;
@ -4611,7 +4611,7 @@ static void keys_task (int ch) {
case 'V': case 'V':
if (VIZCHKw(w)) { if (VIZCHKw(w)) {
TOGw(w, Show_FOREST); TOGw(w, Show_FOREST);
if (!ENUviz(w, P_CMD)) if (!ENUviz(w, EU_CMD))
show_msg(fmtmk(N_fmt(FOREST_modes_fmt) , CHKw(w, Show_FOREST) show_msg(fmtmk(N_fmt(FOREST_modes_fmt) , CHKw(w, Show_FOREST)
? N_txt(ON_word_only_txt) : N_txt(OFF_one_word_txt))); ? N_txt(ON_word_only_txt) : N_txt(OFF_one_word_txt)));
} }
@ -4731,13 +4731,13 @@ static void keys_window (int ch) {
w->varcolbeg -= SCROLLAMT; w->varcolbeg -= SCROLLAMT;
else if (0 < w->begpflg) { else if (0 < w->begpflg) {
w->begpflg -= 1; w->begpflg -= 1;
if (P_MAXPFLGS < w->pflgsall[w->begpflg]) w->begpflg -= 2; if (EU_MAXPFLGS < w->pflgsall[w->begpflg]) w->begpflg -= 2;
} }
} }
#else #else
if (VIZCHKw(w)) if (0 < w->begpflg) { if (VIZCHKw(w)) if (0 < w->begpflg) {
w->begpflg -= 1; w->begpflg -= 1;
if (P_MAXPFLGS < w->pflgsall[w->begpflg]) w->begpflg -= 2; if (EU_MAXPFLGS < w->pflgsall[w->begpflg]) w->begpflg -= 2;
} }
#endif #endif
break; break;
@ -4748,14 +4748,14 @@ static void keys_window (int ch) {
w->varcolbeg += SCROLLAMT; w->varcolbeg += SCROLLAMT;
if (0 > w->varcolbeg) w->varcolbeg = 0; if (0 > w->varcolbeg) w->varcolbeg = 0;
} else if (w->begpflg + 1 < w->totpflgs) { } else if (w->begpflg + 1 < w->totpflgs) {
if (P_MAXPFLGS < w->pflgsall[w->begpflg]) if (EU_MAXPFLGS < w->pflgsall[w->begpflg])
w->begpflg += (w->begpflg + 3 < w->totpflgs) ? 3 : 0; w->begpflg += (w->begpflg + 3 < w->totpflgs) ? 3 : 0;
else w->begpflg += 1; else w->begpflg += 1;
} }
} }
#else #else
if (VIZCHKw(w)) if (w->begpflg + 1 < w->totpflgs) { if (VIZCHKw(w)) if (w->begpflg + 1 < w->totpflgs) {
if (P_MAXPFLGS < w->pflgsall[w->begpflg]) if (EU_MAXPFLGS < w->pflgsall[w->begpflg])
w->begpflg += (w->begpflg + 3 < w->totpflgs) ? 3 : 0; w->begpflg += (w->begpflg + 3 < w->totpflgs) ? 3 : 0;
else w->begpflg += 1; else w->begpflg += 1;
} }
@ -4812,19 +4812,19 @@ static void keys_xtra (int ch) {
we would just whack do_key's key_tab entry and this function... */ we would just whack do_key's key_tab entry and this function... */
switch (ch) { switch (ch) {
case 'M': case 'M':
w->rc.sortindx = P_MEM; w->rc.sortindx = EU_MEM;
// xmsg = "Memory"; // xmsg = "Memory";
break; break;
case 'N': case 'N':
w->rc.sortindx = P_PID; w->rc.sortindx = EU_PID;
// xmsg = "Numerical"; // xmsg = "Numerical";
break; break;
case 'P': case 'P':
w->rc.sortindx = P_CPU; w->rc.sortindx = EU_CPU;
// xmsg = "CPU"; // xmsg = "CPU";
break; break;
case 'T': case 'T':
w->rc.sortindx = P_TM2; w->rc.sortindx = EU_TM2;
// xmsg = "Time"; // xmsg = "Time";
break; break;
default: // keep gcc happy default: // keep gcc happy
@ -5204,30 +5204,30 @@ static const char *task_show (const WIN_t *q, const proc_t *p) {
switch (i) { switch (i) {
#ifndef USE_X_COLHDR #ifndef USE_X_COLHDR
// these 2 aren't real procflgs, they're used in column highlighting! // these 2 aren't real procflgs, they're used in column highlighting!
case X_XON: case EU_XON:
case X_XOF: case EU_XOF:
cp = NULL; cp = NULL;
if (!CHKw(q, INFINDS_xxx | NOHIFND_xxx | NOHISEL_xxx)) { if (!CHKw(q, INFINDS_xxx | NOHIFND_xxx | NOHISEL_xxx)) {
/* treat running tasks specially - entire row may get highlighted /* treat running tasks specially - entire row may get highlighted
so we needn't turn it on and we MUST NOT turn it off */ so we needn't turn it on and we MUST NOT turn it off */
if (!('R' == p->state && CHKw(q, Show_HIROWS))) if (!('R' == p->state && CHKw(q, Show_HIROWS)))
cp = (X_XON == i ? q->capclr_rowhigh : q->capclr_rownorm); cp = (EU_XON == i ? q->capclr_rowhigh : q->capclr_rownorm);
} }
break; break;
#endif #endif
case P_CGR: case EU_CGR:
makeVAR(p->cgroup[0]); makeVAR(p->cgroup[0]);
break; break;
case P_CMD: case EU_CMD:
makeVAR(forest_display(q, p)); makeVAR(forest_display(q, p));
break; break;
case P_COD: case EU_COD:
cp = scale_mem(S, pages2K(p->trs), W, Jn); cp = scale_mem(S, pages2K(p->trs), W, Jn);
break; break;
case P_CPN: case EU_CPN:
cp = make_num(p->processor, W, Jn, AUTOX_NO); cp = make_num(p->processor, W, Jn, AUTOX_NO);
break; break;
case P_CPU: case EU_CPU:
{ float u = (float)p->pcpu * Frame_etscale; { float u = (float)p->pcpu * Frame_etscale;
/* process can't use more %cpu than number of threads it has /* process can't use more %cpu than number of threads it has
( thanks Jaromir Capik <jcapik@redhat.com> ) */ ( thanks Jaromir Capik <jcapik@redhat.com> ) */
@ -5236,150 +5236,150 @@ static const char *task_show (const WIN_t *q, const proc_t *p) {
cp = scale_pcnt(u, W, Jn); cp = scale_pcnt(u, W, Jn);
} }
break; break;
case P_DAT: case EU_DAT:
cp = scale_mem(S, pages2K(p->drs), W, Jn); cp = scale_mem(S, pages2K(p->drs), W, Jn);
break; break;
case P_DRT: case EU_DRT:
cp = scale_num(p->dt, W, Jn); cp = scale_num(p->dt, W, Jn);
break; break;
case P_ENV: case EU_ENV:
makeVAR(p->environ[0]); makeVAR(p->environ[0]);
break; break;
case P_FL1: case EU_FL1:
cp = scale_num(p->maj_flt, W, Jn); cp = scale_num(p->maj_flt, W, Jn);
break; break;
case P_FL2: case EU_FL2:
cp = scale_num(p->min_flt, W, Jn); cp = scale_num(p->min_flt, W, Jn);
break; break;
case P_FLG: case EU_FLG:
cp = make_str(hex_make(p->flags, 1), W, Js, AUTOX_NO); cp = make_str(hex_make(p->flags, 1), W, Js, AUTOX_NO);
break; break;
case P_FV1: case EU_FV1:
cp = scale_num(p->maj_delta, W, Jn); cp = scale_num(p->maj_delta, W, Jn);
break; break;
case P_FV2: case EU_FV2:
cp = scale_num(p->min_delta, W, Jn); cp = scale_num(p->min_delta, W, Jn);
break; break;
case P_GID: case EU_GID:
cp = make_num(p->egid, W, Jn, P_GID); cp = make_num(p->egid, W, Jn, EU_GID);
break; break;
case P_GRP: case EU_GRP:
cp = make_str(p->egroup, W, Js, P_GRP); cp = make_str(p->egroup, W, Js, EU_GRP);
break; break;
case P_MEM: case EU_MEM:
cp = scale_pcnt((float)pages2K(p->resident) * 100 / kb_main_total, W, Jn); cp = scale_pcnt((float)pages2K(p->resident) * 100 / kb_main_total, W, Jn);
break; break;
case P_NCE: case EU_NCE:
cp = make_num(p->nice, W, Jn, AUTOX_NO); cp = make_num(p->nice, W, Jn, AUTOX_NO);
break; break;
case P_NS1: // IPCNS case EU_NS1: // IPCNS
case P_NS2: // MNTNS case EU_NS2: // MNTNS
case P_NS3: // NETNS case EU_NS3: // NETNS
case P_NS4: // PIDNS case EU_NS4: // PIDNS
case P_NS5: // USERNS case EU_NS5: // USERNS
case P_NS6: // UTSNS case EU_NS6: // UTSNS
{ long ino = p->ns[i - P_NS1]; { long ino = p->ns[i - EU_NS1];
if (ino > 0) cp = make_num(ino, W, Jn, i); if (ino > 0) cp = make_num(ino, W, Jn, i);
else cp = make_str("-", W, Js, i); else cp = make_str("-", W, Js, i);
} }
break; break;
#ifdef OOMEM_ENABLE #ifdef OOMEM_ENABLE
case P_OOA: case EU_OOA:
cp = make_num(p->oom_adj, W, Jn, AUTOX_NO); cp = make_num(p->oom_adj, W, Jn, AUTOX_NO);
break; break;
case P_OOM: case EU_OOM:
cp = make_num(p->oom_score, W, Jn, AUTOX_NO); cp = make_num(p->oom_score, W, Jn, AUTOX_NO);
break; break;
#endif #endif
case P_PGD: case EU_PGD:
cp = make_num(p->pgrp, W, Jn, AUTOX_NO); cp = make_num(p->pgrp, W, Jn, AUTOX_NO);
break; break;
case P_PID: case EU_PID:
cp = make_num(p->tid, W, Jn, AUTOX_NO); cp = make_num(p->tid, W, Jn, AUTOX_NO);
break; break;
case P_PPD: case EU_PPD:
cp = make_num(p->ppid, W, Jn, AUTOX_NO); cp = make_num(p->ppid, W, Jn, AUTOX_NO);
break; break;
case P_PRI: case EU_PRI:
if (-99 > p->priority || 999 < p->priority) { if (-99 > p->priority || 999 < p->priority) {
cp = make_str("rt", W, Jn, AUTOX_NO); cp = make_str("rt", W, Jn, AUTOX_NO);
} else } else
cp = make_num(p->priority, W, Jn, AUTOX_NO); cp = make_num(p->priority, W, Jn, AUTOX_NO);
break; break;
case P_RES: case EU_RES:
cp = scale_mem(S, pages2K(p->resident), W, Jn); cp = scale_mem(S, pages2K(p->resident), W, Jn);
break; break;
case P_SGD: case EU_SGD:
makeVAR(p->supgid); makeVAR(p->supgid);
break; break;
case P_SGN: case EU_SGN:
makeVAR(p->supgrp); makeVAR(p->supgrp);
break; break;
case P_SHR: case EU_SHR:
cp = scale_mem(S, pages2K(p->share), W, Jn); cp = scale_mem(S, pages2K(p->share), W, Jn);
break; break;
case P_SID: case EU_SID:
cp = make_num(p->session, W, Jn, AUTOX_NO); cp = make_num(p->session, W, Jn, AUTOX_NO);
break; break;
case P_STA: case EU_STA:
cp = make_chr(p->state, W, Js); cp = make_chr(p->state, W, Js);
break; break;
case P_SWP: case EU_SWP:
cp = scale_mem(S, p->vm_swap, W, Jn); cp = scale_mem(S, p->vm_swap, W, Jn);
break; break;
case P_TGD: case EU_TGD:
cp = make_num(p->tgid, W, Jn, AUTOX_NO); cp = make_num(p->tgid, W, Jn, AUTOX_NO);
break; break;
case P_THD: case EU_THD:
cp = make_num(p->nlwp, W, Jn, AUTOX_NO); cp = make_num(p->nlwp, W, Jn, AUTOX_NO);
break; break;
case P_TM2: case EU_TM2:
case P_TME: case EU_TME:
{ TIC_t t = p->utime + p->stime; { TIC_t t = p->utime + p->stime;
if (CHKw(q, Show_CTIMES)) t += (p->cutime + p->cstime); if (CHKw(q, Show_CTIMES)) t += (p->cutime + p->cstime);
cp = scale_tics(t, W, Jn); cp = scale_tics(t, W, Jn);
} }
break; break;
case P_TPG: case EU_TPG:
cp = make_num(p->tpgid, W, Jn, AUTOX_NO); cp = make_num(p->tpgid, W, Jn, AUTOX_NO);
break; break;
case P_TTY: case EU_TTY:
{ char tmp[SMLBUFSIZ]; { char tmp[SMLBUFSIZ];
dev_to_tty(tmp, W, p->tty, p->tid, ABBREV_DEV); dev_to_tty(tmp, W, p->tty, p->tid, ABBREV_DEV);
cp = make_str(tmp, W, Js, P_TTY); cp = make_str(tmp, W, Js, EU_TTY);
} }
break; break;
case P_UED: case EU_UED:
cp = make_num(p->euid, W, Jn, P_UED); cp = make_num(p->euid, W, Jn, EU_UED);
break; break;
case P_UEN: case EU_UEN:
cp = make_str(p->euser, W, Js, P_UEN); cp = make_str(p->euser, W, Js, EU_UEN);
break; break;
case P_URD: case EU_URD:
cp = make_num(p->ruid, W, Jn, P_URD); cp = make_num(p->ruid, W, Jn, EU_URD);
break; break;
case P_URN: case EU_URN:
cp = make_str(p->ruser, W, Js, P_URN); cp = make_str(p->ruser, W, Js, EU_URN);
break; break;
case P_USD: case EU_USD:
cp = make_num(p->suid, W, Jn, P_USD); cp = make_num(p->suid, W, Jn, EU_USD);
break; break;
case P_USE: case EU_USE:
cp = scale_mem(S, (p->vm_swap + pages2K(p->resident)), W, Jn); cp = scale_mem(S, (p->vm_swap + pages2K(p->resident)), W, Jn);
break; break;
case P_USN: case EU_USN:
cp = make_str(p->suser, W, Js, P_USN); cp = make_str(p->suser, W, Js, EU_USN);
break; break;
case P_VRT: case EU_VRT:
cp = scale_mem(S, pages2K(p->size), W, Jn); cp = scale_mem(S, pages2K(p->size), W, Jn);
break; break;
case P_WCH: case EU_WCH:
{ const char *u; { const char *u;
if (No_ksyms) if (No_ksyms)
u = hex_make(p->wchan, 0); u = hex_make(p->wchan, 0);
else else
u = lookup_wchan(p->wchan, p->tid); u = lookup_wchan(p->wchan, p->tid);
cp = make_str(u, W, Js, P_WCH); cp = make_str(u, W, Js, EU_WCH);
} }
break; break;
default: // keep gcc happy default: // keep gcc happy

View File

@ -181,28 +181,28 @@ char *strcasestr(const char *haystack, const char *needle);
/* Flags for each possible field (and then some) -- /* Flags for each possible field (and then some) --
these MUST be kept in sync with the FLD_t Fieldstab[] array !! */ these MUST be kept in sync with the FLD_t Fieldstab[] array !! */
enum pflag { enum pflag {
P_PID = 0, P_PPD, EU_PID = 0, EU_PPD,
P_UED, P_UEN, P_URD, P_URN, P_USD, P_USN, EU_UED, EU_UEN, EU_URD, EU_URN, EU_USD, EU_USN,
P_GID, P_GRP, P_PGD, P_TTY, P_TPG, P_SID, EU_GID, EU_GRP, EU_PGD, EU_TTY, EU_TPG, EU_SID,
P_PRI, P_NCE, P_THD, EU_PRI, EU_NCE, EU_THD,
P_CPN, P_CPU, P_TME, P_TM2, EU_CPN, EU_CPU, EU_TME, EU_TM2,
P_MEM, P_VRT, P_SWP, P_RES, P_COD, P_DAT, P_SHR, EU_MEM, EU_VRT, EU_SWP, EU_RES, EU_COD, EU_DAT, EU_SHR,
P_FL1, P_FL2, P_DRT, EU_FL1, EU_FL2, EU_DRT,
P_STA, P_CMD, P_WCH, P_FLG, P_CGR, EU_STA, EU_CMD, EU_WCH, EU_FLG, EU_CGR,
P_SGD, P_SGN, P_TGD, EU_SGD, EU_SGN, EU_TGD,
#ifdef OOMEM_ENABLE #ifdef OOMEM_ENABLE
P_OOA, P_OOM, EU_OOA, EU_OOM,
#endif #endif
P_ENV, EU_ENV,
P_FV1, P_FV2, EU_FV1, EU_FV2,
P_USE, EU_USE,
P_NS1, P_NS2, P_NS3, P_NS4, P_NS5, P_NS6, EU_NS1, EU_NS2, EU_NS3, EU_NS4, EU_NS5, EU_NS6,
#ifdef USE_X_COLHDR #ifdef USE_X_COLHDR
// not really pflags, used with tbl indexing // not really pflags, used with tbl indexing
P_MAXPFLGS EU_MAXPFLGS
#else #else
// not really pflags, used with tbl indexing & col highlighting // not really pflags, used with tbl indexing & col highlighting
P_MAXPFLGS, X_XON, X_XOF EU_MAXPFLGS, EU_XON, EU_XOF
#endif #endif
}; };
@ -446,7 +446,7 @@ typedef struct WIN_t {
#define VARright(w) (1 == w->maxpflgs && VARcol(w->procflgs[0])) #define VARright(w) (1 == w->maxpflgs && VARcol(w->procflgs[0]))
#else #else
#define VARright(w) ((1 == w->maxpflgs && VARcol(w->procflgs[0])) || \ #define VARright(w) ((1 == w->maxpflgs && VARcol(w->procflgs[0])) || \
(3 == w->maxpflgs && X_XON == w->procflgs[0] && VARcol(w->procflgs[1]))) (3 == w->maxpflgs && EU_XON == w->procflgs[0] && VARcol(w->procflgs[1])))
#endif #endif
#define VARleft(w) (w->varcolbeg && VARright(w)) #define VARleft(w) (w->varcolbeg && VARright(w))
#define SCROLLAMT 8 #define SCROLLAMT 8
@ -476,7 +476,7 @@ typedef struct WIN_t {
/* Used to create *most* of the sort callback functions /* Used to create *most* of the sort callback functions
note: some of the callbacks are NOT your father's callbacks, they're note: some of the callbacks are NOT your father's callbacks, they're
highly optimized to save them ol' precious cycles! */ highly optimized to save them ol' precious cycles! */
#define SCB_NAME(f) sort_P_ ## f #define SCB_NAME(f) sort_EU_ ## f
#define SCB_NUM1(f,n) \ #define SCB_NUM1(f,n) \
static int SCB_NAME(f) (const proc_t **P, const proc_t **Q) { \ static int SCB_NAME(f) (const proc_t **P, const proc_t **Q) { \
if ( (*P)->n < (*Q)->n ) return SORT_lt; \ if ( (*P)->n < (*Q)->n ) return SORT_lt; \
@ -598,16 +598,16 @@ typedef struct WIN_t {
/* The default values for the local config file */ /* The default values for the local config file */
#define DEF_RCFILE { \ #define DEF_RCFILE { \
RCF_VERSION_ID, 0, 1, DEF_DELAY, 0, { \ RCF_VERSION_ID, 0, 1, DEF_DELAY, 0, { \
{ P_CPU, DEF_WINFLGS, 0, \ { EU_CPU, DEF_WINFLGS, 0, \
COLOR_RED, COLOR_RED, COLOR_YELLOW, COLOR_RED, \ COLOR_RED, COLOR_RED, COLOR_YELLOW, COLOR_RED, \
"Def", DEF_FIELDS }, \ "Def", DEF_FIELDS }, \
{ P_PID, DEF_WINFLGS, 0, \ { EU_PID, DEF_WINFLGS, 0, \
COLOR_CYAN, COLOR_CYAN, COLOR_WHITE, COLOR_CYAN, \ COLOR_CYAN, COLOR_CYAN, COLOR_WHITE, COLOR_CYAN, \
"Job", JOB_FIELDS }, \ "Job", JOB_FIELDS }, \
{ P_MEM, DEF_WINFLGS, 0, \ { EU_MEM, DEF_WINFLGS, 0, \
COLOR_MAGENTA, COLOR_MAGENTA, COLOR_BLUE, COLOR_MAGENTA, \ COLOR_MAGENTA, COLOR_MAGENTA, COLOR_BLUE, COLOR_MAGENTA, \
"Mem", MEM_FIELDS }, \ "Mem", MEM_FIELDS }, \
{ P_UEN, DEF_WINFLGS, 0, \ { EU_UEN, DEF_WINFLGS, 0, \
COLOR_YELLOW, COLOR_YELLOW, COLOR_GREEN, COLOR_YELLOW, \ COLOR_YELLOW, COLOR_YELLOW, COLOR_GREEN, COLOR_YELLOW, \
"Usr", USR_FIELDS } \ "Usr", USR_FIELDS } \
}, 0, SK_Kb, SK_Kb, 0 } }, 0, SK_Kb, SK_Kb, 0 }
@ -647,7 +647,7 @@ typedef struct WIN_t {
/* ( see the find_string function for the one true required protoype ) */ /* ( see the find_string function for the one true required protoype ) */
/*------ Sort callbacks ------------------------------------------------*/ /*------ Sort callbacks ------------------------------------------------*/
/* for each possible field, in the form of: */ /* for each possible field, in the form of: */
/*atic int sort_P_XXX (const proc_t **P, const proc_t **Q); */ /*atic int sort_EU_XXX (const proc_t **P, const proc_t **Q); */
/*------ Tiny useful routine(s) ----------------------------------------*/ /*------ Tiny useful routine(s) ----------------------------------------*/
//atic const char *fmtmk (const char *fmts, ...); //atic const char *fmtmk (const char *fmts, ...);
//atic inline char *scat (char *dst, const char *src); //atic inline char *scat (char *dst, const char *src);

View File

@ -94,8 +94,8 @@
* + none of the important translator only comments will * + none of the important translator only comments will
* clutter and obscure the main program * clutter and obscure the main program
*/ */
const char *Head_nlstab[P_MAXPFLGS]; const char *Head_nlstab[EU_MAXPFLGS];
const char *Desc_nlstab[P_MAXPFLGS]; const char *Desc_nlstab[EU_MAXPFLGS];
const char *Norm_nlstab[norm_MAX]; const char *Norm_nlstab[norm_MAX];
const char *Uniq_nlstab[uniq_MAX]; const char *Uniq_nlstab[uniq_MAX];
@ -121,162 +121,162 @@ static void build_two_nlstabs (void) {
. */ . */
/* Translation Hint: maximum 'PID' = 5 */ /* Translation Hint: maximum 'PID' = 5 */
Head_nlstab[P_PID] = _("PID"); Head_nlstab[EU_PID] = _("PID");
Desc_nlstab[P_PID] = _("Process Id"); Desc_nlstab[EU_PID] = _("Process Id");
/* Translation Hint: maximum 'PPID' = 5 */ /* Translation Hint: maximum 'PPID' = 5 */
Head_nlstab[P_PPD] = _("PPID"); Head_nlstab[EU_PPD] = _("PPID");
Desc_nlstab[P_PPD] = _("Parent Process pid"); Desc_nlstab[EU_PPD] = _("Parent Process pid");
/* Translation Hint: maximum 'UID' = 5 */ /* Translation Hint: maximum 'UID' = 5 */
Head_nlstab[P_UED] = _("UID"); Head_nlstab[EU_UED] = _("UID");
Desc_nlstab[P_UED] = _("Effective User Id"); Desc_nlstab[EU_UED] = _("Effective User Id");
/* Translation Hint: maximum 'USER' = 8 */ /* Translation Hint: maximum 'USER' = 8 */
Head_nlstab[P_UEN] = _("USER"); Head_nlstab[EU_UEN] = _("USER");
Desc_nlstab[P_UEN] = _("Effective User Name"); Desc_nlstab[EU_UEN] = _("Effective User Name");
/* Translation Hint: maximum 'RUID' = 5 */ /* Translation Hint: maximum 'RUID' = 5 */
Head_nlstab[P_URD] = _("RUID"); Head_nlstab[EU_URD] = _("RUID");
Desc_nlstab[P_URD] = _("Real User Id"); Desc_nlstab[EU_URD] = _("Real User Id");
/* Translation Hint: maximum 'RUSER' = 8 */ /* Translation Hint: maximum 'RUSER' = 8 */
Head_nlstab[P_URN] = _("RUSER"); Head_nlstab[EU_URN] = _("RUSER");
Desc_nlstab[P_URN] = _("Real User Name"); Desc_nlstab[EU_URN] = _("Real User Name");
/* Translation Hint: maximum 'SUID' = 5 */ /* Translation Hint: maximum 'SUID' = 5 */
Head_nlstab[P_USD] = _("SUID"); Head_nlstab[EU_USD] = _("SUID");
Desc_nlstab[P_USD] = _("Saved User Id"); Desc_nlstab[EU_USD] = _("Saved User Id");
/* Translation Hint: maximum 'SUSER' = 8 */ /* Translation Hint: maximum 'SUSER' = 8 */
Head_nlstab[P_USN] = _("SUSER"); Head_nlstab[EU_USN] = _("SUSER");
Desc_nlstab[P_USN] = _("Saved User Name"); Desc_nlstab[EU_USN] = _("Saved User Name");
/* Translation Hint: maximum 'GID' = 5 */ /* Translation Hint: maximum 'GID' = 5 */
Head_nlstab[P_GID] = _("GID"); Head_nlstab[EU_GID] = _("GID");
Desc_nlstab[P_GID] = _("Group Id"); Desc_nlstab[EU_GID] = _("Group Id");
/* Translation Hint: maximum 'GROUP' = 8 */ /* Translation Hint: maximum 'GROUP' = 8 */
Head_nlstab[P_GRP] = _("GROUP"); Head_nlstab[EU_GRP] = _("GROUP");
Desc_nlstab[P_GRP] = _("Group Name"); Desc_nlstab[EU_GRP] = _("Group Name");
/* Translation Hint: maximum 'PGRP' = 5 */ /* Translation Hint: maximum 'PGRP' = 5 */
Head_nlstab[P_PGD] = _("PGRP"); Head_nlstab[EU_PGD] = _("PGRP");
Desc_nlstab[P_PGD] = _("Process Group Id"); Desc_nlstab[EU_PGD] = _("Process Group Id");
/* Translation Hint: maximum 'TTY' = 8 */ /* Translation Hint: maximum 'TTY' = 8 */
Head_nlstab[P_TTY] = _("TTY"); Head_nlstab[EU_TTY] = _("TTY");
Desc_nlstab[P_TTY] = _("Controlling Tty"); Desc_nlstab[EU_TTY] = _("Controlling Tty");
/* Translation Hint: maximum 'TPGID' = 5 */ /* Translation Hint: maximum 'TPGID' = 5 */
Head_nlstab[P_TPG] = _("TPGID"); Head_nlstab[EU_TPG] = _("TPGID");
Desc_nlstab[P_TPG] = _("Tty Process Grp Id"); Desc_nlstab[EU_TPG] = _("Tty Process Grp Id");
/* Translation Hint: maximum 'SID' = 5 */ /* Translation Hint: maximum 'SID' = 5 */
Head_nlstab[P_SID] = _("SID"); Head_nlstab[EU_SID] = _("SID");
Desc_nlstab[P_SID] = _("Session Id"); Desc_nlstab[EU_SID] = _("Session Id");
/* Translation Hint: maximum 'PR' = 3 */ /* Translation Hint: maximum 'PR' = 3 */
Head_nlstab[P_PRI] = _("PR"); Head_nlstab[EU_PRI] = _("PR");
Desc_nlstab[P_PRI] = _("Priority"); Desc_nlstab[EU_PRI] = _("Priority");
/* Translation Hint: maximum 'NI' = 3 */ /* Translation Hint: maximum 'NI' = 3 */
Head_nlstab[P_NCE] = _("NI"); Head_nlstab[EU_NCE] = _("NI");
Desc_nlstab[P_NCE] = _("Nice Value"); Desc_nlstab[EU_NCE] = _("Nice Value");
/* Translation Hint: maximum 'nTH' = 3 */ /* Translation Hint: maximum 'nTH' = 3 */
Head_nlstab[P_THD] = _("nTH"); Head_nlstab[EU_THD] = _("nTH");
Desc_nlstab[P_THD] = _("Number of Threads"); Desc_nlstab[EU_THD] = _("Number of Threads");
/* Translation Hint: maximum 'P' = 1 */ /* Translation Hint: maximum 'P' = 1 */
Head_nlstab[P_CPN] = _("P"); Head_nlstab[EU_CPN] = _("P");
Desc_nlstab[P_CPN] = _("Last Used Cpu (SMP)"); Desc_nlstab[EU_CPN] = _("Last Used Cpu (SMP)");
/* Translation Hint: maximum '%CPU' = 4 */ /* Translation Hint: maximum '%CPU' = 4 */
Head_nlstab[P_CPU] = _("%CPU"); Head_nlstab[EU_CPU] = _("%CPU");
Desc_nlstab[P_CPU] = _("CPU Usage"); Desc_nlstab[EU_CPU] = _("CPU Usage");
/* Translation Hint: maximum '' = 6 */ /* Translation Hint: maximum '' = 6 */
Head_nlstab[P_TME] = _("TIME"); Head_nlstab[EU_TME] = _("TIME");
Desc_nlstab[P_TME] = _("CPU Time"); Desc_nlstab[EU_TME] = _("CPU Time");
/* Translation Hint: maximum 'TIME+' = 9 */ /* Translation Hint: maximum 'TIME+' = 9 */
Head_nlstab[P_TM2] = _("TIME+"); Head_nlstab[EU_TM2] = _("TIME+");
Desc_nlstab[P_TM2] = _("CPU Time, hundredths"); Desc_nlstab[EU_TM2] = _("CPU Time, hundredths");
/* Translation Hint: maximum '%MEM' = 4 */ /* Translation Hint: maximum '%MEM' = 4 */
Head_nlstab[P_MEM] = _("%MEM"); Head_nlstab[EU_MEM] = _("%MEM");
Desc_nlstab[P_MEM] = _("Memory Usage (RES)"); Desc_nlstab[EU_MEM] = _("Memory Usage (RES)");
/* Translation Hint: maximum 'VIRT' = 5 */ /* Translation Hint: maximum 'VIRT' = 5 */
Head_nlstab[P_VRT] = _("VIRT"); Head_nlstab[EU_VRT] = _("VIRT");
Desc_nlstab[P_VRT] = _("Virtual Image (KiB)"); Desc_nlstab[EU_VRT] = _("Virtual Image (KiB)");
/* Translation Hint: maximum 'SWAP' = 4 */ /* Translation Hint: maximum 'SWAP' = 4 */
Head_nlstab[P_SWP] = _("SWAP"); Head_nlstab[EU_SWP] = _("SWAP");
Desc_nlstab[P_SWP] = _("Swapped Size (KiB)"); Desc_nlstab[EU_SWP] = _("Swapped Size (KiB)");
/* Translation Hint: maximum 'RES' = 4 */ /* Translation Hint: maximum 'RES' = 4 */
Head_nlstab[P_RES] = _("RES"); Head_nlstab[EU_RES] = _("RES");
Desc_nlstab[P_RES] = _("Resident Size (KiB)"); Desc_nlstab[EU_RES] = _("Resident Size (KiB)");
/* Translation Hint: maximum 'CODE' = 4 */ /* Translation Hint: maximum 'CODE' = 4 */
Head_nlstab[P_COD] = _("CODE"); Head_nlstab[EU_COD] = _("CODE");
Desc_nlstab[P_COD] = _("Code Size (KiB)"); Desc_nlstab[EU_COD] = _("Code Size (KiB)");
/* Translation Hint: maximum 'DATA' = 4 */ /* Translation Hint: maximum 'DATA' = 4 */
Head_nlstab[P_DAT] = _("DATA"); Head_nlstab[EU_DAT] = _("DATA");
Desc_nlstab[P_DAT] = _("Data+Stack (KiB)"); Desc_nlstab[EU_DAT] = _("Data+Stack (KiB)");
/* Translation Hint: maximum 'SHR' = 4 */ /* Translation Hint: maximum 'SHR' = 4 */
Head_nlstab[P_SHR] = _("SHR"); Head_nlstab[EU_SHR] = _("SHR");
Desc_nlstab[P_SHR] = _("Shared Memory (KiB)"); Desc_nlstab[EU_SHR] = _("Shared Memory (KiB)");
/* Translation Hint: maximum 'nMaj' = 4 */ /* Translation Hint: maximum 'nMaj' = 4 */
Head_nlstab[P_FL1] = _("nMaj"); Head_nlstab[EU_FL1] = _("nMaj");
Desc_nlstab[P_FL1] = _("Major Page Faults"); Desc_nlstab[EU_FL1] = _("Major Page Faults");
/* Translation Hint: maximum 'nMin' = 4 */ /* Translation Hint: maximum 'nMin' = 4 */
Head_nlstab[P_FL2] = _("nMin"); Head_nlstab[EU_FL2] = _("nMin");
Desc_nlstab[P_FL2] = _("Minor Page Faults"); Desc_nlstab[EU_FL2] = _("Minor Page Faults");
/* Translation Hint: maximum 'nDRT' = 4 */ /* Translation Hint: maximum 'nDRT' = 4 */
Head_nlstab[P_DRT] = _("nDRT"); Head_nlstab[EU_DRT] = _("nDRT");
Desc_nlstab[P_DRT] = _("Dirty Pages Count"); Desc_nlstab[EU_DRT] = _("Dirty Pages Count");
/* Translation Hint: maximum 'S' = 1 */ /* Translation Hint: maximum 'S' = 1 */
Head_nlstab[P_STA] = _("S"); Head_nlstab[EU_STA] = _("S");
Desc_nlstab[P_STA] = _("Process Status"); Desc_nlstab[EU_STA] = _("Process Status");
/* Translation Hint: maximum 'COMMAND' = 7 */ /* Translation Hint: maximum 'COMMAND' = 7 */
Head_nlstab[P_CMD] = _("COMMAND"); Head_nlstab[EU_CMD] = _("COMMAND");
Desc_nlstab[P_CMD] = _("Command Name/Line"); Desc_nlstab[EU_CMD] = _("Command Name/Line");
/* Translation Hint: maximum 'WCHAN' = 7 */ /* Translation Hint: maximum 'WCHAN' = 7 */
Head_nlstab[P_WCH] = _("WCHAN"); Head_nlstab[EU_WCH] = _("WCHAN");
Desc_nlstab[P_WCH] = _("Sleeping in Function"); Desc_nlstab[EU_WCH] = _("Sleeping in Function");
/* Translation Hint: maximum 'Flags' = 8 */ /* Translation Hint: maximum 'Flags' = 8 */
Head_nlstab[P_FLG] = _("Flags"); Head_nlstab[EU_FLG] = _("Flags");
Desc_nlstab[P_FLG] = _("Task Flags <sched.h>"); Desc_nlstab[EU_FLG] = _("Task Flags <sched.h>");
/* Translation Hint: maximum 'CGROUPS' = 7 */ /* Translation Hint: maximum 'CGROUPS' = 7 */
Head_nlstab[P_CGR] = _("CGROUPS"); Head_nlstab[EU_CGR] = _("CGROUPS");
Desc_nlstab[P_CGR] = _("Control Groups"); Desc_nlstab[EU_CGR] = _("Control Groups");
/* Translation Hint: maximum 'SUPGIDS' = 7 */ /* Translation Hint: maximum 'SUPGIDS' = 7 */
Head_nlstab[P_SGD] = _("SUPGIDS"); Head_nlstab[EU_SGD] = _("SUPGIDS");
Desc_nlstab[P_SGD] = _("Supp Groups IDs"); Desc_nlstab[EU_SGD] = _("Supp Groups IDs");
/* Translation Hint: maximum 'SUPGRPS' = 7 */ /* Translation Hint: maximum 'SUPGRPS' = 7 */
Head_nlstab[P_SGN] = _("SUPGRPS"); Head_nlstab[EU_SGN] = _("SUPGRPS");
Desc_nlstab[P_SGN] = _("Supp Groups Names"); Desc_nlstab[EU_SGN] = _("Supp Groups Names");
/* Translation Hint: maximum 'TGID' = 5 */ /* Translation Hint: maximum 'TGID' = 5 */
Head_nlstab[P_TGD] = _("TGID"); Head_nlstab[EU_TGD] = _("TGID");
Desc_nlstab[P_TGD] = _("Thread Group Id"); Desc_nlstab[EU_TGD] = _("Thread Group Id");
#ifdef OOMEM_ENABLE #ifdef OOMEM_ENABLE
/* Translation Hint: maximum 'Adj' = 3 */ /* Translation Hint: maximum 'Adj' = 3 */
Head_nlstab[P_OOA] = _("Adj"); Head_nlstab[EU_OOA] = _("Adj");
Desc_nlstab[P_OOA] = _("oom_adjustment (2^X)"); Desc_nlstab[EU_OOA] = _("oom_adjustment (2^X)");
/* Translation Hint: maximum 'Badness' = 8 */ /* Translation Hint: maximum 'Badness' = 8 */
Head_nlstab[P_OOM] = _("Badness"); Head_nlstab[EU_OOM] = _("Badness");
Desc_nlstab[P_OOM] = _("oom_score (badness)"); Desc_nlstab[EU_OOM] = _("oom_score (badness)");
#endif #endif
/* Translation Hint: maximum 'ENVIRON' = 7 */ /* Translation Hint: maximum 'ENVIRON' = 7 */
Head_nlstab[P_ENV] = _("ENVIRON"); Head_nlstab[EU_ENV] = _("ENVIRON");
/* Translation Hint: the abbreviation 'vars' below is shorthand for /* Translation Hint: the abbreviation 'vars' below is shorthand for
'variables' */ 'variables' */
Desc_nlstab[P_ENV] = _("Environment vars"); Desc_nlstab[EU_ENV] = _("Environment vars");
/* Translation Hint: maximum 'vMj' = 3 */ /* Translation Hint: maximum 'vMj' = 3 */
Head_nlstab[P_FV1] = _("vMj"); Head_nlstab[EU_FV1] = _("vMj");
Desc_nlstab[P_FV1] = _("Major Faults delta"); Desc_nlstab[EU_FV1] = _("Major Faults delta");
/* Translation Hint: maximum 'vMn' = 3 */ /* Translation Hint: maximum 'vMn' = 3 */
Head_nlstab[P_FV2] = _("vMn"); Head_nlstab[EU_FV2] = _("vMn");
Desc_nlstab[P_FV2] = _("Minor Faults delta"); Desc_nlstab[EU_FV2] = _("Minor Faults delta");
/* Translation Hint: maximum 'USED' = 4 */ /* Translation Hint: maximum 'USED' = 4 */
Head_nlstab[P_USE] = _("USED"); Head_nlstab[EU_USE] = _("USED");
Desc_nlstab[P_USE] = _("Res+Swap Size (KiB)"); Desc_nlstab[EU_USE] = _("Res+Swap Size (KiB)");
/* Translation Hint: maximum 'nsIPC' = 10 */ /* Translation Hint: maximum 'nsIPC' = 10 */
Head_nlstab[P_NS1] = _("nsIPC"); Head_nlstab[EU_NS1] = _("nsIPC");
Desc_nlstab[P_NS1] = _("IPC namespace Inode"); Desc_nlstab[EU_NS1] = _("IPC namespace Inode");
/* Translation Hint: maximum 'nsMNT' = 10 */ /* Translation Hint: maximum 'nsMNT' = 10 */
Head_nlstab[P_NS2] = _("nsMNT"); Head_nlstab[EU_NS2] = _("nsMNT");
Desc_nlstab[P_NS2] = _("MNT namespace Inode"); Desc_nlstab[EU_NS2] = _("MNT namespace Inode");
/* Translation Hint: maximum 'nsNET' = 10 */ /* Translation Hint: maximum 'nsNET' = 10 */
Head_nlstab[P_NS3] = _("nsNET"); Head_nlstab[EU_NS3] = _("nsNET");
Desc_nlstab[P_NS3] = _("NET namespace Inode"); Desc_nlstab[EU_NS3] = _("NET namespace Inode");
/* Translation Hint: maximum 'nsPID' = 10 */ /* Translation Hint: maximum 'nsPID' = 10 */
Head_nlstab[P_NS4] = _("nsPID"); Head_nlstab[EU_NS4] = _("nsPID");
Desc_nlstab[P_NS4] = _("PID namespace Inode"); Desc_nlstab[EU_NS4] = _("PID namespace Inode");
/* Translation Hint: maximum 'nsUSER' = 10 */ /* Translation Hint: maximum 'nsUSER' = 10 */
Head_nlstab[P_NS5] = _("nsUSER"); Head_nlstab[EU_NS5] = _("nsUSER");
Desc_nlstab[P_NS5] = _("USER namespace Inode"); Desc_nlstab[EU_NS5] = _("USER namespace Inode");
/* Translation Hint: maximum 'nsUTS' = 10 */ /* Translation Hint: maximum 'nsUTS' = 10 */
Head_nlstab[P_NS6] = _("nsUTS"); Head_nlstab[EU_NS6] = _("nsUTS");
Desc_nlstab[P_NS6] = _("UTS namespace Inode"); Desc_nlstab[EU_NS6] = _("UTS namespace Inode");
} }
@ -681,7 +681,7 @@ void initialize_nls (void) {
memset(Head_nlstab, 0, sizeof(Head_nlstab)); memset(Head_nlstab, 0, sizeof(Head_nlstab));
memset(Desc_nlstab, 0, sizeof(Desc_nlstab)); memset(Desc_nlstab, 0, sizeof(Desc_nlstab));
build_two_nlstabs(); build_two_nlstabs();
for (i = 0; i < P_MAXPFLGS; i++) { for (i = 0; i < EU_MAXPFLGS; i++) {
if (!Head_nlstab[i]) { if (!Head_nlstab[i]) {
fprintf(stderr, nls_err, "Head", i); fprintf(stderr, nls_err, "Head", i);
exit(1); exit(1);