* doco C error handling
@ 2003-05-04 1:29 Kevin Ryde
2003-05-09 23:07 ` Kevin Ryde
2003-05-10 1:21 ` doco regexp error key (was: doco C error handling) Kevin Ryde
0 siblings, 2 replies; 4+ messages in thread
From: Kevin Ryde @ 2003-05-04 1:29 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 1834 bytes --]
* 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.
[-- Attachment #2: scheme-control.texi.c-errors.diff --]
[-- Type: text/plain, Size: 2918 bytes --]
--- 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).
-
-@itemize @bullet
-@item
-void scm_syserror (char *subr);
-@item
-void scm_syserror_msg (char *subr, char *message, SCM args);
-@item
-void scm_num_overflow (char *subr);
-@item
-void scm_out_of_range (char *subr, SCM bad_value);
-@item
-void scm_wrong_num_args (SCM proc);
-@item
-void scm_wrong_type_arg (char *subr, int pos, SCM bad_value);
-@item
-void scm_memory_error (char *subr);
-@item
-static void scm_regex_error (char *subr, int code); (only used in rgx.c).
-@end itemize
+@deftypefun SCM scm_error (SCM key, char *subr, char *message, SCM args, SCM rest)
+Throw an error, as per @code{scm-error} above.
+@end deftypefun
+
+@deftypefun void scm_syserror (char *subr)
+@deftypefunx 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}.
+@end deftypefun
+
+@deftypefun void scm_num_overflow (char *subr)
+@deftypefunx void scm_out_of_range (char *subr, SCM bad_value)
+@deftypefunx void scm_wrong_num_args (SCM proc)
+@deftypefunx void scm_wrong_type_arg (char *subr, int pos, SCM bad_value)
+@deftypefunx 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.
+@end 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.
+@code{scm_internal_catch}, @code{scm_lazy_catch}, or
+@code{scm_stack_catch} from @file{libguile/throw.c}. These have not
+yet been documented, but the source contains some useful comments.
@c Local Variables:
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: doco C error handling
2003-05-04 1:29 doco C error handling Kevin Ryde
@ 2003-05-09 23:07 ` Kevin Ryde
2003-05-10 1:21 ` doco regexp error key (was: doco C error handling) Kevin Ryde
1 sibling, 0 replies; 4+ messages in thread
From: Kevin Ryde @ 2003-05-09 23:07 UTC (permalink / raw)
I wrote:
>
> * 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.
In absense of violent objections, I applied this change.
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* doco regexp error key (was: doco C error handling)
2003-05-04 1:29 doco C error handling Kevin Ryde
2003-05-09 23:07 ` Kevin Ryde
@ 2003-05-10 1:21 ` Kevin Ryde
2003-05-11 22:36 ` doco regexp error key Kevin Ryde
1 sibling, 1 reply; 4+ messages in thread
From: Kevin Ryde @ 2003-05-10 1:21 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 361 bytes --]
I wrote:
>
> 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?
I propose to make the following correction, to the head and also to
the 1.6 branch,
* scheme-control.texi (Handling Errors): Fix regexp error key is
regular-expression-syntax.
[-- Attachment #2: scheme-control.texi.regexp-error.diff --]
[-- Type: text/plain, Size: 469 bytes --]
--- scheme-control.texi.~1.8.~ 2003-05-10 11:13:52.000000000 +1000
+++ scheme-control.texi 2003-05-10 11:18:49.000000000 +1000
@@ -933,8 +933,9 @@
@code{stack-overflow}: stack overflow error.
@item
-@cindex @code{regex-error}
-@code{regex-error}: errors generated by the regular expression library.
+@cindex @code{regular-expression-syntax}
+@code{regular-expression-syntax}: errors generated by the regular
+expression library.
@item
@cindex @code{misc-error}
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-05-11 22:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-04 1:29 doco C error handling Kevin Ryde
2003-05-09 23:07 ` Kevin Ryde
2003-05-10 1:21 ` doco regexp error key (was: doco C error handling) Kevin Ryde
2003-05-11 22:36 ` doco regexp error key Kevin Ryde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).