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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jocelyn Serot <jserot@l...>
Subject: [Caml-list] Caml Wrappers
Ravi Chamarty writes:
> 
> Hi ,
> 
>  I am trying to write OCaml interfaces around a C library.  I tried
> looking at the Unix library and trying to understand it. However, I have
> much complex data types to deal with.I was wondering if anyone could help
> me out. 
> 
> Here is a signature of one of the C functions:
> 
> an_flow_t * 
> an_flow_create(void *mem, an_cred_t *cred, an_cpuspec_t *cspec,
> 		an_memspec_t *mspec, an_flowinit_func_t init, 
> 		void *initarg, an_flowterm_func_t term)
> 
> 
> Each of these types are complex structures in C. How do I represent these
> in OCaml. Is it useful to use classes and methods? Or do I use abstract
> types to represent them ?
> 
> An example of one of these structures is given below:
> 
> [...]
> I would be grateful for any help.
> 
> Thanks
> Ravi
> 

Did you have a look a Camlidl (http://pauillac.inria.fr/caml/camlidl) ?
It can generate rather complex stub code for you.

Jocelyn

-- 
E-mail: Jocelyn.Serot@l_a_s_m_e_a.u_n_i_v-bpclermont.fr .....................
S-mail: LASMEA - UMR 6602 CNRS, Universite Blaise Pascal, 63177 Aubiere cedex
Tel: (33) 04 73.40.73.30 - Fax: (33) 04 73.40.72.62 .........................
Valid e-mail: remove underscores (sorry, this is prevention against junk mail
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr