Greetings,
I'm encountering the following error message inside a callback using
Chicken's FFI interface:
Error: (cdr) bad argument type: #invalid forwarded object
Call history:
pwent.scm:100: loop
pwent.scm:56: ##sys#gc
pwent.scm:56: g42
pwent.scm:24:
.alyn.post. scripsit:
I'm trying to read /etc/passwd using getpwent(3) and store each
record returned in a scheme list.
The very first thing I would try is switching to getpwent_r(), because
the fact that getpwent() uses a static buffer internally may well be
confusing Chicken.
--
John
I wish I could take that advice, but getpwent_r is not available on
OpenBSD. I do take care to call it sequentially, and the call is
not being made from, say, multiple Scheme threads. Invocation of
each loop in the (let loop ...) would have to be reordered by the
compiler (I don't believe that
I'm getting an error message when I use |(declare (block))|.
Using the same code in my previous email about invalid forwarded
object (repeated here), I declare it as an egg like so (the only
change is wrapping it around a module):
++ csc -s -j pwent pwent.so pwent-egg.scm
(module pwent
Hi Alyn,
On 09/12/13 06:29, .alyn.post. wrote:
What is the magic phrase to tell foreign-lambda a parameter is a
char**?
`(c-pointer c-string)` or `(c-pointer nonnull-c-string)` should do it.
Cheers,
Evan
___
Chicken-users mailing list
On Mon, Dec 09, 2013 at 08:41:59AM +1300, Evan Hanson wrote:
Hi Alyn,
On 09/12/13 06:29, .alyn.post. wrote:
What is the magic phrase to tell foreign-lambda a parameter is a
char**?
`(c-pointer c-string)` or `(c-pointer nonnull-c-string)` should do it.
Cheers,
Evan
Bless you