[Caml-list] How to read different ints from a Bigarray?

2009-10-28 Thread Goswin von Brederlow
Hi, I'm working on binding s for linux libaio library (asynchron IO) with a sharp eye on efficiency. That means no copying must be done on the data, which in turn means I can not use string as buffer type. The best type for this seems to be a (int, int8_unsigned_elt, c_layout) Bigarray.Array1.t.

[Caml-list] Re: How to read different ints from a Bigarray?

2009-10-28 Thread Sylvain Le Gall
Hello, On 28-10-2009, Goswin von Brederlow goswin-...@web.de wrote: Hi, I'm working on binding s for linux libaio library (asynchron IO) with a sharp eye on efficiency. That means no copying must be done on the data, which in turn means I can not use string as buffer type. The best type

Re: [Caml-list] Re: How to read different ints from a Bigarray?

2009-10-28 Thread Goswin von Brederlow
Sylvain Le Gall sylv...@le-gall.net writes: Hello, On 28-10-2009, Goswin von Brederlow goswin-...@web.de wrote: Hi, I'm working on binding s for linux libaio library (asynchron IO) with a sharp eye on efficiency. That means no copying must be done on the data, which in turn means I can

[Caml-list] Re: How to read different ints from a Bigarray?

2009-10-28 Thread Sylvain Le Gall
On 28-10-2009, Goswin von Brederlow goswin-...@web.de wrote: Sylvain Le Gall sylv...@le-gall.net writes: Hello, On 28-10-2009, Goswin von Brederlow goswin-...@web.de wrote: Hi, Well, we talk about this a little bit, but here is my opinion: - calling a C function to add a single int will

Re: [Caml-list] How to read different ints from a Bigarray?

2009-10-28 Thread Olivier Andrieu
On Wed, Oct 28, 2009 at 14:54, Goswin von Brederlow goswin-...@web.de wrote: Hi, I'm working on binding s for linux libaio library (asynchron IO) with a sharp eye on efficiency. That means no copying must be done on the data, which in turn means I can not use string as buffer type. hmm I

Re: [Caml-list] How to read different ints from a Bigarray?

2009-10-28 Thread Gerd Stolpmann
Am Mittwoch, den 28.10.2009, 14:54 +0100 schrieb Goswin von Brederlow: Hi, I'm working on binding s for linux libaio library (asynchron IO) with a sharp eye on efficiency. That means no copying must be done on the data, which in turn means I can not use string as buffer type. The best

[Caml-list] Re: How to read different ints from a Bigarray?

2009-10-28 Thread Sylvain Le Gall
Hello, On 28-10-2009, Olivier Andrieu oandr...@nerim.net wrote: On Wed, Oct 28, 2009 at 14:54, Goswin von Brederlow goswin-...@web.de wrote: Yes. really ? Given the number of Pbigarray* constructors in the compiler code, I'd be surprised :) No I think that for some cases like accessing a

Re: [Caml-list] How to read different ints from a Bigarray?

2009-10-28 Thread Goswin von Brederlow
Xavier Leroy xavier.le...@inria.fr writes: Goswin von Brederlow wrote: I'm working on binding s for linux libaio library (asynchron IO) with a sharp eye on efficiency. That means no copying must be done on the data, which in turn means I can not use string as buffer type. The best type

Re: [Caml-list] Re: How to read different ints from a Bigarray?

2009-10-28 Thread Goswin von Brederlow
Sylvain Le Gall sylv...@le-gall.net writes: On 28-10-2009, Goswin von Brederlow goswin-...@web.de wrote: Sylvain Le Gall sylv...@le-gall.net writes: On 28-10-2009, Goswin von Brederlow goswin-...@web.de wrote: Sylvain Le Gall sylv...@le-gall.net writes: On 28-10-2009, Goswin von Brederlow

[Caml-list] Re: How to read different ints from a Bigarray?

2009-10-28 Thread Sylvain Le Gall
On 28-10-2009, Goswin von Brederlow goswin-...@web.de wrote: Sylvain Le Gall sylv...@le-gall.net writes: On 28-10-2009, Goswin von Brederlow goswin-...@web.de wrote: Sylvain Le Gall sylv...@le-gall.net writes: On 28-10-2009, Goswin von Brederlow goswin-...@web.de wrote: Sylvain Le Gall

[Caml-list] Binding C libraries which use variable arguments (stdarg.h)

2009-10-28 Thread Adrien
Hi, I am currently trying to bind a C function that takes variables arguments, like foo(int a, ...). I can't find how to make a C stub for that function. I found camlidl didn't support idl's vararg keyword and pidl (p stands for perl) didn't either. I was told to try libffi but it doesn't

Re: [Caml-list] Binding C libraries which use variable arguments (stdarg.h)

2009-10-28 Thread Basile STARYNKEVITCH
Adrien wrote: Hi, I am currently trying to bind a C function that takes variables arguments, like foo(int a, ...). I can't find how to make a C stub for that function. I am assuming that the a is the number of actual arguments, so you call foo(3, x, y, z) foo(5, t, t+1, t+3, 0, 4) foo(0)

Re: [Caml-list] Re: How to read different ints from a Bigarray?

2009-10-28 Thread blue storm
On Wed, Oct 28, 2009 at 6:57 PM, Goswin von Brederlow goswin-...@web.de wrote: Maybe ideal would be a format string based interface that calls C with a format string and a record of values. Because what I really need is to read/write records in an architecture independend way. Something like