home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wfdos.zip / BCC2WF.C next >
Text File  |  1995-04-17  |  666b  |  28 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. static char buffer[255], file[255];
  6.  
  7. void main( void )
  8. {
  9.    char ind[10], *offs;
  10.    int linenum;
  11.  
  12.    fputs("BCC2WF Filter (c) Per Jessen, 1995.\n", stdout);
  13.    while (fgets(buffer,255,stdin)!=NULL)
  14.    {
  15.       linenum=-1;
  16.       sscanf( buffer, "%10s %255s %d:", ind, file, &linenum );
  17.       if ( linenum>0 )
  18.       {
  19.         offs=strchr(buffer, ':');
  20.  
  21.         if ( stricmp("WARNING",ind)==0 || stricmp("ERROR",ind)==0 )
  22.           fprintf(stdout, "%s(%d) : %s: %s", file, linenum, ind, offs+2 );
  23.         else fputs(buffer,stdout);
  24.       }
  25.       else   fputs(buffer,stdout);
  26.    }
  27. }
  28.