[BACK]Return to display.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / top

Diff for /src/usr.bin/top/display.c between version 1.11 and 1.12

version 1.11, 2002/07/15 17:20:36 version 1.12, 2003/06/12 22:30:23
Line 105 
Line 105 
 static void summary_format();  static void summary_format();
 static void line_update();  static void line_update();
   
 int display_resize()  int
   display_resize(void)
 {  {
     int display_lines;      int display_lines;
   
Line 142 
Line 142 
     return(smart_terminal ? display_lines : Largest);      return(smart_terminal ? display_lines : Largest);
 }  }
   
 int display_init(statics)  int
   display_init(struct statics *statics)
 struct statics *statics;  
   
 {  {
     int display_lines;      int display_lines;
     char **pp;      char **pp;
Line 190 
Line 188 
     return(display_lines);      return(display_lines);
 }  }
   
 void i_loadave(mpid, avenrun)  void
   i_loadave(pid_t mpid, double *avenrun)
 pid_t mpid;  
 double *avenrun;  
   
 {  {
     int i;      int i;
   
Line 218 
Line 213 
     lmpid = mpid;      lmpid = mpid;
 }  }
   
 void u_loadave(mpid, avenrun)  void
   u_loadave(pid_t mpid, double *avenrun)
 pid_t mpid;  
 double *avenrun;  
   
 {  {
     int i;      int i;
   
Line 257 
Line 249 
     }      }
 }  }
   
 void i_timeofday(tod)  void
   i_timeofday(time_t *tod)
 time_t *tod;  
   
 {  {
     /*      /*
      *  Display the current time.       *  Display the current time.
Line 304 
Line 294 
  *                lastline is valid   *                lastline is valid
  */   */
   
 void i_procstates(total, brkdn)  void
   i_procstates(int total, int *brkdn)
 int total;  
 int *brkdn;  
   
 {  {
     int i;      int i;
   
Line 333 
Line 320 
     memcpy(lprocstates, brkdn, num_procstates * sizeof(int));      memcpy(lprocstates, brkdn, num_procstates * sizeof(int));
 }  }
   
 void u_procstates(total, brkdn)  void
   u_procstates(int total, int *brkdn)
 int total;  
 int *brkdn;  
   
 {  {
     static char new[128];      static char new[128];
     int i;      int i;
Line 393 
Line 377 
   
 /* cpustates_tag() calculates the correct tag to use to label the line */  /* cpustates_tag() calculates the correct tag to use to label the line */
   
 static char *cpustates_tag()  static char *
   cpustates_tag(void)
 {  {
     char *use;      char *use;
   
Line 417 
Line 401 
     return(use);      return(use);
 }  }
   
 void i_cpustates(states)  void
   i_cpustates(int *states)
 int *states;  
   
 {  {
     int i = 0;      int i = 0;
     int value;      int value;
Line 451 
Line 433 
     memcpy(lcpustates, states, num_cpustates * sizeof(int));      memcpy(lcpustates, states, num_cpustates * sizeof(int));
 }  }
   
 void u_cpustates(states)  void
   u_cpustates(int *states)
 int *states;  
   
 {  {
     int value;      int value;
     char **names = cpustate_names;      char **names = cpustate_names;
Line 498 
Line 478 
     }      }
 }  }
   
 void z_cpustates()  void
   z_cpustates(void)
 {  {
     int i = 0;      int i = 0;
     char **names = cpustate_names;      char **names = cpustate_names;
Line 536 
Line 516 
   
 static char memory_buffer[MAX_COLS];  static char memory_buffer[MAX_COLS];
   
 void i_memory(stats)  void
   i_memory(int *stats)
 int *stats;  
   
 {  {
     if (fputs("\nMemory: ", stdout) == EOF)      if (fputs("\nMemory: ", stdout) == EOF)
         exit(1);          exit(1);
Line 551 
Line 529 
         exit(1);          exit(1);
 }  }
   
 void u_memory(stats)  void
   u_memory(int *stats)
 int *stats;  
   
 {  {
     static char new[MAX_COLS];      static char new[MAX_COLS];
   
Line 582 
Line 558 
 /* Invariant: msglen is always the length of the message currently displayed  /* Invariant: msglen is always the length of the message currently displayed
    on the screen (even when next_msg doesn't contain that message). */     on the screen (even when next_msg doesn't contain that message). */
   
 void i_message()  void
   i_message(void)
 {  {
     while (lastline < y_message)      while (lastline < y_message)
     {      {
Line 604 
Line 580 
     }      }
 }  }
   
 void u_message()  void
   u_message(void)
 {  {
     i_message();      i_message();
 }  }
Line 618 
Line 594 
  *  Assumptions:  cursor is on the previous line and lastline is consistent   *  Assumptions:  cursor is on the previous line and lastline is consistent
  */   */
   
 void i_header(text)  void
   i_header(char *text)
 char *text;  
   
 {  {
     header_length = strlen(text);      header_length = strlen(text);
     if (header_status == ON)      if (header_status == ON)
Line 639 
Line 613 
 }  }
   
 /*ARGSUSED*/  /*ARGSUSED*/
 void u_header(text)  void
   u_header(char *text)
 char *text;             /* ignored */  
   
 {  {
     if (header_status == ERASE)      if (header_status == ERASE)
     {      {
Line 660 
Line 632 
  *  Assumptions:  lastline is consistent   *  Assumptions:  lastline is consistent
  */   */
   
 void i_process(line, thisline)  void
   i_process(int line, char *thisline)
 int line;  
 char *thisline;  
   
 {  {
     char *p;      char *p;
     char *base;      char *base;
Line 692 
Line 661 
     memset(p, 0, display_width - (p - base));      memset(p, 0, display_width - (p - base));
 }  }
   
 void u_process(linenum, linebuf)  void
   u_process(int linenum, char *linebuf)
 int linenum;  
 char *linebuf;  
   
 {  {
     char *optr;      char *optr;
     int screen_line = linenum + Header_lines;      int screen_line = linenum + Header_lines;
Line 741 
Line 707 
     }      }
 }  }
   
 void u_endscreen(hi)  void
   u_endscreen(int hi)
 int hi;  
   
 {  {
     int screen_line = hi + Header_lines;      int screen_line = hi + Header_lines;
     int i;      int i;
Line 804 
Line 768 
     }      }
 }  }
   
 void display_header(t)  void
   display_header(int t)
 int t;  
   
 {  {
     if (t)      if (t)
     {      {
Line 820 
Line 782 
 }  }
   
 /*VARARGS2*/  /*VARARGS2*/
 void new_message(type, msgfmt, a1, a2, a3)  void
   new_message(int type, char *msgfmt, caddr_t a1, caddr_t a2, caddr_t a3)
 int type;  
 char *msgfmt;  
 caddr_t a1, a2, a3;  
   
 {  {
     int i;      int i;
   
Line 869 
Line 827 
     }      }
 }  }
   
 void clear_message()  void
   clear_message(void)
 {  {
     if (clear_eol(msglen) == 1)      if (clear_eol(msglen) == 1)
     {      {
Line 879 
Line 837 
     }      }
 }  }
   
 int readline(buffer, size, numeric)  int
   readline(char *buffer, int size, int numeric)
 char *buffer;  
 int  size;  
 int  numeric;  
   
 {  {
     char *ptr = buffer;      char *ptr = buffer;
     char ch;      char ch;
Line 972 
Line 926 
   
 /* internal support routines */  /* internal support routines */
   
 static int string_count(pp)  static int
   string_count(char **pp)
 char **pp;  
   
 {  {
     int cnt;      int cnt;
   
Line 987 
Line 939 
     return(cnt);      return(cnt);
 }  }
   
 static void summary_format(str, numbers, names)  static void
   summary_format(char *str, int *numbers, char **names)
 char *str;  
 int *numbers;  
 char **names;  
   
 {  {
     char *p;      char *p;
     int num;      int num;
Line 1038 
Line 986 
     }      }
 }  }
   
 static void line_update(old, new, start, line)  static void
   line_update(char *old, char *new, int start, int line)
 char *old;  
 char *new;  
 int start;  
 int line;  
   
 {  {
     int ch;      int ch;
     int diff;      int diff;
Line 1168 
Line 1111 
  *      to the original buffer is returned.   *      to the original buffer is returned.
  */   */
   
 char *printable(str)  char *
   printable(char *str)
 char *str;  
   
 {  {
     char *ptr;      char *ptr;
     char ch;      char ch;

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12