chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] return a pair of ints from a C function?


From: Shawn Rutledge
Subject: Re: [Chicken-users] return a pair of ints from a C function?
Date: Thu, 31 Jul 2008 23:15:21 -0700

On Thu, Jul 31, 2008 at 3:59 PM, felix winkelmann <address@hidden> wrote:
>>> either have to use `foreign-primitive`(to create a CPS function), or
>>
>> Why don't you prefer that approach?
>
> Well, the pass-the-box approach appeared simpler, but foreign-primitive
> is probably the cleaner approach and doesn't require you to create
> a wrapper function.

Thanks for your help.

This works:

(define g2d_glyphs_baseline (foreign-primitive scheme-object
((g2d-glyph-vector glyphs))
        "C_word* a = C_alloc(C_SIZEOF_PAIR);
        return(C_pair (&a, C_fix(10), C_fix(256)));" ))

but is there a way to do it in a C source file rather than having to
write C inside quotes?




reply via email to

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