Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* [Caml-list] C binding advice
@ 2004-03-20 16:59 Kenneth Knowles
  0 siblings, 0 replies; only message in thread
From: Kenneth Knowles @ 2004-03-20 16:59 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-03-20 16:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-20 16:59 [Caml-list] C binding advice Kenneth Knowles

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox