home *** CD-ROM | disk | FTP | other *** search
/ messroms.de / 2007-01-13_www.messroms.de.zip / VZ200 / TOOLS / ZCCSRC.ZIP / scc / error.c < prev    next >
C/C++ Source or Header  |  2000-03-01  |  606b  |  48 lines

  1. /*    File error.c: 2.1 (83/03/20,16:02:00) */
  2. /*% cc -O -c %
  3.  *
  4.  */
  5.  
  6. #include <stdio.h>
  7. #include "defs.h"
  8. #include "data.h"
  9. #include "proto.h"
  10.  
  11. void error(char *ptr)
  12. {
  13.     FILE *tempfile;
  14.  
  15.     tempfile = output;
  16.     output = stdout;
  17.     doerror(ptr);
  18.     output = tempfile;
  19.     doerror(ptr);
  20.     errcnt++;
  21. }
  22.  
  23. void doerror(char *ptr)
  24. {
  25.     int k;
  26.  
  27.     comment();
  28.     outstr(line);
  29.     nl();
  30.     comment();
  31.     k = 0;
  32.     while (k < lptr)
  33.     {
  34.         if (line[k] == 9)
  35.             tab();
  36.         else
  37.             outbyte(' ');
  38.         k++;
  39.     }
  40.     outbyte('^');
  41.     nl();
  42.     comment();
  43.     outstr("******  ");
  44.     outstr(ptr);
  45.     outstr("  ******");
  46.     nl();
  47. }
  48.