From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA27405; Sat, 20 Mar 2004 17:59:41 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA27580 for ; Sat, 20 Mar 2004 17:59:40 +0100 (MET) Received: from kefka.frap.net (adsl-64-162-212-212.dsl.snfc21.pacbell.net [64.162.212.212]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i2KH0AKW012646 for ; Sat, 20 Mar 2004 18:00:11 +0100 Received: by kefka.frap.net (Postfix, from userid 1000) id C4B9B6A4E31; Sat, 20 Mar 2004 08:59:32 -0800 (PST) Date: Sat, 20 Mar 2004 08:59:30 -0800 From: Kenneth Knowles To: caml-list@inria.fr Subject: [Caml-list] C binding advice Message-ID: <20040320165930.GA10368@kefka.frap.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; knowles:99 buffer:01 char:01 sizeof:01 buffer:01 noone:01 pointers:01 ints:01 ocaml:01 caml:01 int:01 int:01 binding:03 binding:03 fetch:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Keywords: X-UID: 273 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