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: Peter Keller
Subject: Re: [Chicken-users] long pointer equivalent
Date: Sun, 25 Aug 2002 00:20:23 -0500
User-agent: Mutt/1.2i

On Sat, Aug 24, 2002 at 05:22:58PM +0200, felix wrote:
> Peter Keller wrote:
> > 
> > 
> > 3) A foreign type for long pointer/unsigned long pointer.
> > This is what I need.
> > > 
> > Although, I could very well be misunderstanding the solution you've given
> > and what you've said just might be perfect.
> > 
> 
> 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.

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.

Thanks for all of your help. I appreciate it.

-pete




reply via email to

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