home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / INTERNET / UPC2S1.ZIP / BUGOUT.C < prev    next >
C/C++ Source or Header  |  1993-08-02  |  2KB  |  61 lines

  1. /*--------------------------------------------------------------------*/
  2. /*    b u g o u t . c                                                 */
  3. /*                                                                    */
  4. /*    Support routines for UUPC/extended                              */
  5. /*                                                                    */
  6. /*    Changes Copyright 1990, 1991 (c) Andrew H. Derbyshire           */
  7. /*                                                                    */
  8. /*    History:                                                        */
  9. /*       21Nov1991 Break out of lib.c                          ahd    */
  10. /*--------------------------------------------------------------------*/
  11.  
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14. #include <string.h>
  15. #include <time.h>
  16.  
  17. #ifdef _Windows
  18. #include <windows.h>
  19. #endif
  20.  
  21. /*--------------------------------------------------------------------*/
  22. /*                    UUPC/extended include files                     */
  23. /*--------------------------------------------------------------------*/
  24.  
  25. #include "lib.h"
  26. #include "catcher.h"
  27. #include "timestmp.h"
  28.  
  29. #ifdef _Windows
  30. #include "winutil.h"
  31. #endif
  32.  
  33. /*--------------------------------------------------------------------*/
  34. /*    b u g o u t                                                     */
  35. /*                                                                    */
  36. /*    Perform a panic() exit from UUPC/extended                       */
  37. /*--------------------------------------------------------------------*/
  38.  
  39. void bugout( const size_t lineno, const char *fname )
  40. {
  41.  
  42. #ifdef _Windows
  43.    char buf[BUFSIZ];
  44. #endif
  45.  
  46.   printmsg(0,"%s aborting at line %d in file %s",
  47.               compilen, lineno, fname );
  48.  
  49. #ifdef _Windows
  50.    sprintf(buf,"%s aborting at line %d in file %s",
  51.               compilen, lineno, fname );
  52.  
  53.    MessageBox( hOurWindow, buf, compilen, MB_ICONEXCLAMATION );
  54.  
  55. #else
  56.    fputc('\a',stderr);
  57. #endif
  58.  
  59.    exit(panic_rc);
  60. } /*bugout */
  61.