[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] working with bit- and byte-level structures
From: |
Martin DeMello |
Subject: |
Re: [Chicken-users] working with bit- and byte-level structures |
Date: |
Wed, 16 Apr 2008 14:39:47 -0700 |
On Wed, Apr 16, 2008 at 12:09 PM, Hans Bulfone <address@hidden> wrote:
> On Wed, Apr 16, 2008 at 11:38:44AM -0700, Martin DeMello wrote:
> > Ah - okay, if it's serialisation-specific, it's not what I'm looking
> > for. I was looking for an analogue to the C trick of interpreting a
> > block of bits as a struct quickly and efficiently.
>
> maybe you can use define-foreign-record to define the struct.
> but this doesn't work at the bit level, afaik there is no way to say
> e.g. unsigned int flag : 1;
>
> see http://chicken.wiki.br/Accessing%20external%20objects
> and http://chicken.wiki.br/Foreign%20type%20specifiers
Thanks, define-foreign-record looks like what I wanted. The
bit-accessors were just a hope - C doesn't really have much support
for them either.
martin