home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume5 / smallc / part2 / error.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-30  |  552 b   |  44 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.  
  10. error (ptr)
  11. 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. doerror(ptr) char *ptr; {
  23.     int k;
  24.     comment ();
  25.     outstr (line);
  26.     nl ();
  27.     comment ();
  28.     k = 0;
  29.     while (k < lptr) {
  30.         if (line[k] == 9)
  31.             tab ();
  32.         else
  33.             outbyte (' ');
  34.         k++;
  35.     }
  36.     outbyte ('^');
  37.     nl ();
  38.     comment ();
  39.     outstr ("******  ");
  40.     outstr (ptr);
  41.     outstr ("  ******");
  42.     nl ();
  43. }
  44.