home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / TOSS.ZIP / TOSS.C
C/C++ Source or Header  |  1993-02-21  |  1KB  |  45 lines

  1. /******************************************************************************
  2. *
  3. *           Module Name: TOSS.C
  4. *        Classification: Unclassified
  5. *               Version: 1.0
  6. *
  7. *           Environment: IBM OS/2 2.0+
  8. *              Compiler: IBM C-Set/2 1.0 /O+
  9. *
  10. *               Purpose: A filter which deletes lines containing any of the 
  11. *                        text passed as command line parameters to this
  12. *                        routine
  13. *
  14. *               Example: icc /Kb xyz.c | toss EDC01234 EDC4321 > xyz.err
  15. *                        this will remove all lines containing the text
  16. *                        "EDC001234" and EDC4321" from the stream.
  17. *
  18. * -- change activity log --
  19. * Ver.  Date     AUTH    Loc.  -  Change
  20. *
  21. * 1.0   92/01/11  IA     10    - program created.
  22. ******************************************************************************/
  23.  
  24. #include <stdlib.h>
  25. #include <stdio.h>
  26. #include <string.h>
  27.  
  28. int main(int argc, char *argv[]);
  29. char line_buff[32768];      /* 32K line length should be enough */
  30.  
  31. int main(int argc, char *argv[])
  32. {
  33.    register int i;  /* use register to enforce no taking the address of i */
  34.  
  35.    while (gets(line_buff)) {
  36.       for (i = 1; i < argc ; i++)
  37.          if (!strstr(line_buff, argv[i]))
  38.             puts(line_buff);
  39.          else
  40.             break;
  41.    } /* endwhile */
  42.    return 0;
  43. }
  44.  
  45.