Index: head/contrib/top/display.c =================================================================== --- head/contrib/top/display.c +++ head/contrib/top/display.c @@ -32,7 +32,9 @@ #include +#include #include +#include #include #include @@ -255,7 +257,7 @@ register int i; /* i_loadave also clears the screen, since it is first */ - clear(); + top_clear(); /* mpid == -1 implies this system doesn't have an _mpid */ if (mpid != -1) @@ -796,7 +798,7 @@ } if (next_msg[0] != '\0') { - standout(next_msg); + top_standout(next_msg); msglen = strlen(next_msg); next_msg[0] = '\0'; } @@ -1076,7 +1078,7 @@ i = strlen(next_msg); if ((type & MT_delayed) == 0) { - type & MT_standout ? standout(next_msg) : + type & MT_standout ? top_standout(next_msg) : fputs(next_msg, stdout); (void) clear_eol(msglen - i); msglen = i; @@ -1088,7 +1090,7 @@ { if ((type & MT_delayed) == 0) { - type & MT_standout ? standout(next_msg) : fputs(next_msg, stdout); + type & MT_standout ? top_standout(next_msg) : fputs(next_msg, stdout); msglen = strlen(next_msg); next_msg[0] = '\0'; } Index: head/contrib/top/screen.h =================================================================== --- head/contrib/top/screen.h +++ head/contrib/top/screen.h @@ -28,10 +28,10 @@ extern int screen_width; /* a function that puts a single character on stdout */ -void putstdout(char ch); +int putstdout(int ch); int clear_eol(int len); -void standout(char *msg); -void clear(void); +void top_standout(char *msg); +void top_clear(void); void go_home(void); void reinit_screen(void); void get_screensize(void); Index: head/contrib/top/screen.c =================================================================== --- head/contrib/top/screen.c +++ head/contrib/top/screen.c @@ -45,6 +45,8 @@ # endif # endif #endif +#include +#include #include "screen.h" #include "boolean.h" @@ -432,10 +434,7 @@ } void -standout(msg) - -char *msg; - +top_standout(char *msg) { if (smart_terminal) { @@ -450,8 +449,7 @@ } void -clear() - +top_clear() { if (smart_terminal) { @@ -460,10 +458,7 @@ } int -clear_eol(len) - -int len; - +clear_eol(int len) { if (smart_terminal && !overstrike && len > 0) { @@ -496,12 +491,8 @@ /* This has to be defined as a subroutine for tputs (instead of a macro) */ -void -putstdout(ch) - -char ch; - +int +putstdout(int ch) { - putchar(ch); + return putchar(ch); } - Index: head/contrib/top/top.c =================================================================== --- head/contrib/top/top.c +++ head/contrib/top/top.c @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -79,7 +80,7 @@ sigret_t leave(); sigret_t tstop(); #ifdef SIGWINCH -sigret_t winch(); +sigret_t top_winch(int); #endif volatile sig_atomic_t leaveflag; @@ -682,7 +683,7 @@ (void) signal(SIGQUIT, leave); (void) signal(SIGTSTP, tstop); #ifdef SIGWINCH - (void) signal(SIGWINCH, winch); + (void) signal(SIGWINCH, top_winch); #endif #ifdef SIGRELSE sigrelse(SIGINT); @@ -897,7 +898,7 @@ max_topn = display_resize(); /* reset the signal handler */ - (void) signal(SIGWINCH, winch); + (void) signal(SIGWINCH, top_winch); reset_display(); winchflag = 0; @@ -971,9 +972,9 @@ case CMD_help1: /* help */ case CMD_help2: reset_display(); - clear(); + top_clear(); show_help(); - standout("Hit any key to continue: "); + top_standout("Hit any key to continue: "); fflush(stdout); (void) read(0, &ch, 1); break; @@ -989,9 +990,9 @@ else { reset_display(); - clear(); + top_clear(); show_errors(); - standout("Hit any key to continue: "); + top_standout("Hit any key to continue: "); fflush(stdout); (void) read(0, &ch, 1); } @@ -1300,10 +1301,7 @@ } #ifdef SIGWINCH -sigret_t winch(i) /* SIGWINCH handler */ - -int i; - +sigret_t top_winch(int i) /* SIGWINCH handler */ { winchflag = 1; }