From 6657e53a53f2f80a3d8f87c1261cc49e28122d0f Mon Sep 17 00:00:00 2001 From: Arthur Gleckler Date: Mon, 26 Aug 1991 15:00:24 +0000 Subject: [PATCH] Add primitive EXIT-WITH-VALUE that takes an integer value as argument. ANSIdecl-ify various primitive procedure utilities in prims.h. --- v7/src/microcode/debug.c | 4 ++-- v7/src/microcode/extern.h | 4 ++-- v7/src/microcode/osscheme.h | 4 ++-- v7/src/microcode/prims.h | 24 ++++++++++++------------ v7/src/microcode/sysprim.c | 15 ++++++++++++--- v7/src/microcode/term.c | 6 +++--- v7/src/microcode/uxsig.c | 4 ++-- v7/src/microcode/version.h | 4 ++-- v8/src/microcode/version.h | 4 ++-- 9 files changed, 39 insertions(+), 30 deletions(-) diff --git a/v7/src/microcode/debug.c b/v7/src/microcode/debug.c index dc97edf21..0b78efda6 100644 --- a/v7/src/microcode/debug.c +++ b/v7/src/microcode/debug.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/debug.c,v 9.37 1990/08/16 08:42:15 jinx Rel $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/debug.c,v 9.38 1991/08/26 15:00:09 arthur Exp $ Copyright (c) 1987, 1988, 1989, 1990 Massachusetts Institute of Technology @@ -1002,7 +1002,7 @@ DEFUN_VOID (debug_edit_flags) return; case 'h': case 'H': - termination_normal (); + termination_normal (0); case '?': default: show_flags (1); diff --git a/v7/src/microcode/extern.h b/v7/src/microcode/extern.h index 5aa4dbfa4..2b266e925 100644 --- a/v7/src/microcode/extern.h +++ b/v7/src/microcode/extern.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/extern.h,v 9.40 1991/03/01 00:54:24 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/extern.h,v 9.41 1991/08/26 15:00:11 arthur Exp $ Copyright (c) 1987-91 Massachusetts Institute of Technology @@ -225,7 +225,7 @@ extern Boolean Pure_Test (); /* Interpreter utilities */ extern void EXFUN (Microcode_Termination, (int code)); -extern void EXFUN (termination_normal, (void)); +extern void EXFUN (termination_normal, (int)); extern void EXFUN (termination_init_error, (void)); extern void EXFUN (termination_end_of_computation, (void)); extern void EXFUN (termination_trap, (void)); diff --git a/v7/src/microcode/osscheme.h b/v7/src/microcode/osscheme.h index 0eb84e3ce..2f2178088 100644 --- a/v7/src/microcode/osscheme.h +++ b/v7/src/microcode/osscheme.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/osscheme.h,v 1.3 1991/03/01 00:55:17 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/osscheme.h,v 1.4 1991/08/26 15:00:14 arthur Exp $ Copyright (c) 1990-91 Massachusetts Institute of Technology @@ -54,7 +54,7 @@ extern void EXFUN (error_out_of_processes, (void)); extern void EXFUN (error_floating_point_exception, (void)); extern void EXFUN (termination_eof, (void)); -extern void EXFUN (termination_normal, (void)); +extern void EXFUN (termination_normal, (int)); extern void EXFUN (termination_init_error, (void)); extern void EXFUN (termination_signal, (CONST char * signal_name)); extern void EXFUN (termination_trap, (void)); diff --git a/v7/src/microcode/prims.h b/v7/src/microcode/prims.h index 2d397a015..01d12116b 100644 --- a/v7/src/microcode/prims.h +++ b/v7/src/microcode/prims.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/prims.h,v 9.38 1991/03/01 00:55:21 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/prims.h,v 9.39 1991/08/26 15:00:15 arthur Exp $ Copyright (c) 1987-91 Massachusetts Institute of Technology @@ -87,17 +87,17 @@ extern void canonicalize_primitive_context (); extern void EXFUN (signal_error_from_primitive, (long error_code)); extern void EXFUN (signal_interrupt_from_primitive, (void)); -extern void error_wrong_type_arg (); -extern void error_bad_range_arg (); -extern void error_external_return (); -extern long arg_integer (); -extern long arg_nonnegative_integer (); -extern long arg_index_integer (); -extern long arg_integer_in_range (); -extern double arg_real_number (); -extern double arg_real_in_range (); -extern long arg_ascii_char (); -extern long arg_ascii_integer (); +extern void EXFUN (error_wrong_type_arg, (int)); +extern void EXFUN (error_bad_range_arg, (int)); +extern void EXFUN (error_external_return, (void)); +extern long EXFUN (arg_integer, (int)); +extern long EXFUN (arg_nonnegative_integer, (int)); +extern long EXFUN (arg_index_integer, (int, long)); +extern long EXFUN (arg_integer_in_range, (int, long, long)); +extern double EXFUN (arg_real_number, (int)); +extern double EXFUN (arg_real_in_range, (int, double, double)); +extern long EXFUN (arg_ascii_char, (int)); +extern long EXFUN (arg_ascii_integer, (int)); #define UNSIGNED_FIXNUM_ARG(arg) \ ((FIXNUM_P (ARG_REF (arg))) \ diff --git a/v7/src/microcode/sysprim.c b/v7/src/microcode/sysprim.c index ed52919af..352ef1003 100644 --- a/v7/src/microcode/sysprim.c +++ b/v7/src/microcode/sysprim.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/sysprim.c,v 9.35 1990/11/05 11:55:19 cph Rel $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/sysprim.c,v 9.36 1991/08/26 15:00:18 arthur Exp $ -Copyright (c) 1987, 1988, 1989, 1990 Massachusetts Institute of Technology +Copyright (c) 1987, 1988, 1989, 1990, 1991 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -46,7 +46,16 @@ DEFINE_PRIMITIVE ("EXIT", Prim_non_restartable_exit, 0, 0, "Exit Scheme with no option to restart.") { PRIMITIVE_HEADER (0); - termination_normal (); + termination_normal (0); +} + +DEFINE_PRIMITIVE ("EXIT-WITH-VALUE", + Prim_non_restartable_exit_with_value, 1, 1, + "Exit Scheme with no option to restart, returning integer argument\n\ +as exit status.") +{ + PRIMITIVE_HEADER (1); + termination_normal ((int) arg_integer (1)); } DEFINE_PRIMITIVE ("HALT", Prim_restartable_exit, 0, 0, diff --git a/v7/src/microcode/term.c b/v7/src/microcode/term.c index d9671ad32..e55ba1b7a 100644 --- a/v7/src/microcode/term.c +++ b/v7/src/microcode/term.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/term.c,v 1.4 1990/11/13 08:44:58 cph Rel $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/term.c,v 1.5 1991/08/26 15:00:20 arthur Exp $ Copyright (c) 1990 Massachusetts Institute of Technology @@ -143,10 +143,10 @@ DEFUN (Microcode_Termination, (code), int code) } void -DEFUN_VOID (termination_normal) +DEFUN (termination_normal, (value), CONST int value) { termination_prefix (TERM_HALT); - termination_suffix (TERM_HALT, 0, 0); + termination_suffix (TERM_HALT, value, 0); } void diff --git a/v7/src/microcode/uxsig.c b/v7/src/microcode/uxsig.c index 330f1ce02..f107ccdbf 100644 --- a/v7/src/microcode/uxsig.c +++ b/v7/src/microcode/uxsig.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxsig.c,v 1.14 1991/08/24 02:10:15 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxsig.c,v 1.15 1991/08/26 15:00:22 arthur Exp $ Copyright (c) 1990-91 Massachusetts Institute of Technology @@ -742,7 +742,7 @@ DEFUN (interactive_interrupt_handler, (scp), struct FULL_SIGCONTEXT * scp) case 'Q': case 'q': INTERACTIVE_NEWLINE (); - termination_normal (); + termination_normal (0); return; case '\f': if (!option_emacs_subprocess) diff --git a/v7/src/microcode/version.h b/v7/src/microcode/version.h index f646f6ed9..83785a6e0 100644 --- a/v7/src/microcode/version.h +++ b/v7/src/microcode/version.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.94 1991/08/13 06:45:17 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.95 1991/08/26 15:00:24 arthur Exp $ Copyright (c) 1988-91 Massachusetts Institute of Technology @@ -46,5 +46,5 @@ MIT in each case. */ #define VERSION 11 #endif #ifndef SUBVERSION -#define SUBVERSION 94 +#define SUBVERSION 95 #endif diff --git a/v8/src/microcode/version.h b/v8/src/microcode/version.h index d2b7d3adb..69a3e2f06 100644 --- a/v8/src/microcode/version.h +++ b/v8/src/microcode/version.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.94 1991/08/13 06:45:17 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.95 1991/08/26 15:00:24 arthur Exp $ Copyright (c) 1988-91 Massachusetts Institute of Technology @@ -46,5 +46,5 @@ MIT in each case. */ #define VERSION 11 #endif #ifndef SUBVERSION -#define SUBVERSION 94 +#define SUBVERSION 95 #endif -- 2.25.1