=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/top/display.c,v retrieving revision 1.11 retrieving revision 1.12 diff -c -r1.11 -r1.12 *** src/usr.bin/top/display.c 2002/07/15 17:20:36 1.11 --- src/usr.bin/top/display.c 2003/06/12 22:30:23 1.12 *************** *** 1,4 **** ! /* $OpenBSD: display.c,v 1.11 2002/07/15 17:20:36 deraadt Exp $ */ /* * Top users/processes display for Unix --- 1,4 ---- ! /* $OpenBSD: display.c,v 1.12 2003/06/12 22:30:23 pvalchev Exp $ */ /* * Top users/processes display for Unix *************** *** 105,112 **** static void summary_format(); static void line_update(); ! int display_resize() ! { int display_lines; --- 105,112 ---- static void summary_format(); static void line_update(); ! int ! display_resize(void) { int display_lines; *************** *** 142,151 **** return(smart_terminal ? display_lines : Largest); } ! int display_init(statics) ! ! struct statics *statics; ! { int display_lines; char **pp; --- 142,149 ---- return(smart_terminal ? display_lines : Largest); } ! int ! display_init(struct statics *statics) { int display_lines; char **pp; *************** *** 190,200 **** return(display_lines); } ! void i_loadave(mpid, avenrun) ! ! pid_t mpid; ! double *avenrun; ! { int i; --- 188,195 ---- return(display_lines); } ! void ! i_loadave(pid_t mpid, double *avenrun) { int i; *************** *** 218,228 **** lmpid = mpid; } ! void u_loadave(mpid, avenrun) ! ! pid_t mpid; ! double *avenrun; ! { int i; --- 213,220 ---- lmpid = mpid; } ! void ! u_loadave(pid_t mpid, double *avenrun) { int i; *************** *** 257,266 **** } } ! void i_timeofday(tod) ! ! time_t *tod; ! { /* * Display the current time. --- 249,256 ---- } } ! void ! i_timeofday(time_t *tod) { /* * Display the current time. *************** *** 304,314 **** * lastline is valid */ ! void i_procstates(total, brkdn) ! ! int total; ! int *brkdn; ! { int i; --- 294,301 ---- * lastline is valid */ ! void ! i_procstates(int total, int *brkdn) { int i; *************** *** 333,343 **** memcpy(lprocstates, brkdn, num_procstates * sizeof(int)); } ! void u_procstates(total, brkdn) ! ! int total; ! int *brkdn; ! { static char new[128]; int i; --- 320,327 ---- memcpy(lprocstates, brkdn, num_procstates * sizeof(int)); } ! void ! u_procstates(int total, int *brkdn) { static char new[128]; int i; *************** *** 393,400 **** /* cpustates_tag() calculates the correct tag to use to label the line */ ! static char *cpustates_tag() ! { char *use; --- 377,384 ---- /* cpustates_tag() calculates the correct tag to use to label the line */ ! static char * ! cpustates_tag(void) { char *use; *************** *** 417,426 **** return(use); } ! void i_cpustates(states) ! ! int *states; ! { int i = 0; int value; --- 401,408 ---- return(use); } ! void ! i_cpustates(int *states) { int i = 0; int value; *************** *** 451,460 **** memcpy(lcpustates, states, num_cpustates * sizeof(int)); } ! void u_cpustates(states) ! ! int *states; ! { int value; char **names = cpustate_names; --- 433,440 ---- memcpy(lcpustates, states, num_cpustates * sizeof(int)); } ! void ! u_cpustates(int *states) { int value; char **names = cpustate_names; *************** *** 498,505 **** } } ! void z_cpustates() ! { int i = 0; char **names = cpustate_names; --- 478,485 ---- } } ! void ! z_cpustates(void) { int i = 0; char **names = cpustate_names; *************** *** 536,545 **** static char memory_buffer[MAX_COLS]; ! void i_memory(stats) ! ! int *stats; ! { if (fputs("\nMemory: ", stdout) == EOF) exit(1); --- 516,523 ---- static char memory_buffer[MAX_COLS]; ! void ! i_memory(int *stats) { if (fputs("\nMemory: ", stdout) == EOF) exit(1); *************** *** 551,560 **** exit(1); } ! void u_memory(stats) ! ! int *stats; ! { static char new[MAX_COLS]; --- 529,536 ---- exit(1); } ! void ! u_memory(int *stats) { static char new[MAX_COLS]; *************** *** 582,589 **** /* Invariant: msglen is always the length of the message currently displayed on the screen (even when next_msg doesn't contain that message). */ ! void i_message() ! { while (lastline < y_message) { --- 558,565 ---- /* Invariant: msglen is always the length of the message currently displayed on the screen (even when next_msg doesn't contain that message). */ ! void ! i_message(void) { while (lastline < y_message) { *************** *** 604,611 **** } } ! void u_message() ! { i_message(); } --- 580,587 ---- } } ! void ! u_message(void) { i_message(); } *************** *** 618,627 **** * Assumptions: cursor is on the previous line and lastline is consistent */ ! void i_header(text) ! ! char *text; ! { header_length = strlen(text); if (header_status == ON) --- 594,601 ---- * Assumptions: cursor is on the previous line and lastline is consistent */ ! void ! i_header(char *text) { header_length = strlen(text); if (header_status == ON) *************** *** 639,648 **** } /*ARGSUSED*/ ! void u_header(text) ! ! char *text; /* ignored */ ! { if (header_status == ERASE) { --- 613,620 ---- } /*ARGSUSED*/ ! void ! u_header(char *text) { if (header_status == ERASE) { *************** *** 660,670 **** * Assumptions: lastline is consistent */ ! void i_process(line, thisline) ! ! int line; ! char *thisline; ! { char *p; char *base; --- 632,639 ---- * Assumptions: lastline is consistent */ ! void ! i_process(int line, char *thisline) { char *p; char *base; *************** *** 692,702 **** memset(p, 0, display_width - (p - base)); } ! void u_process(linenum, linebuf) ! ! int linenum; ! char *linebuf; ! { char *optr; int screen_line = linenum + Header_lines; --- 661,668 ---- memset(p, 0, display_width - (p - base)); } ! void ! u_process(int linenum, char *linebuf) { char *optr; int screen_line = linenum + Header_lines; *************** *** 741,750 **** } } ! void u_endscreen(hi) ! ! int hi; ! { int screen_line = hi + Header_lines; int i; --- 707,714 ---- } } ! void ! u_endscreen(int hi) { int screen_line = hi + Header_lines; int i; *************** *** 804,813 **** } } ! void display_header(t) ! ! int t; ! { if (t) { --- 768,775 ---- } } ! void ! display_header(int t) { if (t) { *************** *** 820,831 **** } /*VARARGS2*/ ! void new_message(type, msgfmt, a1, a2, a3) ! ! int type; ! char *msgfmt; ! caddr_t a1, a2, a3; ! { int i; --- 782,789 ---- } /*VARARGS2*/ ! void ! new_message(int type, char *msgfmt, caddr_t a1, caddr_t a2, caddr_t a3) { int i; *************** *** 869,876 **** } } ! void clear_message() ! { if (clear_eol(msglen) == 1) { --- 827,834 ---- } } ! void ! clear_message(void) { if (clear_eol(msglen) == 1) { *************** *** 879,890 **** } } ! int readline(buffer, size, numeric) ! ! char *buffer; ! int size; ! int numeric; ! { char *ptr = buffer; char ch; --- 837,844 ---- } } ! int ! readline(char *buffer, int size, int numeric) { char *ptr = buffer; char ch; *************** *** 972,981 **** /* internal support routines */ ! static int string_count(pp) ! ! char **pp; ! { int cnt; --- 926,933 ---- /* internal support routines */ ! static int ! string_count(char **pp) { int cnt; *************** *** 987,998 **** return(cnt); } ! static void summary_format(str, numbers, names) ! ! char *str; ! int *numbers; ! char **names; ! { char *p; int num; --- 939,946 ---- return(cnt); } ! static void ! summary_format(char *str, int *numbers, char **names) { char *p; int num; *************** *** 1038,1050 **** } } ! static void line_update(old, new, start, line) ! ! char *old; ! char *new; ! int start; ! int line; ! { int ch; int diff; --- 986,993 ---- } } ! static void ! line_update(char *old, char *new, int start, int line) { int ch; int diff; *************** *** 1168,1177 **** * to the original buffer is returned. */ ! char *printable(str) ! ! char *str; ! { char *ptr; char ch; --- 1111,1118 ---- * to the original buffer is returned. */ ! char * ! printable(char *str) { char *ptr; char ch;