1 // top.h - Header file: show Linux processes
3 // Copyright (c) 2002, by: James C. Warner
4 // All rights reserved. 8921 Hilloway Road
5 // Eden Prairie, Minnesota 55347 USA
6 // <warnerjc@worldnet.att.net>
8 // This file may be used subject to the terms and conditions of the
9 // GNU Library General Public License Version 2, or any later version
10 // at your option, as published by the Free Software Foundation.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU Library General Public License for more details.
16 // For their contributions to this program, the author wishes to thank:
17 // Albert D. Cahalan, <albert@users.sf.net>
18 // Craig Small, <csmall@small.dropbear.id.au>
20 // Changes by Albert Cahalan, 2002, 2004.
25 // Defines intended to be experimented with ------------------------
26 //#define CASEUP_HEXES // show any hex values in upper case
27 //#define CASEUP_SCALE // show scaled time/num suffix upper case
28 //#define CASEUP_SUMMK // show memory summary kilobytes with 'K'
29 //#define SORT_SUPRESS // *attempt* to reduce qsort overhead
30 //#define WARN_NOT_SMP // restrict '1' & 'I' commands to true smp
32 // Development/Debugging defines -----------------------------------
33 //#define ATEOJ_REPORT // report a bunch of stuff, at end-of-job
34 //#define PRETEND2_5_X // pretend we're linux 2.5.x (for IO-wait)
35 //#define PRETENDNOCAP // use a terminal without essential caps
36 //#define STDOUT_IOLBF // disable our own stdout _IOFBF override
39 #define linux_version_code LINUX_VERSION(2,5,43)
42 /*###### Some Miscellaneous constants ##################################*/
44 // The default delay twix updates
47 // The length of time a 'message' is displayed
50 // The default value for the 'k' (kill) request
51 #define DEF_SIGNAL SIGTERM
53 // Specific process id monitoring support (command line only)
56 // Power-of-two sizes lead to trouble; the largest power of
57 // two factor should be the cache line size. It'll mean the
58 // array indexing math gets slower, but cache aliasing is
60 #define CACHE_TWEAK_FACTOR 64
62 // Miscellaneous buffer sizes with liberal values -- mostly
63 // just to pinpoint source code usage/dependancies
64 #define SCREENMAX ( 512 + CACHE_TWEAK_FACTOR)
65 // the above might seem pretty stingy, until you consider that with every
66 // one of top's fields displayed we're talking a 160 byte column header --
67 // so that will provide for all fields plus a 350+ byte command line
75 #define SMLBUFSIZ ( 256 + CACHE_TWEAK_FACTOR)
76 #define OURPATHSZ (1024 + CACHE_TWEAK_FACTOR)
77 #define MEDBUFSIZ (1024 + CACHE_TWEAK_FACTOR)
78 #define BIGBUFSIZ (2048 + CACHE_TWEAK_FACTOR)
79 #define USRNAMSIZ GETBUFSIZ
80 #define ROWBUFSIZ SCREENMAX + CLRBUFSIZ
83 /*###### Some Miscellaneous Macro definitions ##########################*/
85 // Yield table size as 'int'
86 #define MAXTBL(t) (int)(sizeof(t) / sizeof(t[0]))
88 // Used as return arguments in *some* of the sort callbacks
89 #define SORT_lt ( Frame_srtflg > 0 ? 1 : -1 )
90 #define SORT_gt ( Frame_srtflg > 0 ? -1 : 1 )
93 // Used to create *most* of the sort callback functions
94 #define SCB_NUM1(f,n) \
95 static int sort_ ## f (const proc_t **P, const proc_t **Q) { \
96 if ( (*P)->n < (*Q)->n ) return SORT_lt; \
97 if (likely( (*P)->n > (*Q)->n )) return SORT_gt; \
99 #define SCB_NUM2(f,n1,n2) \
100 static int sort_ ## f (const proc_t **P, const proc_t **Q) { \
101 if ( ((*P)->n1 - (*P)->n2) < ((*Q)->n1 - (*Q)->n2) ) return SORT_lt; \
102 if (likely( ((*P)->n1 - (*P)->n2) > ((*Q)->n1 - (*Q)->n2) )) return SORT_gt; \
104 #define SCB_NUMx(f,n) \
105 static int sort_ ## f (const proc_t **P, const proc_t **Q) { \
106 return Frame_srtflg * ( (*Q)->n - (*P)->n ); }
107 #define SCB_STRx(f,s) \
108 static int sort_ ## f (const proc_t **P, const proc_t **Q) { \
109 return Frame_srtflg * strcmp((*Q)->s, (*P)->s); }
111 // The following two macros are used to 'inline' those portions of the
112 // display process requiring formatting, while protecting against any
113 // potential embedded 'millesecond delay' escape sequences.
115 // PUTT - Put to Tty (used in many places)
116 // - for temporary, possibly interactive, 'replacement' output
117 // - may contain ANY valid terminfo escape sequences
118 // - need NOT represent an entire screen row
119 #define PUTT(fmt,arg...) do { \
120 char _str[ROWBUFSIZ]; \
121 snprintf(_str, sizeof(_str), fmt, ## arg); \
125 // PUFF - Put for Frame (used in only 3 places)
126 // - for more permanent frame-oriented 'update' output
127 // - may NOT contain cursor motion terminfo escapes
128 // - assumed to represent a complete screen ROW
129 // - subject to optimization, thus MAY be discarded
131 // The evil version (53892 byte stripped top, oddly enough)
132 #define _PUFF(fmt,arg...) \
134 char _str[ROWBUFSIZ]; \
135 int _len = 1 + snprintf(_str, sizeof(_str), fmt, ## arg); \
136 putp ( Batch ? _str : \
138 char *restrict const _pse = &Pseudo_scrn[Pseudo_row++ * Pseudo_cols]; \
139 memcmp(_pse, _str, _len) ? memcpy(_pse, _str, _len) : "\n"; \
144 // The good version (53876 byte stripped top)
145 #define PUFF(fmt,arg...) \
147 char _str[ROWBUFSIZ]; \
149 int _len = 1 + snprintf(_str, sizeof(_str), fmt, ## arg); \
150 if (Batch) _ptr = _str; \
152 _ptr = &Pseudo_scrn[Pseudo_row++ * Pseudo_cols]; \
153 if (memcmp(_ptr, _str, _len)) { \
154 memcpy(_ptr, _str, _len); \
163 /*------ Special Macros (debug and/or informative) ---------------------*/
165 // Orderly end, with any sort of message - see fmtmk
166 #define debug_END(s) { \
167 static void std_err (const char *); \
168 fputs(Cap_clr_scr, stdout); \
172 // A poor man's breakpoint, if he's too lazy to learn gdb
173 #define its_YOUR_fault { *((char *)0) = '!'; }
176 /*###### Some Typedef's and Enum's #####################################*/
178 // This typedef just ensures consistent 'process flags' handling
179 typedef unsigned FLG_t;
181 // These typedefs attempt to ensure consistent 'ticks' handling
182 typedef unsigned long long TIC_t;
183 typedef long long SIC_t;
185 // Sort support, callback funtion signature
186 typedef int (*QFP_t)(const void *, const void *);
188 // This structure consolidates the information that's used
189 // in a variety of display roles.
190 typedef struct FLD_t {
191 const char keys [4]; // order: New-on New-off Old-on Old-off
192 // misaligned on 64-bit, but part of a table -- oh well
193 const char *head; // name for col heads + toggle/reorder fields
194 const char *fmts; // sprintf format string for field display
195 const int width; // field width, if applicable
196 const int scale; // scale_num type, if applicable
197 const QFP_t sort; // sort function
198 const char *desc; // description for toggle/reorder fields
199 const int lflg; // PROC_FILLxxx flag(s) needed by this field
202 // This structure stores one piece of critical 'history'
203 // information from one frame to the next -- we don't calc
204 // and save data that goes unused
205 typedef struct HST_t {
210 // This structure stores a frame's cpu tics used in history
211 // calculations. It exists primarily for SMP support but serves
213 typedef struct CPU_t {
214 TIC_t u, n, s, i, w, x, y, z; // as represented in /proc/stat
215 TIC_t u_sav, s_sav, n_sav, i_sav, w_sav, x_sav, y_sav, z_sav; // in the order of our display
216 unsigned id; // the CPU ID number
219 // These 2 types support rcfile compatibility
220 typedef struct RCW_t { // the 'window' portion of an rcfile
221 FLG_t sortindx; // sort field, represented as a procflag
222 int winflags, // 'view', 'show' and 'sort' mode flags
223 maxtasks, // user requested maximum, 0 equals all
224 summclr, // color num used in summ info
225 msgsclr, // " in msgs/pmts
226 headclr, // " in cols head
227 taskclr; // " in task rows
228 char winname [WINNAMSIZ], // window name, user changeable
229 fieldscur [PFLAGSSIZ]; // fields displayed and ordered
232 typedef struct RCF_t { // the complete rcfile (new style)
233 int mode_altscr; // 'A' - Alt display mode (multi task windows)
234 int mode_irixps; // 'I' - Irix vs. Solaris mode (SMP-only)
235 float delay_time; // 'd' or 's' - How long to sleep twixt updates
236 int win_index; // Curwin, as index
237 RCW_t win [4]; // a 'WIN_t.rc' for each of the 4 windows
240 // The scaling 'type' used with scale_num() -- this is how
241 // the passed number is interpreted should scaling be necessary
243 SK_no, SK_Kb, SK_Mb, SK_Gb, SK_Tb
246 // Flags for each possible field
248 P_PID, P_PPD, P_URR, P_UID, P_URE, P_GRP, P_TTY,
250 P_CPN, P_CPU, P_TME, P_TM2,
251 P_MEM, P_VRT, P_SWP, P_RES, P_COD, P_DAT, P_SHR,
253 P_STA, P_CMD, P_WCH, P_FLG
257 ///////////////////////////////////////////////////////////////////////////
258 // Special Section: multiple windows/field groups -------------
259 // (kind of a header within a header: constants, macros & types)
261 #define GROUPSMAX 4 // the max number of simultaneous windows
262 #define GRPNAMSIZ WINNAMSIZ+2 // window's name + number as in: '#:...'
264 #define Flags_TOG 1 // these are used to direct wins_reflag
268 // The Persistent 'Mode' flags!
269 // These are preserved in the rc file, as a single integer and the
270 // letter shown is the corresponding 'command' toggle
272 // 'View_' flags affect the summary (minimum), taken from 'Curwin'
273 #define View_CPUSUM 0x8000 // '1' - show combined cpu stats (vs. each)
274 #define View_LOADAV 0x4000 // 'l' - display load avg and uptime summary
275 #define View_STATES 0x2000 // 't' - display task/cpu(s) states summary
276 #define View_MEMORY 0x1000 // 'm' - display memory summary
277 #define View_NOBOLD 0x0001 // 'B' - disable 'bold' attribute globally
279 // 'Show_' & 'Qsrt_' flags are for task display in a visible window
280 #define Show_THREADS 0x10000 // 'H' - show threads in each task
281 #define Show_COLORS 0x0800 // 'z' - show in color (vs. mono)
282 #define Show_HIBOLD 0x0400 // 'b' - rows and/or cols bold (vs. reverse)
283 #define Show_HICOLS 0x0200 // 'x' - show sort column highlighted
284 #define Show_HIROWS 0x0100 // 'y' - show running tasks highlighted
285 #define Show_CMDLIN 0x0080 // 'c' - show cmdline vs. name
286 #define Show_CTIMES 0x0040 // 'S' - show times as cumulative
287 #define Show_IDLEPS 0x0020 // 'i' - show idle processes (all tasks)
288 #define Qsrt_NORMAL 0x0010 // 'R' - reversed column sort (high to low)
290 // these flag(s) have no command as such - they're for internal use
291 #define VISIBLE_tsk 0x0008 // tasks are showable when in 'Mode_altscr'
292 #define NEWFRAM_cwo 0x0004 // new frame (if anyone cares) - in Curwin
293 #define EQUWINS_cwo 0x0002 // rebalance tasks next frame (off 'i'/ 'n')
294 // ...set in Curwin, but impacts all windows
296 // Current-window-only flags -- always turned off at end-of-window!
297 #define FLGSOFF_cwo EQUWINS_cwo | NEWFRAM_cwo
299 // Default flags if there's no rcfile to provide user customizations
300 #define DEF_WINFLGS ( \
301 View_LOADAV | View_STATES | View_CPUSUM | View_MEMORY | View_NOBOLD | \
302 Show_HIBOLD | Show_HIROWS | Show_IDLEPS | Qsrt_NORMAL | \
306 // Used to test/manipulate the window flags
307 #define CHKw(q,f) (int)((q)->rc.winflags & (f))
308 #define TOGw(q,f) (q)->rc.winflags ^= (f)
309 #define SETw(q,f) (q)->rc.winflags |= (f)
310 #define OFFw(q,f) (q)->rc.winflags &= ~(f)
311 #define VIZCHKc (!Rc.mode_altscr || Curwin->rc.winflags & VISIBLE_tsk) \
313 #define VIZTOGc(f) (!Rc.mode_altscr || Curwin->rc.winflags & VISIBLE_tsk) \
314 ? TOGw(Curwin, f) : win_warn()
316 // This structure stores configurable information for each window.
317 // By expending a little effort in its creation and user requested
318 // maintainence, the only real additional per frame cost of having
319 // windows is an extra sort -- but that's just on ptrs!
320 typedef struct WIN_t {
321 struct WIN_t *next, // next window in window stack
322 *prev; // prior window in window stack
323 char *captab [CAPTABMAX]; // captab needed by show_special
324 int winnum, // window's num (array pos + 1)
325 winlines; // task window's rows (volatile)
326 FLG_t procflags [PFLAGSSIZ]; // fieldscur subset, as enum
327 int maxpflgs, // number of procflags (upcase fieldscur)
328 maxcmdln; // max length of a process' command line
329 int len_rownorm, // lengths of the corresponding terminfo
330 len_rowhigh; // strings to avoid repeated strlen calls
331 RCW_t rc; // stuff that gets saved in the rcfile
332 char capclr_sum [CLRBUFSIZ], // terminfo strings built from
333 capclr_msg [CLRBUFSIZ], // above clrs (& rebuilt too),
334 capclr_pmt [CLRBUFSIZ], // but NO recurring costs !!!
335 capclr_hdr [CLRBUFSIZ], // note: sum, msg and pmt strs
336 capclr_rowhigh [CLRBUFSIZ], // are only used when this
337 capclr_rownorm [CLRBUFSIZ]; // window is the 'Curwin'!
338 char cap_bold [CAPBUFSIZ]; // support for View_NOBOLD toggle
339 char grpname [GRPNAMSIZ], // window number:name, printable
340 columnhdr [SCREENMAX], // column headings for procflags
341 colusrnam [USRNAMSIZ]; // if selected by the 'u' command
345 /*###### Display Support *Data* ########################################*/
347 // Configuration files support
348 #define SYS_RCFILESPEC "/etc/toprc"
349 #define RCF_EYECATCHER "RCfile for "
350 #define RCF_DEPRECATED "Id:a, "
352 // The default fields displayed and their order,
353 #define DEF_FIELDS "AEHIOQTWKNMbcdfgjplrsuvyzX"
354 // Pre-configured field groupss
355 #define JOB_FIELDS "ABcefgjlrstuvyzMKNHIWOPQDX"
356 #define MEM_FIELDS "ANOPQRSTUVbcdefgjlmyzWHIKX"
357 #define USR_FIELDS "ABDECGfhijlopqrstuvyzMKNWX"
358 // Used by fields_sort, placed here for peace-of-mind
359 #define NUL_FIELDS "abcdefghijklmnopqrstuvwxyz"
362 // The default values for the local config file
363 #define DEF_RCFILE { \
364 0, 1, DEF_DELAY, 0, { \
365 { P_CPU, DEF_WINFLGS, 0, \
366 COLOR_RED, COLOR_RED, COLOR_YELLOW, COLOR_RED, \
367 "Def", DEF_FIELDS }, \
368 { P_PID, DEF_WINFLGS, 0, \
369 COLOR_CYAN, COLOR_CYAN, COLOR_WHITE, COLOR_CYAN, \
370 "Job", JOB_FIELDS }, \
371 { P_MEM, DEF_WINFLGS, 0, \
372 COLOR_MAGENTA, COLOR_MAGENTA, COLOR_BLUE, COLOR_MAGENTA, \
373 "Mem", MEM_FIELDS }, \
374 { P_URE, DEF_WINFLGS, 0, \
375 COLOR_YELLOW, COLOR_YELLOW, COLOR_GREEN, COLOR_YELLOW, \
376 "Usr", USR_FIELDS } \
380 // Summary Lines specially formatted string(s) --
381 // see 'show_special' for syntax details + other cautions.
382 #define LOADAV_line "%s -%s\n"
383 #define LOADAV_line_alt "%s\06 -%s\n"
384 #define STATES_line1 "Tasks:\03" \
385 " %3u \02total,\03 %3u \02running,\03 %3u \02sleeping,\03 %3u \02stopped,\03 %3u \02zombie\03\n"
386 #define STATES_line2x4 "%s\03" \
387 " %#5.1f%% \02user,\03 %#5.1f%% \02system,\03 %#5.1f%% \02nice,\03 %#5.1f%% \02idle\03\n"
388 #define STATES_line2x5 "%s\03" \
389 " %#5.1f%% \02user,\03 %#5.1f%% \02system,\03 %#5.1f%% \02nice,\03 %#5.1f%% \02idle,\03 %#5.1f%% \02IO-wait\03\n"
390 #define STATES_line2x6 "%s\03" \
391 " %#4.1f%% \02us,\03 %#4.1f%% \02sy,\03 %#4.1f%% \02ni,\03 %#4.1f%% \02id,\03 %#4.1f%% \02wa,\03 %#4.1f%% \02hi,\03 %#4.1f%% \02si\03\n"
392 #define STATES_line2x7 "%s\03" \
393 "%#5.1f%%\02us,\03%#5.1f%%\02sy,\03%#5.1f%%\02ni,\03%#5.1f%%\02id,\03%#5.1f%%\02wa,\03%#5.1f%%\02hi,\03%#5.1f%%\02si,\03%#5.1f%%\02st\03\n"
395 #define MEMORY_line1 "Mem: \03" \
396 " %8luK \02total,\03 %8luK \02used,\03 %8luK \02free,\03 %8luK \02buffers\03\n"
397 #define MEMORY_line2 "Swap:\03" \
398 " %8luK \02total,\03 %8luK \02used,\03 %8luK \02free,\03 %8luK \02cached\03\n"
400 #define MEMORY_line1 "Mem: \03" \
401 " %8luk \02total,\03 %8luk \02used,\03 %8luk \02free,\03 %8luk \02buffers\03\n"
402 #define MEMORY_line2 "Swap:\03" \
403 " %8luk \02total,\03 %8luk \02used,\03 %8luk \02free,\03 %8luk \02cached\03\n"
406 // Keyboard Help specially formatted string(s) --
407 // see 'show_special' for syntax details + other cautions.
409 "Help for Interactive Commands\02 - %s\n" \
410 "Window \01%s\06: \01Cumulative mode \03%s\02. \01System\06: \01Delay \03%.1f secs\02; \01Secure mode \03%s\02.\n" \
412 " Z\05,\01B\05 Global: '\01Z\02' change color mappings; '\01B\02' disable/enable bold\n" \
413 " l,t,m Toggle Summaries: '\01l\02' load avg; '\01t\02' task/cpu stats; '\01m\02' mem info\n" \
414 " 1,I Toggle SMP view: '\0011\02' single/separate states; '\01I\02' Irix/Solaris mode\n" \
416 " f,o . Fields/Columns: '\01f\02' add or remove; '\01o\02' change display order\n" \
417 " F or O . Select sort field\n" \
418 " <,> . Move sort field: '\01<\02' next col left; '\01>\02' next col right\n" \
419 " R,H . Toggle: '\01R\02' normal/reverse sort; '\01H\02' show threads\n" \
420 " c,i,S . Toggle: '\01c\02' cmd name/line; '\01i\02' idle tasks; '\01S\02' cumulative time\n" \
421 " x\05,\01y\05 . Toggle highlights: '\01x\02' sort field; '\01y\02' running tasks\n" \
422 " z\05,\01b\05 . Toggle: '\01z\02' color/mono; '\01b\02' bold/reverse (only if 'x' or 'y')\n" \
423 " u . Show specific user only\n" \
424 " n or # . Set maximum tasks displayed\n" \
427 " W Write configuration file\n" \
429 " ( commands shown with '.' require a \01visible\02 task display \01window\02 ) \n" \
430 "Press '\01h\02' or '\01?\02' for help with \01Windows\02,\n" \
431 "any other key to continue " \
434 // This guy goes into the help text (maybe)
435 #define KEYS_help_unsecured \
436 " k,r Manipulate tasks: '\01k\02' kill; '\01r\02' renice\n" \
437 " d or s Set update interval\n" \
440 // Fields Reorder/Toggle specially formatted string(s) --
441 // see 'show_special' for syntax details + other cautions
442 // note: the leading newline below serves really dumb terminals;
443 // if there's no 'cursor_home', the screen will be a mess
444 // but this part will still be functional.
445 #define FIELDS_current \
446 "\n%sCurrent Fields\02: \01 %s \04 for window \01%s\06\n%s " \
449 // Some extra explanatory text which accompanies the Fields display.
450 // note: the newlines cannot actually be used, they just serve as
451 // substring delimiters for the 'display_fields' routine.
452 #define FIELDS_xtra \
454 " 0x00000001 PF_ALIGNWARN\n" \
455 " 0x00000002 PF_STARTING\n" \
456 " 0x00000004 PF_EXITING\n" \
457 " 0x00000040 PF_FORKNOEXEC\n" \
458 " 0x00000100 PF_SUPERPRIV\n" \
459 " 0x00000200 PF_DUMPCORE\n" \
460 " 0x00000400 PF_SIGNALED\n" \
461 " 0x00000800 PF_MEMALLOC\n" \
462 " 0x00002000 PF_FREE_PAGES (2.5)\n" \
463 " 0x00008000 debug flag (2.5)\n" \
464 " 0x00024000 special threads (2.5)\n" \
465 " 0x001D0000 special states (2.5)\n" \
466 " 0x00100000 PF_USEDFPU (thru 2.4)\n" \
468 /* no room, sacrificed this one: 'Killed for out-of-memory' */
469 /* " 0x00001000 PF_MEMDIE (2.5)\n" ....................... */
471 // Sort Select specially formatted string(s) --
472 // see 'show_special' for syntax details + other cautions
473 // note: the leading newline below serves really dumb terminals;
474 // if there's no 'cursor_home', the screen will be a mess
475 // but this part will still be functional.
476 #define SORT_fields \
477 "\n%sCurrent Sort Field\02: \01 %c \04 for window \01%s\06\n%s " \
480 // Some extra explanatory text which accompanies the Sort display.
481 // note: the newlines cannot actually be used, they just serve as
482 // substring delimiters for the 'display_fields' routine.
485 " If a selected sort field can't be\n" \
486 " shown due to screen width or your\n" \
487 " field order, the '<' and '>' keys\n" \
488 " will be unavailable until a field\n" \
489 " within viewable range is chosen.\n" \
492 " Field sorting uses internal values,\n" \
493 " not those in column display. Thus,\n" \
494 " the TTY & WCHAN fields will violate\n" \
495 " strict ASCII collating sequence.\n" \
496 " (shame on you if WCHAN is chosen)\n" \
499 // Colors Help specially formatted string(s) --
500 // see 'show_special' for syntax details + other cautions.
502 "Help for color mapping\02 - %s\n" \
503 "current window: \01%s\06\n" \
505 " color - 04:25:44 up 8 days, 50 min, 7 users, load average:\n" \
506 " Tasks:\03 64 \02total,\03 2 \03running,\03 62 \02sleeping,\03 0 \02stopped,\03\n" \
507 " Cpu(s):\03 76.5%% \02user,\03 11.2%% \02system,\03 0.0%% \02nice,\03 12.3%% \02idle\03\n" \
508 " \01 Nasty Message! \04 -or- \01Input Prompt\05\n" \
509 " \01 PID TTY PR NI %%CPU TIME+ VIRT SWAP STA Command \06\n" \
510 " 17284 \10pts/2 \07 8 0 0.0 0:00.75 1380 0 S /bin/bash \10\n" \
511 " \01 8601 pts/1 7 -10 0.4 0:00.03 916 0 R < color -b \07\n" \
512 " 11005 \10? \07 9 0 0.0 0:02.50 2852 1008 S amor -ses \10\n" \
513 " available toggles: \01B\02 =disable bold globally (\01%s\02),\n" \
514 " \01z\02 =color/mono (\01%s\02), \01b\02 =tasks \"bold\"/reverse (\01%s\02)\n" \
516 "Select \01target\02 as upper case letter:\n" \
517 " S\02 = Summary Data,\01 M\02 = Messages/Prompts,\n" \
518 " H\02 = Column Heads,\01 T\02 = Task Information\n" \
519 "Select \01color\02 as number:\n" \
520 " 0\02 = black,\01 1\02 = red, \01 2\02 = green,\01 3\02 = yellow,\n" \
521 " 4\02 = blue, \01 5\02 = magenta,\01 6\02 = cyan, \01 7\02 = white\n" \
523 "Selected: \01target\02 \01 %c \04; \01color\02 \01 %d \04\n" \
524 " press 'q' to abort changes to window '\01%s\02'\n" \
525 " press 'a' or 'w' to commit & change another, <Enter> to commit and end " \
528 // Windows/Field Group Help specially formatted string(s) --
529 // see 'show_special' for syntax details + other cautions.
530 #define WINDOWS_help \
531 "Help for Windows / Field Groups\02 - \"Current Window\" = \01 %s \06\n" \
533 ". Use multiple \01windows\02, each with separate config opts (color,fields,sort,etc)\n" \
534 ". The 'current' window controls the \01Summary Area\02 and responds to your \01Commands\02\n" \
535 " . that window's \01task display\02 can be turned \01Off\02 & \01On\02, growing/shrinking others\n" \
536 " . with \01NO\02 task display, some commands will be \01disabled\02 ('i','R','n','c', etc)\n" \
537 " until a \01different window\02 has been activated, making it the 'current' window\n" \
538 ". You \01change\02 the 'current' window by: \01 1\02) cycling forward/backward;\01 2\02) choosing\n" \
539 " a specific field group; or\01 3\02) exiting the color mapping screen\n" \
540 ". Commands \01available anytime -------------\02\n" \
541 " A . Alternate display mode toggle, show \01Single\02 / \01Multiple\02 windows\n" \
542 " G . Choose another field group and make it 'current', or change now\n" \
543 " by selecting a number from: \01 1\02 =%s;\01 2\02 =%s;\01 3\02 =%s; or\01 4\02 =%s\n" \
544 ". Commands \01requiring\02 '\01A\02' mode\01 -------------\02\n" \
545 " g . Change the \01Name\05 of the 'current' window/field group\n" \
546 " \01*\04 a , w . Cycle through all four windows: '\01a\05' Forward; '\01w\05' Backward\n" \
547 " \01*\04 - , _ . Show/Hide: '\01-\05' \01Current\02 window; '\01_\05' all \01Visible\02/\01Invisible\02\n" \
548 " The screen will be divided evenly between task displays. But you can make\n" \
549 " some \01larger\02 or \01smaller\02, using '\01n\02' and '\01i\02' commands. Then later you could:\n" \
550 " \01*\04 = , + . Rebalance tasks: '\01=\05' \01Current\02 window; '\01+\05' \01Every\02 window\n" \
551 " (this also forces the \01current\02 or \01every\02 window to become visible)\n" \
553 "In '\01A\02' mode, '\01*\04' keys are your \01essential\02 commands. Please try the '\01a\02' and '\01w\02'\n" \
554 "commands plus the 'G' sub-commands NOW. Press <Enter> to make 'Current' " \
558 /*###### For Piece of mind #############################################*/
560 /* just sanity check(s)... */
561 #if USRNAMSIZ < GETBUFSIZ
562 # error "Jeeze, USRNAMSIZ Must NOT be less than GETBUFSIZ !"