From 1da293bf59187c734acfa89615265ecaf04b3a95 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Wed, 2 Jan 2013 00:00:00 -0600 Subject: [PATCH] top: accumulated miscellaneous code and comment tweaks This commit just addresses the following minor issues: . restored both lost end-of-job reporting capabilities . added missing initializers to the DEF_RCFILE #define . added 'nls_maybe' eye-catcher to the 'Scaled_sfxtab' . removed a now superfluous 'READMINSZ' assertion test . man document references to 'top' are more consistent (everything is perfectly justified plus right margins) (are completely filled, but of course it must be luck) Signed-off-by: Jim Warner --- top/top.1 | 12 ++++++------ top/top.c | 8 ++++---- top/top.h | 2 +- top/top_nls.c | 10 ---------- 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/top/top.1 b/top/top.1 index a590216d..6620d632 100644 --- a/top/top.1 +++ b/top/top.1 @@ -1087,7 +1087,7 @@ To narrow them you must specify a smaller number or restore the defaults. After issuing the 'Y' \*(CI, you will be prompted for a target PID. Typing a value or accepting the default results in a separate screen. That screen can be used to view a variety of files or piped command output -while the normal top iterative display is paused. +while the normal \*(We iterative display is paused. \*(NT This \*(CI is only fully realized when supporting entries have been manually added to the end of the \*(We \*(CF. @@ -1695,7 +1695,7 @@ Here is an example of the contents of\fI /etc/toprc\fR: .\" ...................................................................... .SS 6b. PERSONAL Configuration File .\" ---------------------------------------------------------------------- -This file is written as '$HOME/.your-name-4-top' + 'rc'. +This file is written as '$HOME/.your\-name\-4\-\*(We' + 'rc'. Use the 'W' \*(CI to create it or update it. Here is the general layout: @@ -1723,7 +1723,7 @@ Such entries simply reflect a file to be read or command/pipeline to be executed whose results will then be displayed in a separate scrollable, searchable window. -If you don't know the location or name of your top rcfile, use the 'W' +If you don't know the location or name of your \*(We rcfile, use the 'W' \*(CI to rewrite it and note those details. Inspect entries can be added with a redirected echo or by editing the \*(CF. @@ -1826,7 +1826,7 @@ there is an easy solution hinted at below. Options: help 1 2 3 4 5 6 7 8 9 10 11 ... .Ed -The entries in the top rcfile would have a number for the '.name' element and +The entries in the \*(We rcfile would have a number for the '.name' element and the 'help' entry would identify a shell script you've written explaining what those numbered selections actually mean. In that way, many more choices can be made visible. @@ -1858,7 +1858,7 @@ For this experiment, under x-windows open an xterm and maximize it. Then do the following: .Bd -literal -compact . provide a scheduling boost and tiny delay via: - nice -n -10 top -d.09 + nice -n -10 \*(We -d.09 . keep sorted column highlighting \*F so as to minimize path length . turn \*O reverse row highlighting for emphasis @@ -1965,7 +1965,7 @@ To report bugs, follow the instructions at: .\" ---------------------------------------------------------------------- .SH 9. HISTORY Former top .\" ---------------------------------------------------------------------- -The original top was written by Roger Binns, +The original \*(We was written by Roger Binns, based on Branko Lankester's ps program. Robert Nation diff --git a/top/top.c b/top/top.c index d1b08f3f..1257f4de 100644 --- a/top/top.c +++ b/top/top.c @@ -200,9 +200,9 @@ static int Autox_array [P_MAXPFLGS], #define AUTOX_MODE (0 > Rc.fixed_widest) /* Support for scale_mem and scale_num (to avoid duplication. */ -#ifdef CASEUP_SUFIX +#ifdef CASEUP_SUFIX // nls_maybe static char Scaled_sfxtab[] = { 'K', 'M', 'G', 'T', 'P', 'E', 0 }; -#else +#else // nls_maybe static char Scaled_sfxtab[] = { 'k', 'm', 'g', 't', 'p', 'e', 0 }; #endif @@ -345,7 +345,7 @@ static void bye_bye (const char *str) { at_eoj(); // restore tty in preparation for exit #ifdef ATEOJ_RPTSTD { proc_t *p; - if (!str && Ttychanged) { fprintf(stderr, + if (!str) { fprintf(stderr, "\n%s's Summary report:" "\n\tProgram" "\n\t Linux version = %u.%u.%u, %s" @@ -415,7 +415,7 @@ static void bye_bye (const char *str) { #ifndef OFF_HST_HASH #ifdef ATEOJ_RPTHSH - if (!str && Ttychanged) { + if (!str) { int i, j, pop, total_occupied, maxdepth, maxdepth_sav, numdepth , cross_foot, sz = HHASH_SIZ * (unsigned)sizeof(int); int depths[HHASH_SIZ]; diff --git a/top/top.h b/top/top.h index 2ae8fa50..4ef4efc5 100644 --- a/top/top.h +++ b/top/top.h @@ -573,7 +573,7 @@ typedef struct WIN_t { { P_UEN, DEF_WINFLGS, 0, \ COLOR_YELLOW, COLOR_YELLOW, COLOR_GREEN, COLOR_YELLOW, \ "Usr", USR_FIELDS } \ - }, 0 } + }, 0, SK_Kb, SK_Kb, 0 } /* Summary Lines specially formatted string(s) -- see 'show_special' for syntax details + other cautions. */ diff --git a/top/top_nls.c b/top/top_nls.c index 2b2b63bf..a2a44cfb 100644 --- a/top/top_nls.c +++ b/top/top_nls.c @@ -668,16 +668,6 @@ void initialize_nls (void) { fprintf(stderr, nls_err, "Uniq", i); exit(1); } - #ifndef INSP_OFFDEMO - if (READMINSZ < strlen(N_txt(YINSP_dstory_txt)) +1) { - fprintf(stderr - , "\nAssertion Failed in %s (%s):\n" - "\t'READMINSZ < strlen(N_txt(YINSP_dstory_txt)) + 1'\n" - "READMINSZ must be at least %u !\n\n" - , __FILE__, __func__, (unsigned)strlen(N_txt(YINSP_dstory_txt)) + 1); - exit(1); - } - #endif #else setlocale (LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR);