diff options
author | Alessio Treglia <alessio@debian.org> | 2010-10-27 00:50:23 +0200 |
---|---|---|
committer | Alessio Treglia <alessio@debian.org> | 2010-10-27 00:50:23 +0200 |
commit | 36cf8384e5699cda3f1ca607753fe4d4a8515b01 (patch) | |
tree | d088c80da01f71ae38378f8893899df62fe8ed64 /snd-xen.c | |
parent | 21c0acaad1b1fa3d17c911ff7e4ad05d63310195 (diff) |
Imported Upstream version 11.10
Diffstat (limited to 'snd-xen.c')
-rw-r--r-- | snd-xen.c | 61 |
1 files changed, 36 insertions, 25 deletions
@@ -141,7 +141,7 @@ static XEN g_snd_s7_error_handler(XEN args) fprintf(stderr, "error: %s\n", s7_object_to_c_string(s7, args)); #endif if (ss->xen_error_handler) - (*(ss->xen_error_handler))(s7_string(s7_car(args)), (void *)NULL); + (*(ss->xen_error_handler))(s7_string(s7_car(args)), (void *)any_selected_sound()); /* not NULL! */ return(s7_f(s7)); } #endif @@ -155,20 +155,22 @@ void redirect_xen_error_to(void (*handler)(const char *msg, void *ufd), void *da #if HAVE_SCHEME if (handler == NULL) s7_symbol_set_value(s7, s7_make_symbol(s7, "*error-hook*"), s7_nil(s7)); - else s7_eval_c_string(s7, "(set! *error-hook* \n\ - (lambda (tag args) \n\ - (_snd_s7_error_handler_ \n\ - (string-append \n\ - (if (string? args) \n\ - args \n\ - (apply format #f (car args) (cdr args))) \n\ - (if (and (*error-info* 2) \n\ - (string? (*error-info* 4)) \n\ - (number? (*error-info* 3))) \n\ - (format #f \"~%~S[~D]: ~A~%\" \n\ - (*error-info* 4) \n\ - (*error-info* 3) \n\ - (*error-info* 2)) \n\ + else s7_eval_c_string(s7, "(set! *error-hook* \n\ + (lambda (tag args) \n\ + (_snd_s7_error_handler_ \n\ + (string-append \n\ + (if (string? args) \n\ + args \n\ + (if (pair? args) \n\ + (apply format #f (car args) (cdr args)) \n\ + \"\")) \n\ + (if (and (*error-info* 2) \n\ + (string? (*error-info* 4)) \n\ + (number? (*error-info* 3))) \n\ + (format #f \"~%~S[~D]: ~A~%\" \n\ + (*error-info* 4) \n\ + (*error-info* 3) \n\ + (*error-info* 2)) \n\ \"\")))))"); #endif } @@ -1311,6 +1313,7 @@ static XEN g_dlopen(XEN name) static XEN g_dlclose(XEN handle) { #define H_dlclose "(dlclose handle) may close the library referred to by 'handle'." + XEN_ASSERT_TYPE(XEN_WRAPPED_C_POINTER_P(handle), handle, XEN_ONLY_ARG, "dlclose", "a library handle"); return(C_TO_XEN_INT(dlclose((void *)(XEN_UNWRAP_C_POINTER(handle))))); } @@ -2936,7 +2939,7 @@ If it returns some non-#f result, Snd assumes you've sent the text out yourself, XEN_EVAL_C_STRING("(define redo-edit redo)"); /* consistency with Ruby */ XEN_EVAL_C_STRING("(define undo-edit undo)"); - XEN_EVAL_C_STRING("(define (procedure-name proc) (format #f \"~A\" proc))"); + XEN_EVAL_C_STRING("(define (procedure-name proc) (if (procedure? proc) (format #f \"~A\" proc) #f))"); /* needed in snd-test.scm and hooks.scm */ XEN_EVAL_C_STRING("\ @@ -2964,15 +2967,18 @@ If it returns some non-#f result, Snd assumes you've sent the text out yourself, (procedure-documentation (cdr binding))\ (cdr binding)))))\ alist))\ - (for-each\ - (lambda (frame)\ - (if (vector? frame)\ - (let ((len (vector-length frame)))\ - (do ((i 0 (+ i 1)))\ - ((= i len))\ - (apropos-1 (vector-ref frame i))))\ - (apropos-1 frame)))\ - (current-environment)))"); + (if (or (not (string? name))\ + (= (length name) 0))\ + (error 'wrong-type-arg \"apropos argument should be a non-nil string\")\ + (for-each\ + (lambda (frame)\ + (if (vector? frame)\ + (let ((len (vector-length frame)))\ + (do ((i 0 (+ i 1)))\ + ((= i len))\ + (apropos-1 (vector-ref frame i))))\ + (apropos-1 frame)))\ + (current-environment))))"); XEN_EVAL_C_STRING("\ (define break-ok #f)\ @@ -3092,6 +3098,11 @@ If it returns some non-#f result, Snd assumes you've sent the text out yourself, #if USE_GTK XEN_YES_WE_HAVE("snd-gtk"); +#if HAVE_GTK_3 + XEN_YES_WE_HAVE("gtk3"); +#else + XEN_YES_WE_HAVE("gtk2"); +#endif #endif #if USE_NO_GUI |