home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / dos_ency / 14 / protoc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-11  |  684 b   |  30 lines

  1. /*
  2.         PROTOC.C: a template for a character-oriented filter.
  3.  
  4.         Ray Duncan, June 1987
  5. */
  6.  
  7. #include <stdio.h>
  8.  
  9. main(argc,argv)
  10. int argc;
  11. char *argv[];
  12. {       char ch;
  13.  
  14.         while ( (ch=getchar())!=EOF )   /* read a character */  
  15.         {       ch=translate(ch);       /* translate it if necessary */
  16.                 putchar(ch);            /* write the character */
  17.         }       
  18.         exit(0);                        /* terminate at end of file */
  19. }
  20.  
  21. /*
  22.         Perform any necessary translation on character from
  23.         input file.  Template action just returns same character.
  24. */
  25.  
  26. int translate(ch)
  27. char ch;
  28. {       return (ch);
  29. }
  30.