Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] C binding advice
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Kenneth Knowles <kknowles@b...>
Subject: [Caml-list] C binding advice
Hi all,

I'm writing a binding to the freetds library, and I have the following dilemma,
which I am not sure of the best way to solve.  Data is retrieved from the
database by binding a buffer, and the buffer's contents change repeatedly.

char x[MAX_LEN];
int y;

bind(resultset, 1, &x, MAX_LEN)
bind(resultset, 2, &y, sizeof(int));

while( fetch(resultset) )
{
	/* use x and y in some code */
}

Is there a caml construct that is ideal for this bound buffer which continually
gets re-assigned?  I've seen it with strings, but I also need to do it for int32.
If noone has a better idea I may actually make an abstract type of "bound
pointers" from which strings or ints can be extracted in ocaml.

Any advice?

Kenn

-------------------
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