summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libguile/ChangeLog11
-rw-r--r--libguile/backtrace.c25
-rw-r--r--libguile/backtrace.h1
-rw-r--r--libguile/throw.c2
4 files changed, 34 insertions, 5 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog
index e29d442d7..586663225 100644
--- a/libguile/ChangeLog
+++ b/libguile/ChangeLog
@@ -1,3 +1,14 @@
+2001-01-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
+
+ * backtrace.[ch] (scm_i_display_error): New function.
+
+ * backtrace.c (scm_display_error): Added parameter check and
+ extracted the core functionality into function
+ scm_i_display_error.
+
+ * throw.c (handler_message): Call scm_i_display_error to display
+ the error message.
+
2001-01-23 Mikael Djurfeldt <mdj@linnaeus.mit.edu>
* eval.c (SCM_APPLY): Added # args check for application of
diff --git a/libguile/backtrace.c b/libguile/backtrace.c
index 9b279e15a..67d8e2a27 100644
--- a/libguile/backtrace.c
+++ b/libguile/backtrace.c
@@ -219,10 +219,14 @@ display_error_handler (struct display_error_handler_data *data,
return SCM_UNSPECIFIED;
}
-SCM_DEFINE (scm_display_error, "display-error", 6, 0, 0,
- (SCM stack, SCM port, SCM subr, SCM message, SCM args, SCM rest),
-"")
-#define FUNC_NAME s_scm_display_error
+
+/* The function scm_i_display_error prints out a detailed error message. This
+ * function will be called directly within libguile to signal error messages.
+ * No parameter checks will be performed by scm_i_display_error. Thus, User
+ * code should rather use the function scm_display_error.
+ */
+void
+scm_i_display_error (SCM stack, SCM port, SCM subr, SCM message, SCM args, SCM rest)
{
struct display_error_args a;
struct display_error_handler_data data;
@@ -237,10 +241,23 @@ SCM_DEFINE (scm_display_error, "display-error", 6, 0, 0,
scm_internal_catch (SCM_BOOL_T,
(scm_catch_body_t) display_error_body, &a,
(scm_catch_handler_t) display_error_handler, &data);
+}
+
+
+SCM_DEFINE (scm_display_error, "display-error", 6, 0, 0,
+ (SCM stack, SCM port, SCM subr, SCM message, SCM args, SCM rest),
+ "")
+#define FUNC_NAME s_scm_display_error
+{
+ SCM_VALIDATE_OUTPUT_PORT (2, port);
+
+ scm_i_display_error (stack, port, subr, message, args, rest);
+
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
+
typedef struct {
int level;
int length;
diff --git a/libguile/backtrace.h b/libguile/backtrace.h
index 49e5475e8..68f85a2c7 100644
--- a/libguile/backtrace.h
+++ b/libguile/backtrace.h
@@ -52,6 +52,7 @@
extern SCM scm_the_last_stack_fluid;
void scm_display_error_message (SCM message, SCM args, SCM port);
+void scm_i_display_error (SCM stack, SCM port, SCM subr, SCM message, SCM args, SCM rest);
SCM scm_display_error (SCM stack, SCM port, SCM subr, SCM message, SCM args, SCM rest);
SCM scm_display_application (SCM frame, SCM port, SCM indent);
SCM scm_display_backtrace (SCM stack, SCM port, SCM first, SCM depth);
diff --git a/libguile/throw.c b/libguile/throw.c
index 60d5bc9cc..faf2040ab 100644
--- a/libguile/throw.c
+++ b/libguile/throw.c
@@ -434,7 +434,7 @@ handler_message (void *handler_data, SCM tag, SCM args)
scm_display_backtrace (stack, p, SCM_UNDEFINED, SCM_UNDEFINED);
scm_newline (p);
}
- scm_display_error (stack, p, subr, message, parts, rest);
+ scm_i_display_error (stack, p, subr, message, parts, rest);
}
else
{