--- scheme-control.texi.~1.6.~ 2003-05-04 11:02:44.000000000 +1000 +++ scheme-control.texi 2003-05-04 11:24:15.000000000 +1000 @@ -934,41 +934,38 @@ @subsection C Support -SCM scm_error (SCM key, char *subr, char *message, SCM args, SCM rest) +In the following C functions, @var{SUBR} and @var{MESSAGE} parameters +can be @code{NULL} to give the @code{#f} described above. -Throws an error, after converting the char * arguments to Scheme strings. -subr is the Scheme name of the procedure, NULL is converted to #f. -Likewise a NULL message is converted to #f. - -The following procedures invoke scm_error with various error keys and -arguments. The first three call scm_error with the system-error key -and automatically supply errno in the "rest" argument: scm_syserror -generates messages using strerror. Care should be taken that the errno -value is not reset (e.g. due to an interrupt). - address@hidden @bullet address@hidden -void scm_syserror (char *subr); address@hidden -void scm_syserror_msg (char *subr, char *message, SCM args); address@hidden -void scm_num_overflow (char *subr); address@hidden -void scm_out_of_range (char *subr, SCM bad_value); address@hidden -void scm_wrong_num_args (SCM proc); address@hidden -void scm_wrong_type_arg (char *subr, int pos, SCM bad_value); address@hidden -void scm_memory_error (char *subr); address@hidden -static void scm_regex_error (char *subr, int code); (only used in rgx.c). address@hidden itemize address@hidden SCM scm_error (SCM key, char *subr, char *message, SCM args, SCM rest) +Throw an error, as per @code{scm-error} above. address@hidden deftypefun + address@hidden void scm_syserror (char *subr) address@hidden void scm_syserror_msg (char *subr, char *message, SCM args) +Throw an error with key @code{system-error} and supply @code{errno} in +the @var{rest} argument. For @code{scm_syserror} the message is +generated using @code{strerror}. + +Of course care should be taken that any code in between the failing +operation and the call to these routines doesn't change @code{errno}. address@hidden deftypefun + address@hidden void scm_num_overflow (char *subr) address@hidden void scm_out_of_range (char *subr, SCM bad_value) address@hidden void scm_wrong_num_args (SCM proc) address@hidden void scm_wrong_type_arg (char *subr, int pos, SCM bad_value) address@hidden void scm_memory_error (char *subr) +Throw an error with the various keys described above. + +For @code{scm_wrong_num_args}, @var{proc} should be a Scheme symbol +which is the name of the procedure incorrectly invoked. address@hidden deftypefun Exception handlers can also be installed from C, using -scm_internal_catch, scm_lazy_catch, or scm_stack_catch from -libguile/throw.c. These have not yet been documented, however the -source contains some useful comments. address@hidden, @code{scm_lazy_catch}, or address@hidden from @file{libguile/throw.c}. These have not +yet been documented, but the source contains some useful comments. @c Local Variables: