diff options
author | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2000-10-30 11:42:26 +0000 |
---|---|---|
committer | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2000-10-30 11:42:26 +0000 |
commit | a6d9e5abe5b110dc30e8cf914bcb4de4d28baf43 (patch) | |
tree | d5a3679c885a17f8469801bc97897a80ae48f1d6 /libguile/error.c | |
parent | e9bfab50e4ec7787db05605727a06f98fe30f5b6 (diff) | |
download | guile-a6d9e5abe5b110dc30e8cf914bcb4de4d28baf43.tar.gz |
* Change a couple of functions to accept either symbols or strings only.
* Get rid of remainig uses of SCM_LENGTH etc.
Diffstat (limited to 'libguile/error.c')
-rw-r--r-- | libguile/error.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/libguile/error.c b/libguile/error.c index 4790df734..69f680ee5 100644 --- a/libguile/error.c +++ b/libguile/error.c @@ -116,10 +116,34 @@ SCM_DEFINE (scm_error_scm, "scm-error", 5, 0, 0, { char *szSubr; char *szMessage; - SCM_VALIDATE_SYMBOL (1,key); - SCM_VALIDATE_NULLORROSTRING_COPY (2,subr,szSubr); - SCM_VALIDATE_NULLORROSTRING_COPY (3,message,szMessage); - SCM_COERCE_SUBSTR (message); + + SCM_VALIDATE_SYMBOL (1, key); + + if (SCM_FALSEP (subr)) + { + szSubr = NULL; + } + else if (SCM_SYMBOLP (subr)) + { + szSubr = SCM_SYMBOL_CHARS (subr); + } + else + { + SCM_VALIDATE_STRING (2, subr); + SCM_STRING_COERCE_0TERMINATION_X (subr); + szSubr = SCM_STRING_CHARS (subr); + } + + if (SCM_FALSEP (message)) + { + szMessage = NULL; + } + else + { + SCM_VALIDATE_STRING (2, message); + SCM_STRING_COERCE_0TERMINATION_X (message); + szMessage = SCM_STRING_CHARS (message); + } scm_error (key, szSubr, szMessage, args, rest); /* not reached. */ |