mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 12:20:26 +02:00
* error.c, error.h: Made error keys globally accessible.
Applications might want to test for these or use them in a direct call to scm_error.
This commit is contained in:
parent
147c18a0e4
commit
a7f54aed6a
2 changed files with 15 additions and 7 deletions
|
@ -162,7 +162,7 @@ SCM_DEFINE (scm_strerror, "strerror", 1, 0, 0,
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
||||||
SCM_SYMBOL (scm_system_error_key, "system-error");
|
SCM_GLOBAL_SYMBOL (scm_system_error_key, "system-error");
|
||||||
void
|
void
|
||||||
scm_syserror (const char *subr)
|
scm_syserror (const char *subr)
|
||||||
{
|
{
|
||||||
|
@ -185,7 +185,7 @@ scm_syserror_msg (const char *subr, const char *message, SCM args, int eno)
|
||||||
scm_cons (SCM_MAKINUM (eno), SCM_EOL));
|
scm_cons (SCM_MAKINUM (eno), SCM_EOL));
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM_SYMBOL (scm_num_overflow_key, "numerical-overflow");
|
SCM_GLOBAL_SYMBOL (scm_num_overflow_key, "numerical-overflow");
|
||||||
void
|
void
|
||||||
scm_num_overflow (const char *subr)
|
scm_num_overflow (const char *subr)
|
||||||
{
|
{
|
||||||
|
@ -196,7 +196,7 @@ scm_num_overflow (const char *subr)
|
||||||
SCM_BOOL_F);
|
SCM_BOOL_F);
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM_SYMBOL (scm_out_of_range_key, "out-of-range");
|
SCM_GLOBAL_SYMBOL (scm_out_of_range_key, "out-of-range");
|
||||||
void
|
void
|
||||||
scm_out_of_range (const char *subr, SCM bad_value)
|
scm_out_of_range (const char *subr, SCM bad_value)
|
||||||
{
|
{
|
||||||
|
@ -218,7 +218,7 @@ scm_out_of_range_pos (const char *subr, SCM bad_value, SCM pos)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SCM_SYMBOL (scm_args_number_key, "wrong-number-of-args");
|
SCM_GLOBAL_SYMBOL (scm_args_number_key, "wrong-number-of-args");
|
||||||
void
|
void
|
||||||
scm_wrong_num_args (SCM proc)
|
scm_wrong_num_args (SCM proc)
|
||||||
{
|
{
|
||||||
|
@ -241,7 +241,7 @@ scm_error_num_args_subr (const char *subr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SCM_SYMBOL (scm_arg_type_key, "wrong-type-arg");
|
SCM_GLOBAL_SYMBOL (scm_arg_type_key, "wrong-type-arg");
|
||||||
void
|
void
|
||||||
scm_wrong_type_arg (const char *subr, int pos, SCM bad_value)
|
scm_wrong_type_arg (const char *subr, int pos, SCM bad_value)
|
||||||
{
|
{
|
||||||
|
@ -273,7 +273,7 @@ scm_wrong_type_arg_msg (const char *subr, int pos, SCM bad_value, const char *sz
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SCM_SYMBOL (scm_memory_alloc_key, "memory-allocation-error");
|
SCM_GLOBAL_SYMBOL (scm_memory_alloc_key, "memory-allocation-error");
|
||||||
void
|
void
|
||||||
scm_memory_error (const char *subr)
|
scm_memory_error (const char *subr)
|
||||||
{
|
{
|
||||||
|
@ -284,7 +284,7 @@ scm_memory_error (const char *subr)
|
||||||
SCM_BOOL_F);
|
SCM_BOOL_F);
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM_SYMBOL (scm_misc_error_key, "misc-error");
|
SCM_GLOBAL_SYMBOL (scm_misc_error_key, "misc-error");
|
||||||
void
|
void
|
||||||
scm_misc_error (const char *subr, const char *message, SCM args)
|
scm_misc_error (const char *subr, const char *message, SCM args)
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,6 +51,14 @@
|
||||||
|
|
||||||
extern int scm_ints_disabled;
|
extern int scm_ints_disabled;
|
||||||
|
|
||||||
|
extern SCM scm_system_error_key;
|
||||||
|
extern SCM scm_num_overflow_key;
|
||||||
|
extern SCM scm_out_of_range_key;
|
||||||
|
extern SCM scm_args_number_key;
|
||||||
|
extern SCM scm_arg_type_key;
|
||||||
|
extern SCM scm_memory_alloc_key;
|
||||||
|
extern SCM scm_misc_error_key;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern void scm_error (SCM key, const char *subr, const char *message,
|
extern void scm_error (SCM key, const char *subr, const char *message,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue