chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] long pointer equivalent


From: felix
Subject: Re: [Chicken-users] long pointer equivalent
Date: Sun, 25 Aug 2002 18:40:11 +0200

Peter Keller wrote:
> 
> >
> > Or perhaps I'm misunderstanding you: if you just need a pointer to
> > long long, without the need for dereferencing, you can simply use
> >
> > (pointer "long long")
> 
> Ah, I don't need a pointer to long long. :) I need a pointer to a long
> which is conspicuously missing from your chicken->C type conversion chart.

(pointer "long")

> 
> See, the function I want to write an FFI for is this:
> int compress(Bytef *dest,uLongf *destLen, const Bytef *source, uLong 
> sourceLen);
> 
> Bytef is a:
> typedef unsigned char Bytef;
> 
> uLongf is a bit more complicated:
> 
> #   define FAR
> typedef unsigned long  uLong; /* 32 bits or more */
> typedef uLong FAR uLongf;
> 
> The problem comes in that I should prolly represent the vectors as
> u8vector and friends and write careful wrappers around these functions to
> make sure the data gets massaged correctly into the right form.
> 
> In this case, I prolly actually need u64vector, s64vector.
> 
> The trouble is I'm trying to figure out how to easily make an array in
> chicken of the right type and pass it to these functions that expect it.
> In short, I'm still a little confused, I'm sure time and beating on the
> problem will show the solution.

You shouldn't worry about 64-bit platforms, yet. That way you can use
`s32vector'/`u32vector' as foreign argument types and everything works.

> 
> Thanks for all of your help. I appreciate it.

You are welcome. 


cheers,
felix




reply via email to

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