dep-summary.cc File Reference

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

int main (int argc, char **argv)

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 13 of file dep-summary.cc.

References exit().

00013                                 {
00014   char buff[1024];
00015   FILE *fp;
00016   if ( argc < 2 ) {
00017     fprintf(stderr, "No filename provided.\n");
00018     fprintf(stderr, "Usage: %s [filename]\n", argv[0]);
00019     exit(1);
00020   }    
00021   if (!(fp = fopen(argv[1], "r"))) {
00022     fprintf(stderr, "Can not open file %s for read.\n", argv[1]);
00023     fprintf(stderr, "Usage: %s [filename]\n", argv[0]);
00024     exit(1);
00025   }
00026   while (fgets(buff, 1024, fp)) {
00027     /* Flag the things I don't want reported... */
00028     if (strstr(buff, "Error") || 
00029         strstr(buff, "ERROR") || 
00030         strstr(buff, "error") ||
00031         strstr(buff, "No such")) {
00032       continue;
00033     }
00034     else {
00035       /* Print the rest */
00036       printf("%s",buff);
00037     }
00038   }
00039   fclose(fp);
00040   return 0;
00041 }


Generated on 3 Oct 2018 for loon by  doxygen 1.6.1