home *** CD-ROM | disk | FTP | other *** search
/ Dream 45 / Amiga_Dream_45.iso / Amiga / Magazine / Dossier-LaTeX / AmiWeb2C.lha / source / web2c-6.1 / web2c / lib / uexit.ch < prev    next >
Text File  |  1995-03-23  |  687b  |  40 lines

  1. Changes for UEXIT.C by Andreas Scherer, March 23, 1995.
  2.  
  3. @x l.5
  4. #include "config.h"
  5. @y
  6. #include "andyconfig.h"
  7. @z
  8.  
  9. @x l.8
  10. uexit (unix_code)
  11.   int unix_code;
  12. {
  13.   int final_code;
  14.   
  15.   if (unix_code == 0)
  16.     final_code = EXIT_SUCCESS;
  17.   else if (unix_code == 1)
  18.     final_code = !EXIT_SUCCESS;
  19.   else
  20.     final_code = unix_code;
  21.   
  22.   exit (final_code);
  23. }
  24. @y
  25. #define RETURN_OK 0
  26. #define RETURN_WARN 5
  27. #define RETURN_ERROR 10
  28. #define RETURN_FAIL 20
  29.  
  30. uexit (int history)
  31. {
  32.    switch(history) {
  33.    case warning_issued: exit(RETURN_WARN); break;
  34.    case error_message_issued: exit(RETURN_ERROR); break;
  35.    case fatal_error_stop: exit(RETURN_FAIL); break;
  36.    default: exit(RETURN_OK);
  37.    }
  38. }
  39. @z
  40.