|
From: | Peter Feigl |
Subject: | [MIT-Scheme-devel] FFI and KyotoCabinet |
Date: | Wed, 23 Mar 2011 22:48:13 +0100 |
User-agent: | Mutt/1.5.21 (2010-09-15) |
Hello! I've been trying to create bindings for KyotoCabinet (a berkeley-db-like database) with the FFI bindings, and have largely succeeded. A couple of questions remain: - How can I get MIT-Scheme to look for the files that are generated by the FFI in the current working directory, instead of the main lib directory? Development would be much easier that way. Right now, I get the following error message: <Unable to find file "/usr/lib/mit-scheme-i386/kyotocabinet-types" because: File does not exist.> - Is there a way to include extern variables? For example, I have the following declaration in the header file: <extern const char* const KCVERSION;> Right now, I include it as an enum, but it would be great if I could somehow correctly access this value. - Does c-peek-cstring copy the actual string data? Can I release the memory, even if I want to keep using the string? - (Not related to KyotoCabinet, but to Berkeley DB): How can I access and call function pointers that are structure members? Berkeley DB defines roughly the following: <struct DB { int (*open)(DB *, DB_TXN *, const char *, const char *, DBTYPE, u_int32_t, int); };> Is there a way I can call this open function? - If it is useful, I'd like to contribute this code to the main MIT-Scheme repository. How do I go about doing this? "Just" prepare a patch against git and email it? Where to? Thanks for making MIT-Scheme such a great system. Peter
kyotocabinet.scm
Description: Text document
kyotocabinet.cdecl
Description: Text document
Makefile
Description: Text document
pgpwQcNJSZzd2.pgp
Description: PGP signature
[Prev in Thread] | Current Thread | [Next in Thread] |