[racket] FFI - static c arrays inside a struct and libgit2 bindings

From: Joan Arnaldich (jarnaldich at gmail.com)
Date: Fri Sep 2 14:50:52 EDT 2011

Hi there!

In an attempt to learn racket ffi, I've started to work on the
bindings for the libgit2 library.

I seem to have hit a (small) wall with this struct:

typedef struct git_index_entry_unmerged {
	unsigned int mode[3];
	git_oid oid[3];
	char *path;
} git_index_entry_unmerged;

Is there a way to declare static C array fields with
define-cstruct? Couldn't find it in the docs...
If there isn't, what would be the most common way to tackle this?
(pointers and ctype-sizeof / ctype-alignof?)

(BTW, the repo I'll be using is at:
https://github.com/jarnaldich/racket-git)

Thanks in advance,

Joan.


Posted on the users mailing list.