[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

type friction C <-> scheme

From: Catonano
Subject: type friction C <-> scheme
Date: Fri, 9 Jun 2017 22:36:45 +0200

Here we go again

After successfully wrapping freexl_open, I can't do the same with

One of the arguments expected by such function is "unsigned short"

When I load the namespace at the REPL I get

scheme@(guile-user)> ,m (freexl common)
While executing meta-command:
ERROR: In procedure pointer->procedure: Wrong type argument in position 3:

I tried with uint8, uint16 and uint32, with the same result

Here's the function I'm referring to

And here's my code (there are some instructions as comments in the code)

And here's an excerpt

(define freexl-get-info
  (let* ((ptr     (freexl-func "freexl_get_info"))
         (proc    (pointer->procedure int ptr '(* int *)))
     ;;the int in the arguments list generates
     ;;a wrong argument type error when
     ;;loading the namespace at the REPL, like this
     ;;scheme@(guile-user)> ,m (freexl common)
     ;;While executing meta-command:
     ;;ERROR: In procedure pointer->procedure: Wrong type argument
     ;;in position 3: int

    (lambda (handle-ptr what)
      (let* ((outcome-ptr (bytevector->pointer (make-bytevector (sizeof
         (result (proc handle-ptr what outcome-ptr)))
    (if (not (= result 0))
        (throw 'get-info-error 'error-code result)

Thanks in advance

reply via email to

[Prev in Thread] Current Thread [Next in Thread]