home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / icon / dos / src / preproc / p_err.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-10  |  1.4 KB  |  75 lines

  1. #include "../preproc/preproc.h"
  2. #include "../preproc/pproto.h"
  3. extern char *progname;
  4.  
  5. /*
  6.  * errt1 - error message in one string, location indicated by a token.
  7.  */
  8. novalue errt1(t, s)
  9. struct token *t;
  10. char *s;
  11.    {
  12.    errfl1(t->fname, t->line, s);
  13.    }
  14.  
  15. /*
  16.  * errfl1 - error message in one string, location given by file and line.
  17.  */
  18. novalue errfl1(f, l, s)
  19. char *f;
  20. int l;
  21. char *s;
  22.    {
  23.    fflush(stdout);
  24.    fprintf(stderr, "%s: File %s; Line %d: %s\n", progname, f, l, s);
  25.    exit(ErrorExit);
  26.    }
  27.  
  28. /*
  29.  * err1 - error message in one string, no location given
  30.  */
  31. novalue err1(s)
  32. char *s;
  33.    {
  34.    fflush(stdout);
  35.    fprintf(stderr, "%s: %s\n", progname, s);
  36.    exit(ErrorExit);
  37.    }
  38.  
  39. /*
  40.  * errt2 - error message in two strings, location indicated by a token.
  41.  */
  42. novalue errt2(t, s1, s2)
  43. struct token *t;
  44. char *s1;
  45. char *s2;
  46.    {
  47.    errfl2(t->fname, t->line, s1, s2);
  48.    }
  49.  
  50. /*
  51.  * errfl2 - error message in two strings, location given by file and line.
  52.  */
  53. novalue errfl2(f, l, s1, s2)
  54. char *f;
  55. int l;
  56. char *s1;
  57. char *s2;
  58.    {
  59.    fflush(stdout);
  60.    fprintf(stderr, "%s: File %s; Line %d: %s%s\n", progname, f, l, s1, s2);
  61.    exit(ErrorExit);
  62.    }
  63.  
  64. /*
  65.  * err2 - error message in two strings, no location given
  66.  */
  67. novalue err2(s1, s2)
  68. char *s1;
  69. char *s2;
  70.    {
  71.    fflush(stdout);
  72.    fprintf(stderr, "%s: %s%s\n", progname, s1, s2);
  73.    exit(ErrorExit);
  74.    }
  75.