/* -*-c-*-
*
- * $Id: pres_curses.c,v 1.1 1999/06/02 16:53:35 mdw Exp $
+ * $Id: pres_curses.c,v 1.6 1999/07/27 14:04:19 mdw Exp $
*
* Curses-based output presentation
*
/*----- Revision history --------------------------------------------------*
*
* $Log: pres_curses.c,v $
- * Revision 1.1 1999/06/02 16:53:35 mdw
- * Initial revision
+ * Revision 1.6 1999/07/27 14:04:19 mdw
+ * (Bug fix) Include the SIGWINCH handler even if `wresize' isn't known.
+ *
+ * Revision 1.5 1999/07/27 12:49:16 mdw
+ * Slight tidying of resizing terminal handling.
+ *
+ * Revision 1.4 1999/07/16 16:52:28 mdw
+ * `wbkdset' doesn't work so well. Use `wbkgd' instead.
+ *
+ * Revision 1.3 1999/07/16 12:49:58 mdw
+ * Improve exit status display. New interface from `doto' project.
+ *
+ * Revision 1.2 1999/06/24 15:51:16 mdw
+ * Fix signal handlers so they don't corrupt `errno'.
+ *
+ * Revision 1.1.1.1 1999/06/02 16:53:35 mdw
+ * Initial import.
*
*/
#ifdef SIGTSTP
static void sig_tstp(int s)
{
+ int e = errno;
endwin();
+ errno = e;
raise(SIGSTOP);
}
#endif
#ifdef SIGTSTP
static void sig_cont(int s)
{
+ int e = errno;
wrefresh(curscr);
+ errno = e;
}
#endif
/* --- @sig_winch@ --- */
-#ifdef HAVE_WRESIZE
+#ifdef SIGWINCH
static void sig_winch(int s)
{
+ int e = errno;
+
+#ifdef HAVE_WRESIZE
cwin *c;
+
endwin();
- refresh();
+ wrefresh(curscr);
sizes();
for (c = cwins; c; c = c->next) {
mvwin(c->w, c->top, 0);
wnoutrefresh(c->s);
}
doupdate();
+#else
+ endwin();
+ wrefresh(curscr);
+#endif
+ errno = e;
}
#endif
scrollok(c->w, TRUE);
leaveok(c->w, TRUE);
leaveok(c->s, TRUE);
- wbkgdset(c->s, A_STANDOUT);
- werase(c->s);
- mvwprintw(c->s, 0, 0, " %s [running]\n", c->e->arch);
+ wbkgd(c->s, A_STANDOUT);
+ mvwprintw(c->s, 0, 0, " %s [running]\n", c->e->arch);
wnoutrefresh(c->w);
wnoutrefresh(c->s);
}
doupdate();
-#ifdef HAVE_WRESIZE
+#ifdef SIGWINCH
signal(SIGWINCH, sig_winch);
#endif
#ifdef SIGTSTP
/* --- @curses_close@ --- */
-void curses_close(archent *e, int ok)
+void curses_close(archent *e, int ok, const char *summ)
{
cwin *c = e->pres;
- mvwprintw(c->s, 0, 0, " %s [%s]\n", e->arch, ok ? "finished" : "failed");
+ mvwprintw(c->s, 0, 0, " %s [%s]\n", e->arch, summ);
wrefresh(c->s);
}