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

Diff for /src/usr.bin/size/Attic/size.c between version 1.5 and 1.6

version 1.5, 1997/01/15 23:43:13 version 1.6, 1997/01/28 07:12:27
Line 57 
Line 57 
 #include <stdio.h>  #include <stdio.h>
 #include <err.h>  #include <err.h>
   
   unsigned long total_text, total_data, total_bss, total_total;
 int ignore_bad_archive_entries = 1;  int ignore_bad_archive_entries = 1;
   int print_totals = 0;
   
 int     process_file __P((int, char *));  int     process_file __P((int, char *));
 int     show_archive __P((int, char *, FILE *));  int     show_archive __P((int, char *, FILE *));
Line 73 
Line 75 
 {  {
         int ch, eval;          int ch, eval;
   
         while ((ch = getopt(argc, argv, "w")) != -1)          while ((ch = getopt(argc, argv, "wt")) != -1)
                 switch(ch) {                  switch(ch) {
                 case 'w':                  case 'w':
                         ignore_bad_archive_entries = 0;                          ignore_bad_archive_entries = 0;
                         break;                          break;
                   case 't':
                           print_totals = 1;
                           break;
                 case '?':                  case '?':
                 default:                  default:
                         usage();                          usage();
Line 92 
Line 97 
                 } while (*++argv);                  } while (*++argv);
         else          else
                 eval |= process_file(1, "a.out");                  eval |= process_file(1, "a.out");
   
           if (print_totals)
                   (void)printf("\n%lu\t%lu\t%lu\t%lu\t%lx\tTOTAL\n",
                       total_text, total_data, total_bss,
                       total_total, total_total);
         exit(eval);          exit(eval);
 }  }
   
Line 109 
Line 119 
         FILE *fp;          FILE *fp;
         int retval;          int retval;
         char magic[SARMAG];          char magic[SARMAG];
   
         if (!(fp = fopen(fname, "r"))) {          if (!(fp = fopen(fname, "r"))) {
                 warnx("cannot read %s", fname);                  warnx("cannot read %s", fname);
                 return(1);                  return(1);
Line 293 
Line 303 
             head.a_bss, total, total);              head.a_bss, total, total);
         if (count > 1)          if (count > 1)
                 (void)printf("\t%s", name);                  (void)printf("\t%s", name);
   
           total_text += head.a_text;
           total_data += head.a_data;
           total_bss += head.a_bss;
           total_total += total;
   
         (void)printf("\n");          (void)printf("\n");
         return (0);          return (0);
 }  }

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6