home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 March / VPR9703A.ISO / VPR_DATA / DOGA / SOURCES / POLYEDIT.LZH / ML / ERR.C < prev    next >
C/C++ Source or Header  |  1996-06-05  |  1KB  |  62 lines

  1.  
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. #include "inlib.h"
  6.  
  7. extern    char    *InputFile ;
  8. extern    int        InputLine ;
  9. extern    int        ExecLine ;
  10. extern    char    *ExecFile ;
  11.  
  12. extern    void    (*ErrorExec)();
  13.  
  14. void    ParseError( msg, arg1, arg2, arg3, arg4 )
  15. char    *msg ;
  16. int        arg1, arg2, arg3, arg4 ;
  17. {
  18.     char    fmt[256], buf[256] ;
  19.  
  20.     sprintf( fmt, "%s:%d:  Error %s", InputFile, InputLine, msg );
  21.     sprintf( buf, fmt, arg1, arg2, arg3, arg4 );
  22.     (*ErrorExec)( buf );
  23. }
  24.  
  25. void    ParseFatal( msg, arg1, arg2, arg3, arg4 )
  26. char    *msg ;
  27. int        arg1, arg2, arg3, arg4 ;
  28. {
  29.     char    fmt[256], buf[256] ;
  30.  
  31.     if (InputFile == NULL || InputFile[0] == '\0') {
  32.         sprintf( fmt, "Fatal %s", msg );
  33.     } else {
  34.         sprintf( fmt, "%s:%d:  Fatal %s", InputFile, InputLine, msg );
  35.     }
  36.     sprintf( buf, fmt, arg1, arg2, arg3, arg4 );
  37.     (*ErrorExec)( buf );
  38. }
  39.  
  40. void    ExecError( msg, arg1, arg2, arg3, arg4 )
  41. char    *msg ;
  42. int        arg1, arg2, arg3, arg4 ;
  43. {
  44.     char    fmt[256], buf[256] ;
  45.  
  46. #if 0
  47.     if (InputFile == NULL || InputFile[0] == '\0') {
  48.         sprintf( fmt, "Error %s", msg );
  49.     } else {
  50.         sprintf( fmt, "%s:%d:  Error %s", ExecFile, ExecLine, msg );
  51.     }
  52. #else
  53.     if (ExecFile == NULL || ExecFile[0] == '\0') {
  54.         sprintf( fmt, "Error %s", msg );
  55.     } else {
  56.         sprintf( fmt, "%s:%d:  Error %s", ExecFile, ExecLine, msg );
  57.     }
  58. #endif
  59.     sprintf( buf, fmt, arg1, arg2, arg3, arg4 );
  60.     (*ErrorExec)( buf );
  61. }
  62.