diff --git a/cig/cig.scm b/cig/cig.scm index 1e435bb..31ad5dd 100644 --- a/cig/cig.scm +++ b/cig/cig.scm @@ -141,12 +141,19 @@ ;;; closed in the macro expander's environment, so the user won't lose ;;; if he should accidentally bind INTEGER? to something unusual, and ;;; then try a DEFINE-FOREIGN. + +;;; WARNING: the xxx_t are not yet adapted to the new FFI, only time_t, +;;; long and int are entered via enter/extract_integer, which converts to a +;;; bignum if appropriate. +;;; Since this requires runtime-checks it is slower than the _integer's +;;; You have to check, where more than 29 bits is required + (define *simple-argrep-alist* '( (char #("char ~a" char? "s48_extract_char" #f)) (bool #("int ~a" #f "EXTRACT_BOOLEAN" #f)) - (integer #("int ~a" integer? "s48_extract_fixnum" #f)) + (integer #("int ~a" integer? "s48_extract_integer" #f)) (short_u #("unsigned short ~a" integer? "s48_extract_fixnum" #f)) (size_t #("size_t ~a" integer? "s48_extract_fixnum" #f)) (mode_t #("mode_t ~a" integer? "s48_extract_fixnum" #f)) @@ -154,10 +161,13 @@ (uid_t #("uid_t ~a" integer? "s48_extract_fixnum" #f)) (off_t #("off_t ~a" integer? "s48_extract_fixnum" #f)) (pid_t #("pid_t ~a" integer? "s48_extract_fixnum" #f)) - (uint_t #("unsigned int ~a" integer? "s48_extract_fixnum" #f)) - (long #("long ~a" integer? "s48_extract_fixnum" #f)) + (uint_t #("unsigned int ~a" integer? "s48_extract_integer" #f)) + (long #("long ~a" integer? "s48_extract_integer" #f)) (fixnum #("int ~a" fixnum? "s48_extract_fixnum" #f)) + ;; extensions by JMG for the new FFI + (time_t #("time_t ~a" integer? "s48_extract_integer" #f)) + (desc #("s48_value ~a" #f "" #f)) (string-desc #("s48_value ~a" string? "" #f)) (char-desc #("s48_value ~a" char? "" #f)) @@ -194,7 +204,7 @@ (bool #("int ~a" "ENTER_BOOLEAN" #f #f #f)) ;; JMG c and bool: ; s48 knows nothing about this I think - (integer #("int ~a" "s48_enter_fixnum" #f #f #f)) + (integer #("int ~a" "s48_enter_integer" #f #f #f)) (fixnum #("int ~a" "s48_enter_fixnum" #f #f #f)) (short_u #("unsigned short ~a" "s48_enter_fixnum" #f #f #f)) (size_t #("size_t ~a" "s48_enter_fixnum" #f #f #f)) @@ -204,7 +214,10 @@ (off_t #("off_t ~a" "s48_enter_fixnum" #f #f #f)) (pid_t #("pid_t ~a" "s48_enter_fixnum" #f #f #f)) (uint_t #("unsigned int ~a" "s48_enter_fixnum" #f #f #f)) - (long #("long ~a" "s48_enter_fixnum" #f #f #f)) + (long #("long ~a" "s48_enter_integer" #f #f #f)) + + ; Extension by JMG with the new FFI + (time_t #("time_t ~a" "s48_enter_integer" #f #f #f)) (desc #("s48_value ~a" "" #f #f #f)) (string-desc #("s48_value ~a" "" #f #f #f))