--- In ocaml_beginners%40yahoogroups.com">ocaml_beginners
yahoogroups.com, Richard Jones <rich
...>
wrote:
>
> On Sun, Dec 24, 2006 at 02:35:02AM -0000, mqznudt wrote:
> > I want to use the module cfg.ml in CIL,call the functions in
that
> > module in C program.For example ,for a function cfgFun according
to
> > the method,first step:
> > let rec cfgFun(fd:fundec):int=
> > ....................
> > ....................
> > let_=Callback.register "cfgFun" cfgFun
> > second step:call this function from C
> > ....................
> > ....................
> > int cfgFun(?????)
> > {
> > ....................
> > ....................
> > }
> > the problem is what to use as a parameter in the parentheses.
>
> I'm a bit confused here. Did you call caml_named_value to get the
> value of the named callback? Did you try passing this to
> caml_callback? If in doubt, read section 18.7.2 of the manual
> carefully:
>
> http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html
>
> Rich.
>
> --
> Richard Jones, CTO Merjis Ltd.
> Merjis - web marketing and technology - http://merjis.com
> Internet Marketing and AdWords courses -
http://merjis.com/courses - NEW!
> Merjis blog - http://blog.merjis.com - NEW!
>First of all,thank you for your answer,perhaps i didn't say my
problem clearly and forgive me
the most difficult I meet is that some data structures in OCaml
can't be expressed in C ,for example "fd:fundec" I have mentioned
above,is a union of some complex data structures,I can't use modules
including functions whose parameters like this!
I will read what you gave me again,thanks and MERRY CHIRASTMAS to
everyone
Meng Qingzhi
.