s_stop.c 762 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #include "stdio.h"
  2. #include "f2c.h"
  3. #ifdef KR_headers
  4. extern void f_exit();
  5. int s_stop(s, n) char *s; ftnlen n;
  6. #else
  7. #undef abs
  8. #undef min
  9. #undef max
  10. #include "stdlib.h"
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. void f_exit(void);
  18. int s_stop(char *s, ftnlen n)
  19. #endif
  20. {
  21. int i;
  22. if(n > 0)
  23. {
  24. fprintf(stderr, "STOP ");
  25. for(i = 0; i<n ; ++i)
  26. putc(*s++, stderr);
  27. fprintf(stderr, " statement executed\n");
  28. }
  29. #ifdef NO_ONEXIT
  30. f_exit();
  31. #endif
  32. exit(0);
  33. /* We cannot avoid (useless) compiler diagnostics here: */
  34. /* some compilers complain if there is no return statement, */
  35. /* and others complain that this one cannot be reached. */
  36. return 0; /* NOT REACHED */
  37. }
  38. #ifdef __cplusplus
  39. }
  40. #endif
  41. #ifdef __cplusplus
  42. }
  43. #endif