[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] Type conversion in the FFI
From: |
Daniel B. Faken |
Subject: |
[Chicken-users] Type conversion in the FFI |
Date: |
Mon, 12 Apr 2004 11:37:50 -0400 (EDT) |
Hello all,
I have C functions which return a boolean value of type (unsigned char).
How can I get chicken to convert these to/from its own boolean values. I
tried the __declare(type, ..) operation, but that tries to redefine my
C boolean type ("BOOL") as an int: "#define BOOL int" is inserted into the
file. This changes the C semantics, which I would like to avoid.. (e.g.
an array of these values wouldn't be properly conveted).
I also tried (define-foreign-type), but couldn't get it to work either.
At present I am just using (integer->char 1) or (not (eq? (char->integer
(C-fn) 0)), but its kinda clumsy..
On an unrelated note, where can I find out more about "properties", as
mentioned in the hash-table docs? These seem to be a common feature of
LISP/scheme, but I couldn't find anything in R5RS..
thanks!
Daniel Faken
- [Chicken-users] Type conversion in the FFI,
Daniel B. Faken <=