home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / communic / ansi_bbs / sample.c < prev   
Encoding:
C/C++ Source or Header  |  1992-01-05  |  465 b   |  27 lines

  1. #include <stdio.h>
  2. #include <ansi.h>
  3.  
  4. main(int argc, char **argv)
  5. {
  6.    FILE *fp;
  7.    char ch;
  8.    int test = 0;
  9.    fast_video = 1;
  10.  
  11.    if ((fp = fopen(argv[1], "r")) != NULL)
  12.    {
  13.       while (!feof(fp))
  14.       {
  15.          ch = fgetc(fp);
  16.          if (ch == 0x1b || test > 0)
  17.          {
  18.             test = ansi_cmd(ch);
  19.          }
  20.          else
  21.             write_char(ch, attr.color);
  22.       }
  23.    }
  24.    else
  25.       puts("Can't find the file");
  26. }
  27.