[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
doco C error handling
From: |
Kevin Ryde |
Subject: |
doco C error handling |
Date: |
Sun, 04 May 2003 11:29:23 +1000 |
User-agent: |
Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (gnu/linux) |
* scheme-control.texi (Handling Errors): Revise C support section to
get index entries and clarify parameters. Remove scm_regex_error, no
longer exists and wasn't available to applications.
I hope I'm right that scm_regex_error is gone, it doesn't show up in a
grep.
Incidentally, is the regex-error error key described in the scheme
section of this node be regular-expression-syntax, as per the
`make-regexp' doco?
Revised text:
C Support
---------
In the following C functions, SUBR and MESSAGE parameters can be `NULL'
to give the `#f' described above.
- Function: SCM scm_error (SCM key, char *subr, char *message, SCM
args, SCM rest)
Throw an error, as per `scm-error' above.
- Function: void scm_syserror (char *subr)
- Function: void scm_syserror_msg (char *subr, char *message, SCM args)
Throw an error with key `system-error' and supply `errno' in the
REST argument. For `scm_syserror' the message is generated using
`strerror'.
Of course care should be taken that any code in between the failing
operation and the call to these routines doesn't change `errno'.
- Function: void scm_num_overflow (char *subr)
- Function: void scm_out_of_range (char *subr, SCM bad_value)
- Function: void scm_wrong_num_args (SCM proc)
- Function: void scm_wrong_type_arg (char *subr, int pos, SCM
bad_value)
- Function: void scm_memory_error (char *subr)
Throw an error with the various keys described above.
For `scm_wrong_num_args', PROC should be a Scheme symbol which is
the name of the procedure incorrectly invoked.
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, but the source
contains some useful comments.
scheme-control.texi.c-errors.diff
Description: Text document
- doco C error handling,
Kevin Ryde <=