[plt-scheme] large blocks inside cstructs

From: Dave Herman (dherman at ccs.neu.edu)
Date: Sun Dec 17 23:50:57 EST 2006

I'm having trouble getting started with foreign.ss. I'm trying to define 
a struct type whose corresponding C definition looks something like:

     typedef struct {
       ...
       char AdapterName[260];
       char Description[132];
       ...
     } IP_ADAPTER_INFO;

I can't figure out how to do the declaration. I thought

     (define-cstruct _IP_ADAPTER_INFO (...
                                       [AdapterName (_bytes o 260)]
                                       [Description (_bytes o 132)]
                                     ...))

would do the trick, but it's saying those elements only have a size of 4 
bytes. How should I do this?

Other than putting 260 / 4 dummy _int32 slots in a row, I mean. :)

Thanks,
Dave


Posted on the users mailing list.