For what it's worth, I have written a small berkeley DB interface (for version 3.3.11, the one found in RH 7.3), which I've attached to this email. The ml is actually embedded inside the bdb_stubs.c file in comment lines beginning with "//+". There's a little python script called ocextr(yeah, yeah, I should have written it in ocaml) for extracting the appropriate code. The makefile is optimized for my own little environment, and this isn't really ready for public consumption, but you might find a use for it. It has decent support for dbenvs, direct db access and cursors. At some point I'll add transactions, but I haven't gotten around to it yet. If you find any bugs, please tell me about them. Also, if you figure out a nice way of doing this with camlidl, please post it to the list. I'd love to be avoid hand-coding this kind of interface. y On Wed, 2002-07-17 at 18:09, Michael Tucker wrote: > Hi, > > I am trying to write an O'Caml program that interfaces with Berkeley DB > (which has a C interface). Some of the calls include arguments that are > pointers to opaque structures -- that is, I pass a pointer, the server > goes to the address, fills it, but then my only use of it is to pass it > back to the server. In other words, I will not be examining or altering > the contents, just holding it to preserve state. Some of these structures > are fairly complex, and may require a lot of code-schlepping to get into > IDL format, so it would be great if I could signify that there is a truly > opaque (I don't care about its layout, I just know the size) structure > coming into O'Caml. I looked in the camlidl manual, but didn't see any > attributes that looked relevant. I would like the data to be transferred > and stored in OCaml, but I am fine with it being stored as raw data (a > string?). Is there anything like this that will let me effectively pickle > and unpickle structures without supplying any information beyond their > size? > > I'm sure I'm fouling up my explanation, so feel free to send questions... > I am just hoping that someone has run into a similar situation in the > past! > > Thanks, > Mike > > ------------------- > To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr > Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners -- |--------/ Yaron M. Minsky \--------| |--------\ http://www.cs.cornell.edu/home/yminsky/ /--------| Open PGP --- KeyID B1FFD916 (new key as of Dec 4th) Fingerprint: 5BF6 83E1 0CE3 1043 95D8 F8D5 9F12 B3A9 B1FF D916