top: refactoring now allows column header nls support

Now that column headings are independent of column
data format and require no carefully managed padding
bytes they are candidates for nls translation.

This commit migrates all column headings to the .pot
file with additional translator guidance in the form
of maximum sizes to avoid truncation.

It also places these new additions adjacent to their
associated descriptions, which were already present.

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2012-09-19 02:02:02 -05:00 committed by Craig Small
parent 64cfdda756
commit 0f61354bf7
4 changed files with 175 additions and 63 deletions

View File

@ -1341,60 +1341,61 @@ static FLD_t Fieldstab[] = {
P_CPU, L_stat - never filled by libproc, but requires times (pcpu) P_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) P_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 !
.head .width .scale .align .sort .lflg
--------- ------ ------ ------- -------- -------- */ .width .scale .align .sort .lflg
{ "PID", 0, -1, A_right, SF(PID), L_NONE }, ------ ------ -------- -------- -------- */
{ "PPID", 0, -1, A_right, SF(PPD), L_EITHER }, { 0, -1, A_right, SF(PID), L_NONE },
{ "UID", 5, -1, A_right, SF(UED), L_NONE }, { 0, -1, A_right, SF(PPD), L_EITHER },
{ "USER", 8, -1, A_left, SF(UEN), L_EUSER }, { 5, -1, A_right, SF(UED), L_NONE },
{ "RUID", 5, -1, A_right, SF(URD), L_status }, { 8, -1, A_left, SF(UEN), L_EUSER },
{ "RUSER", 8, -1, A_left, SF(URN), L_OUSER }, { 5, -1, A_right, SF(URD), L_status },
{ "SUID", 5, -1, A_right, SF(USD), L_status }, { 8, -1, A_left, SF(URN), L_OUSER },
{ "SUSER", 8, -1, A_left, SF(USN), L_OUSER }, { 5, -1, A_right, SF(USD), L_status },
{ "GID", 5, -1, A_right, SF(GID), L_NONE }, { 8, -1, A_left, SF(USN), L_OUSER },
{ "GROUP", 8, -1, A_left, SF(GRP), L_EGROUP }, { 5, -1, A_right, SF(GID), L_NONE },
{ "PGRP", 0, -1, A_right, SF(PGD), L_stat }, { 8, -1, A_left, SF(GRP), L_EGROUP },
{ "TTY", 8, -1, A_left, SF(TTY), L_stat }, { 0, -1, A_right, SF(PGD), L_stat },
{ "TPGID", 0, -1, A_right, SF(TPG), L_stat }, { 8, -1, A_left, SF(TTY), L_stat },
{ "SID", 0, -1, A_right, SF(SID), L_stat }, { 0, -1, A_right, SF(TPG), L_stat },
{ "PR", 3, -1, A_right, SF(PRI), L_stat }, { 0, -1, A_right, SF(SID), L_stat },
{ "NI", 3, -1, A_right, SF(NCE), L_stat }, { 3, -1, A_right, SF(PRI), L_stat },
{ "nTH", 3, -1, A_right, SF(THD), L_EITHER }, { 3, -1, A_right, SF(NCE), L_stat },
{ "P", 0, -1, A_right, SF(CPN), L_stat }, { 3, -1, A_right, SF(THD), L_EITHER },
{ "%CPU", 0, -1, A_right, SF(CPU), L_stat }, { 0, -1, A_right, SF(CPN), L_stat },
{ "TIME", 6, -1, A_right, SF(TME), L_stat }, { 0, -1, A_right, SF(CPU), L_stat },
{ "TIME+", 9, -1, A_right, SF(TME), L_stat }, { 6, -1, A_right, SF(TME), L_stat },
{ 9, -1, A_right, SF(TME), L_stat },
#ifdef PERCENTBOOST #ifdef PERCENTBOOST
{ "%MEM", 5, -1, A_right, SF(RES), L_statm }, { 5, -1, A_right, SF(RES), L_statm },
#else #else
{ "%MEM", 4, -1, A_right, SF(RES), L_statm }, { 4, -1, A_right, SF(RES), L_statm },
#endif #endif
{ "VIRT", 5, SK_Kb, A_right, SF(VRT), L_statm }, { 5, SK_Kb, A_right, SF(VRT), L_statm },
{ "SWAP", 4, SK_Kb, A_right, SF(SWP), L_status }, { 4, SK_Kb, A_right, SF(SWP), L_status },
{ "RES", 4, SK_Kb, A_right, SF(RES), L_statm }, { 4, SK_Kb, A_right, SF(RES), L_statm },
{ "CODE", 4, SK_Kb, A_right, SF(COD), L_statm }, { 4, SK_Kb, A_right, SF(COD), L_statm },
{ "DATA", 4, SK_Kb, A_right, SF(DAT), L_statm }, { 4, SK_Kb, A_right, SF(DAT), L_statm },
{ "SHR", 4, SK_Kb, A_right, SF(SHR), L_statm }, { 4, SK_Kb, A_right, SF(SHR), L_statm },
{ "nMaj", 4, SK_no, A_right, SF(FL1), L_stat }, { 4, SK_no, A_right, SF(FL1), L_stat },
{ "nMin", 4, SK_no, A_right, SF(FL2), L_stat }, { 4, SK_no, A_right, SF(FL2), L_stat },
{ "nDRT", 4, SK_no, A_right, SF(DRT), L_statm }, { 4, SK_no, A_right, SF(DRT), L_statm },
{ "S", 1, -1, A_right, SF(STA), L_EITHER }, { 1, -1, A_right, SF(STA), L_EITHER },
{ "COMMAND", -1, -1, A_left, SF(CMD), L_EITHER }, { -1, -1, A_left, SF(CMD), L_EITHER },
{ "WCHAN", -1, -1, A_left, SF(WCH), L_stat }, { -1, -1, A_left, SF(WCH), L_stat },
{ "Flags", 8, -1, A_left, SF(FLG), L_stat }, { 8, -1, A_left, SF(FLG), L_stat },
{ "CGROUPS", -1, -1, A_left, SF(CGR), L_CGROUP }, { -1, -1, A_left, SF(CGR), L_CGROUP },
{ "SUPGIDS", -1, -1, A_left, SF(SGD), L_status }, { -1, -1, A_left, SF(SGD), L_status },
{ "SUPGRPS", -1, -1, A_left, SF(SGN), L_SUPGRP }, { -1, -1, A_left, SF(SGN), L_SUPGRP },
{ "TGID", 0, -1, A_right, SF(TGD), L_status }, { 0, -1, A_right, SF(TGD), L_status },
#ifdef OOMEM_ENABLE #ifdef OOMEM_ENABLE
#define L_oom PROC_FILLOOM #define L_oom PROC_FILLOOM
{ "Adj", 3, -1, A_right, SF(OOA), L_oom }, { 3, -1, A_right, SF(OOA), L_oom },
{ "Badness", 8, -1, A_right, SF(OOM), L_oom }, { 8, -1, A_right, SF(OOM), L_oom },
#undef L_oom #undef L_oom
#endif #endif
{ "ENVIRON", -1, -1, A_left, SF(ENV), L_ENVIRON }, { -1, -1, A_left, SF(ENV), L_ENVIRON },
{ "vMj", 3, SK_no, A_right, SF(FV1), L_stat }, { 3, SK_no, A_right, SF(FV1), L_stat },
{ "vMn", 3, SK_no, A_right, SF(FV2), L_stat } { 3, SK_no, A_right, SF(FV2), L_stat }
#undef SF #undef SF
#undef A_left #undef A_left
#undef A_right #undef A_right
@ -1740,7 +1741,7 @@ static void display_fields (int focus, int extend) {
, b ? w->cap_bold : Cap_norm , b ? w->cap_bold : Cap_norm
, e , e
, i == focus ? w->capclr_hdr : "" , i == focus ? w->capclr_hdr : ""
, Fieldstab[f].head , N_col(f)
, Cap_norm , Cap_norm
, b ? w->cap_bold : "" , b ? w->cap_bold : ""
, e , e
@ -1781,7 +1782,7 @@ static void fields_utility (void) {
spewFI spewFI
do { do {
if (!h) h = Fieldstab[f].head; if (!h) h = N_col(f);
display_fields(i, (p != NULL)); display_fields(i, (p != NULL));
putp(Cap_home); putp(Cap_home);
show_special(1, fmtmk(N_unq(FIELD_header_fmt) show_special(1, fmtmk(N_unq(FIELD_header_fmt)

View File

@ -202,7 +202,6 @@ typedef int (*QFP_t)(const void *, const void *);
/* This structure consolidates the information that's used /* This structure consolidates the information that's used
in a variety of display roles. */ in a variety of display roles. */
typedef struct FLD_t { typedef struct FLD_t {
const char *head; // name for col heads + toggle/reorder fields
int width; // field width, if applicable int width; // field width, if applicable
const int scale; // scale_unum type, if applicable const int scale; // scale_unum type, if applicable
const int align; // the default column alignment flag const int align; // the default column alignment flag

View File

@ -75,13 +75,24 @@
// //
/* /*
* These are our three string tables with the following contents: * These are our string tables with the following contents:
* Head : column headings with varying size limits
* Desc : fields descriptions not to exceed 20 screen positions * Desc : fields descriptions not to exceed 20 screen positions
* Norm : regular text possibly also containing c-format specifiers * Norm : regular text possibly also containing c-format specifiers
* Uniq : show_special specially formatted strings * Uniq : show_special specially formatted strings
* *
* The latter table presents the greatest translation challenge ! * The latter table presents the greatest translation challenge !
*
* We go to the trouble of creating the nls string tables to achieve
* these objectives:
* + the overhead of repeated runtime calls to gettext()
* will be avoided
* + the order of the strings in the template (.pot) file
* can be completely controlled
* + none of the important translator only comments will
* clutter and obscure the main program
*/ */
const char *Head_nlstab[P_MAXPFLGS];
const char *Desc_nlstab[P_MAXPFLGS]; const char *Desc_nlstab[P_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];
@ -91,66 +102,157 @@ const char *Uniq_nlstab[uniq_MAX];
* This routine builds the nls table containing plain text only * This routine builds the nls table containing plain text only
* used as the field descriptions. Each translated line MUST be * used as the field descriptions. Each translated line MUST be
* kept to a maximum of 20 characters or less! */ * kept to a maximum of 20 characters or less! */
static void build_desc_nlstab (void) { static void build_two_nlstabs (void) {
/* Translation Notes ------------------------------------------------ /* Translation Notes ------------------------------------------------
. It is strongly recommend that the --no-wrap command line option . It is strongly recommend that the --no-wrap command line option
. be used with all supporting translation tools, when available. . be used with all supporting translation tools, when available.
. .
. The following single lines contain only plain text used as the . The following line pairs contain only plain text and consist of:
. descriptions under Field Management when the 'f' key is typed. . 1) a field name/column header - mostly upper case
. 2) the related description - both upper and lower case
.
. To avoid truncation at runtime, each column header is noted with
. its maximum size and the following description must not exceed
. 20 characters. Fewer characters are ok.
. .
. To avoid truncation, each translated line MUST be kept to a
. length of 20 characters or less.
. */ . */
/* Translation Hint: maximum 'PID' = 5 */
Head_nlstab[P_PID] = _("PID");
Desc_nlstab[P_PID] = _("Process Id"); Desc_nlstab[P_PID] = _("Process Id");
/* Translation Hint: maximum 'PPID' = 5 */
Head_nlstab[P_PPD] = _("PPID");
Desc_nlstab[P_PPD] = _("Parent Process pid"); Desc_nlstab[P_PPD] = _("Parent Process pid");
/* Translation Hint: maximum 'UID' = 5 */
Head_nlstab[P_UED] = _("UID");
Desc_nlstab[P_UED] = _("Effective User Id"); Desc_nlstab[P_UED] = _("Effective User Id");
/* Translation Hint: maximum 'USER' = 8 */
Head_nlstab[P_UEN] = _("USER");
Desc_nlstab[P_UEN] = _("Effective User Name"); Desc_nlstab[P_UEN] = _("Effective User Name");
/* Translation Hint: maximum 'RUID' = 5 */
Head_nlstab[P_URD] = _("RUID");
Desc_nlstab[P_URD] = _("Real User Id"); Desc_nlstab[P_URD] = _("Real User Id");
/* Translation Hint: maximum 'RUSER' = 8 */
Head_nlstab[P_URN] = _("RUSER");
Desc_nlstab[P_URN] = _("Real User Name"); Desc_nlstab[P_URN] = _("Real User Name");
/* Translation Hint: maximum 'SUID' = 5 */
Head_nlstab[P_USD] = _("SUID");
Desc_nlstab[P_USD] = _("Saved User Id"); Desc_nlstab[P_USD] = _("Saved User Id");
/* Translation Hint: maximum 'SUSER' = 8 */
Head_nlstab[P_USN] = _("SUSER");
Desc_nlstab[P_USN] = _("Saved User Name"); Desc_nlstab[P_USN] = _("Saved User Name");
/* Translation Hint: maximum 'GID' = 5 */
Head_nlstab[P_GID] = _("GID");
Desc_nlstab[P_GID] = _("Group Id"); Desc_nlstab[P_GID] = _("Group Id");
/* Translation Hint: maximum 'GROUP' = 8 */
Head_nlstab[P_GRP] = _("GROUP");
Desc_nlstab[P_GRP] = _("Group Name"); Desc_nlstab[P_GRP] = _("Group Name");
/* Translation Hint: maximum 'PGRP' = 5 */
Head_nlstab[P_PGD] = _("PGRP");
Desc_nlstab[P_PGD] = _("Process Group Id"); Desc_nlstab[P_PGD] = _("Process Group Id");
/* Translation Hint: maximum 'TTY' = 8 */
Head_nlstab[P_TTY] = _("TTY");
Desc_nlstab[P_TTY] = _("Controlling Tty"); Desc_nlstab[P_TTY] = _("Controlling Tty");
/* Translation Hint: maximum 'TPGID' = 5 */
Head_nlstab[P_TPG] = _("TPGID");
Desc_nlstab[P_TPG] = _("Tty Process Grp Id"); Desc_nlstab[P_TPG] = _("Tty Process Grp Id");
/* Translation Hint: maximum 'SID' = 5 */
Head_nlstab[P_SID] = _("SID");
Desc_nlstab[P_SID] = _("Session Id"); Desc_nlstab[P_SID] = _("Session Id");
/* Translation Hint: maximum 'PR' = 3 */
Head_nlstab[P_PRI] = _("PR");
Desc_nlstab[P_PRI] = _("Priority"); Desc_nlstab[P_PRI] = _("Priority");
/* Translation Hint: maximum 'NI' = 3 */
Head_nlstab[P_NCE] = _("NI");
Desc_nlstab[P_NCE] = _("Nice Value"); Desc_nlstab[P_NCE] = _("Nice Value");
/* Translation Hint: maximum 'nTH' = 3 */
Head_nlstab[P_THD] = _("nTH");
Desc_nlstab[P_THD] = _("Number of Threads"); Desc_nlstab[P_THD] = _("Number of Threads");
/* Translation Hint: maximum 'P' = 1 */
Head_nlstab[P_CPN] = _("P");
Desc_nlstab[P_CPN] = _("Last Used Cpu (SMP)"); Desc_nlstab[P_CPN] = _("Last Used Cpu (SMP)");
/* Translation Hint: maximum '%CPU' = 4 */
Head_nlstab[P_CPU] = _("%CPU");
Desc_nlstab[P_CPU] = _("CPU Usage"); Desc_nlstab[P_CPU] = _("CPU Usage");
/* Translation Hint: maximum '' = 6 */
Head_nlstab[P_TME] = _("TIME");
Desc_nlstab[P_TME] = _("CPU Time"); Desc_nlstab[P_TME] = _("CPU Time");
/* Translation Hint: maximum 'TIME+' = 9 */
Head_nlstab[P_TM2] = _("TIME+");
Desc_nlstab[P_TM2] = _("CPU Time, hundredths"); Desc_nlstab[P_TM2] = _("CPU Time, hundredths");
/* Translation Hint: maximum '%MEM' = 4 */
Head_nlstab[P_MEM] = _("%MEM");
Desc_nlstab[P_MEM] = _("Memory Usage (RES)"); Desc_nlstab[P_MEM] = _("Memory Usage (RES)");
/* Translation Hint: maximum 'VIRT' = 5 */
Head_nlstab[P_VRT] = _("VIRT");
Desc_nlstab[P_VRT] = _("Virtual Image (KiB)"); Desc_nlstab[P_VRT] = _("Virtual Image (KiB)");
/* Translation Hint: maximum 'SWAP' = 4 */
Head_nlstab[P_SWP] = _("SWAP");
Desc_nlstab[P_SWP] = _("Swapped Size (KiB)"); Desc_nlstab[P_SWP] = _("Swapped Size (KiB)");
/* Translation Hint: maximum 'RES' = 4 */
Head_nlstab[P_RES] = _("RES");
Desc_nlstab[P_RES] = _("Resident Size (KiB)"); Desc_nlstab[P_RES] = _("Resident Size (KiB)");
/* Translation Hint: maximum 'CODE' = 4 */
Head_nlstab[P_COD] = _("CODE");
Desc_nlstab[P_COD] = _("Code Size (KiB)"); Desc_nlstab[P_COD] = _("Code Size (KiB)");
/* Translation Hint: maximum 'DATA' = 4 */
Head_nlstab[P_DAT] = _("DATA");
Desc_nlstab[P_DAT] = _("Data+Stack (KiB)"); Desc_nlstab[P_DAT] = _("Data+Stack (KiB)");
/* Translation Hint: maximum 'SHR' = 4 */
Head_nlstab[P_SHR] = _("SHR");
Desc_nlstab[P_SHR] = _("Shared Memory (KiB)"); Desc_nlstab[P_SHR] = _("Shared Memory (KiB)");
/* Translation Hint: maximum 'nMaj' = 4 */
Head_nlstab[P_FL1] = _("nMaj");
Desc_nlstab[P_FL1] = _("Major Page Faults"); Desc_nlstab[P_FL1] = _("Major Page Faults");
/* Translation Hint: maximum 'nMin' = 4 */
Head_nlstab[P_FL2] = _("nMin");
Desc_nlstab[P_FL2] = _("Minor Page Faults"); Desc_nlstab[P_FL2] = _("Minor Page Faults");
/* Translation Hint: maximum 'nDRT' = 4 */
Head_nlstab[P_DRT] = _("nDRT");
Desc_nlstab[P_DRT] = _("Dirty Pages Count"); Desc_nlstab[P_DRT] = _("Dirty Pages Count");
/* Translation Hint: maximum 'S' = 1 */
Head_nlstab[P_STA] = _("S");
Desc_nlstab[P_STA] = _("Process Status"); Desc_nlstab[P_STA] = _("Process Status");
/* Translation Hint: maximum 'COMMAND' = 7 */
Head_nlstab[P_CMD] = _("COMMAND");
Desc_nlstab[P_CMD] = _("Command Name/Line"); Desc_nlstab[P_CMD] = _("Command Name/Line");
/* Translation Hint: maximum 'WCHAN' = 7 */
Head_nlstab[P_WCH] = _("WCHAN");
Desc_nlstab[P_WCH] = _("Sleeping in Function"); Desc_nlstab[P_WCH] = _("Sleeping in Function");
/* Translation Hint: maximum 'Flags' = 8 */
Head_nlstab[P_FLG] = _("Flags");
Desc_nlstab[P_FLG] = _("Task Flags <sched.h>"); Desc_nlstab[P_FLG] = _("Task Flags <sched.h>");
/* Translation Hint: maximum 'CGROUPS' = 7 */
Head_nlstab[P_CGR] = _("CGROUPS");
Desc_nlstab[P_CGR] = _("Control Groups"); Desc_nlstab[P_CGR] = _("Control Groups");
/* Translation Hint: maximum 'SUPGIDS' = 7 */
Head_nlstab[P_SGD] = _("SUPGIDS");
Desc_nlstab[P_SGD] = _("Supp Groups IDs"); Desc_nlstab[P_SGD] = _("Supp Groups IDs");
/* Translation Hint: maximum 'SUPGRPS' = 7 */
Head_nlstab[P_SGN] = _("SUPGRPS");
Desc_nlstab[P_SGN] = _("Supp Groups Names"); Desc_nlstab[P_SGN] = _("Supp Groups Names");
/* Translation Hint: maximum 'TGID' = 5 */
Head_nlstab[P_TGD] = _("TGID");
Desc_nlstab[P_TGD] = _("Thread Group Id"); Desc_nlstab[P_TGD] = _("Thread Group Id");
#ifdef OOMEM_ENABLE #ifdef OOMEM_ENABLE
/* Translation Hint: maximum 'Adj' = 3 */
Head_nlstab[P_OOA] = _("Adj");
Desc_nlstab[P_OOA] = _("oom_adjustment (2^X)"); Desc_nlstab[P_OOA] = _("oom_adjustment (2^X)");
/* Translation Hint: maximum 'Badness' = 8 */
Head_nlstab[P_OOM] = _("Badness");
Desc_nlstab[P_OOM] = _("oom_score (badness)"); Desc_nlstab[P_OOM] = _("oom_score (badness)");
#endif #endif
/* Translation Hint: The abbreviation 'vars' below is shorthand for /* Translation Hint: maximum 'ENVIRON' = 7 */
Head_nlstab[P_ENV] = _("ENVIRON");
/* Translation Hint: the abbreviation 'vars' below is shorthand for
'variables' */ 'variables' */
Desc_nlstab[P_ENV] = _("Environment vars"); Desc_nlstab[P_ENV] = _("Environment vars");
/* Translation Hint: maximum 'vMj' = 3 */
Head_nlstab[P_FV1] = _("vMj");
Desc_nlstab[P_FV1] = _("Major Faults delta"); Desc_nlstab[P_FV1] = _("Major Faults delta");
/* Translation Hint: maximum 'vMn' = 3 */
Head_nlstab[P_FV2] = _("vMn");
Desc_nlstab[P_FV2] = _("Minor Faults delta"); Desc_nlstab[P_FV2] = _("Minor Faults delta");
} }
@ -472,13 +574,19 @@ void initialize_nls (void) {
bindtextdomain(PACKAGE, LOCALEDIR); bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE); textdomain(PACKAGE);
memset(Head_nlstab, 0, sizeof(Head_nlstab));
memset(Desc_nlstab, 0, sizeof(Desc_nlstab)); memset(Desc_nlstab, 0, sizeof(Desc_nlstab));
build_desc_nlstab(); build_two_nlstabs();
for (i = 0; i < P_MAXPFLGS; i++) for (i = 0; i < P_MAXPFLGS; i++) {
if (!Head_nlstab[i]) {
fprintf(stderr, nls_err, "Head", i);
exit(1);
}
if (!Desc_nlstab[i]) { if (!Desc_nlstab[i]) {
fprintf(stderr, nls_err, "Desc", i); fprintf(stderr, nls_err, "Desc", i);
exit(1); exit(1);
} }
}
memset(Norm_nlstab, 0, sizeof(Norm_nlstab)); memset(Norm_nlstab, 0, sizeof(Norm_nlstab));
build_norm_nlstab(); build_norm_nlstab();
for (i = 0; i < norm_MAX; i++) for (i = 0; i < norm_MAX; i++)
@ -498,7 +606,7 @@ void initialize_nls (void) {
bindtextdomain(PACKAGE, LOCALEDIR); bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE); textdomain(PACKAGE);
build_desc_nlstab(); build_two_nlstabs();
build_norm_nlstab(); build_norm_nlstab();
build_uniq_nlstab(); build_uniq_nlstab();
#endif #endif

View File

@ -20,7 +20,8 @@
#define _Itop_nls #define _Itop_nls
/* /*
* These are our three string tables with the following contents: * These are our string tables with the following contents:
* Head : column headings with varying size limits
* Desc : field descriptions not to exceed 20 screen positions * Desc : field descriptions not to exceed 20 screen positions
* Norm : regular text possibly also containing c-format specifiers * Norm : regular text possibly also containing c-format specifiers
* Uniq : show_special specially formatted strings * Uniq : show_special specially formatted strings
@ -36,6 +37,7 @@
* + 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
*/ */
extern const char *Head_nlstab[];
extern const char *Desc_nlstab[]; extern const char *Desc_nlstab[];
extern const char *Norm_nlstab[]; extern const char *Norm_nlstab[];
extern const char *Uniq_nlstab[]; extern const char *Uniq_nlstab[];
@ -45,14 +47,16 @@ extern const char *Uniq_nlstab[];
* The N_txt and N_fmt macros are interchangeable but * The N_txt and N_fmt macros are interchangeable but
* highlight the two types of strings found in Norm_nlstable. * highlight the two types of strings found in Norm_nlstable.
*/ */
#define N_col(e) Head_nlstab[e]
#define N_fld(e) Desc_nlstab[e] #define N_fld(e) Desc_nlstab[e]
#define N_txt(e) Norm_nlstab[e] #define N_txt(e) Norm_nlstab[e]
#define N_fmt(e) Norm_nlstab[e] #define N_fmt(e) Norm_nlstab[e]
#define N_unq(e) Uniq_nlstab[e] #define N_unq(e) Uniq_nlstab[e]
/* /*
* These enums are the means to access two of our three tables. * These enums are the means to access two of our four tables.
* The Desc_nlstab is accessed with standard top pflag enums. * The Head_nlstab and Desc_nlstab are accessed with standard
* top pflag enums.
* *
* The norm_nls enums carry a suffix distinguishing plain text * The norm_nls enums carry a suffix distinguishing plain text
* from any text also containiing c-format specifiers. * from any text also containiing c-format specifiers.