and/or that are simply more efficiently handled as globals
[ 'Frames_...' (plural) stuff persists beyond 1 frame ]
[ or are used in response to async signals received ! ] */
-static volatile int Frames_resize; // time to rebuild all column headers
+static volatile int Frames_signal; // time to rebuild all column headers
static int Frames_libflags; // PROC_FILLxxx flags
static int Frame_maxtask; // last known number of active tasks
// ie. current 'size' of proc table
at_eoj(); // restore tty in preparation for exit
#ifdef ATEOJ_RPTSTD
{ proc_t *p;
- if (!str && Ttychanged) { fprintf(stderr,
+ if (!str && !Frames_signal && Ttychanged) { fprintf(stderr,
"\n%s's Summary report:"
"\n\tProgram"
"\n\t Linux version = %u.%u.%u, %s"
#ifndef OFF_HST_HASH
#ifdef ATEOJ_RPTHSH
- if (!str && Ttychanged) {
+ if (!str && !Frames_signal && Ttychanged) {
int i, j, pop, total_occupied, maxdepth, maxdepth_sav, numdepth
, cross_foot, sz = HHASH_SIZ * (unsigned)sizeof(int);
int depths[HHASH_SIZ];
// POSIX.1-2004 async-signal-safe: sigfillset, sigprocmask
sigfillset(&ss);
sigprocmask(SIG_BLOCK, &ss, NULL);
+ Frames_signal = BREAK_sig;
bye_bye(NULL);
(void)dont_care_sig;
} // end: sig_endpgm
#endif
if (keypad_xmit) putp(keypad_xmit);
putp(Cursor_state);
- Frames_resize = RESIZ_sig;
+ Frames_signal = BREAK_sig;
(void)dont_care_sig;
} // end: sig_paused
static void sig_resize (int dont_care_sig) {
// POSIX.1-2004 async-signal-safe: tcdrain
tcdrain(STDOUT_FILENO);
- Frames_resize = RESIZ_sig;
+ Frames_signal = BREAK_sig;
(void)dont_care_sig;
} // end: sig_resize
\f
FD_ZERO(&fs);
FD_SET(STDIN_FILENO, &fs);
-#ifndef SIGNALS_LESS // conditional comments are silly, but help in documenting
- // hold here until we've got keyboard input, any signal (including SIGWINCH)
-#else
+#ifdef SIGNALS_LESS // conditional comments are silly, but help in documenting
// hold here until we've got keyboard input, any signal except SIGWINCH
-#endif
// or (optionally) we timeout with nanosecond granularity
+#else
+ // hold here until we've got keyboard input, any signal (including SIGWINCH)
+ // or (optionally) we timeout with nanosecond granularity
+#endif
rc = pselect(STDIN_FILENO + 1, &fs, NULL, NULL, ts, &Sigwinch_set);
if (rc < 0) rc = 0;
float f;
line = ioline(prompt);
- if (!line[0] || Frames_resize) return -1.0;
+ if (!line[0] || Frames_signal) return -1.0;
// note: we're not allowing negative floats
if (strcspn(line, "+,.0123456789")) {
show_msg(N_txt(BAD_numfloat_txt));
int n;
line = ioline(prompt);
- if (Frames_resize) return GET_INT_BAD;
+ if (Frames_signal) return GET_INT_BAD;
if (!line[0]) return GET_INTNONE;
// note: we've got to allow negative ints (renice)
if (strcspn(line, "-+0123456789")) {
PSU_CLREOS(0);
fflush(stdout);
- Frames_resize = RESIZ_clr;
+ Frames_signal = BREAK_off;
} // end: adj_geometry
display_fields(i, (p != NULL));
fflush(stdout);
- if (Frames_resize) goto signify_that;
+ if (Frames_signal) goto signify_that;
key = iokey(1);
if (key < 1) goto signify_that;
lest repeated <Enter> keys produce immediate re-selection in caller */
tcflush(STDIN_FILENO, TCIFLUSH);
- if (Frames_resize) goto signify_that;
+ if (Frames_signal) goto signify_that;
key = iokey(1);
if (key < 1) goto signify_that;
, pid, p->cmd, p->euser, sels));
INSP_MKSL(0, " ");
- if (Frames_resize) goto signify_that;
+ if (Frames_signal) goto signify_that;
if (key == INT_MAX) key = iokey(1);
if (key < 1) goto signify_that;
putp(Cap_clr_eos);
fflush(stdout);
- if (Frames_resize) goto signify_that;
+ if (Frames_signal) goto signify_that;
key = iokey(1);
if (key < 1) goto signify_that;
putp(Cap_clr_eos);
fflush(stdout);
- if (Frames_resize) goto signify_that;
+ if (Frames_signal) goto signify_that;
key = iokey(1);
if (key < 1) goto signify_that;
, Winstk[2].rc.winname, Winstk[3].rc.winname));
putp(Cap_clr_eos);
fflush(stdout);
- if (Frames_resize || (key = iokey(1)) < 1) {
+ if (Frames_signal || (key = iokey(1)) < 1) {
adj_geometry();
putp(Cap_clr_scr);
} else w = win_select(key);
if (0 > pid) pid = def;
str = ioline(fmtmk(N_fmt(GET_sigs_num_fmt), pid, SIGTERM));
if (*str) sig = signal_name_to_number(str);
- if (Frames_resize) break;
+ if (Frames_signal) break;
if (0 < sig && kill(pid, sig))
show_msg(fmtmk(N_fmt(FAIL_signals_fmt)
, pid, sig, strerror(errno)));
for (i = 0; i < MAXTBL(key_tab); ++i)
if (strchr(key_tab[i].keys, ch)) {
key_tab[i].func(ch);
- Frames_resize = RESIZ_kbd;
+ Frames_signal = BREAK_kbd;
putp((Cursor_state = Cap_curs_hide));
return;
}
};
- /* Frames_resize above will force a rebuild of all column headers and
+ /* Frames_signal above will force a rebuild of all column headers and
the PROC_FILLxxx flags. It's NOT simply lazy programming. Here are
some keys that COULD require new column headers and/or libproc flags:
'A' - likely
int i, scrlins;
// deal with potential signal(s) since the last time around...
- if (Frames_resize)
+ if (Frames_signal)
zap_fieldstab();
// whoa either first time or thread/task mode change, (re)prime the pump...
produce a screen refresh. in this main loop frame_make
assumes responsibility for such refreshes. other logic
in contact with users must deal more obliquely with an
- interrupt/refresh (hint: Frames_resize + return code)!
+ interrupt/refresh (hint: Frames_signal + return code)!
(everything is perfectly justified plus right margins)
(are completely filled, but of course it must be luck)