generator: Add Pointer parameter type to the generator.
authorRichard Jones <rjones@redhat.com>
Tue, 9 Nov 2010 12:08:06 +0000 (12:08 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Thu, 18 Nov 2010 11:34:32 +0000 (11:34 +0000)
commite42f16b2f1a59340d957d67cb7cbf621de9e53fc
tree5d771657cb61d693667ace856826d2e1ed5824d3
parent678876aeefc96cb6e11aae31f279abf64895e6e5
generator: Add Pointer parameter type to the generator.

This allows generic "foo *bar" pointers to be passed to
library functions (not to daemon functions).

In the language bindings (except Perl) these are handled
as generic int64s with the assumption being that any
pointer can be converted to and from this.  There is room
to add specific support for some pointer types in future
by specializing the match cases.  However this is inherently
tricky because it depends on the implementation details of
other bindings (eg. to support virDomainPtr in OCaml depends
on the implementation details of the ocaml-libvirt project).

Perl is slightly different in that you have to supply a
typemap.  Again this would depend on the implementation
detail of an external library unless you supplied a generic
typemap for int64.
(cherry picked from commit 4ada0a7815075c9cbe9d8b00da791c105ae739a9)
17 files changed:
generator/generator_bindtests.ml
generator/generator_c.ml
generator/generator_capitests.ml
generator/generator_checks.ml
generator/generator_csharp.ml
generator/generator_daemon.ml
generator/generator_fish.ml
generator/generator_haskell.ml
generator/generator_java.ml
generator/generator_ocaml.ml
generator/generator_perl.ml
generator/generator_php.ml
generator/generator_python.ml
generator/generator_ruby.ml
generator/generator_types.ml
generator/generator_utils.ml
generator/generator_xdr.ml