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>
Wed, 10 Nov 2010 10:52:12 +0000 (10:52 +0000)
commit4ada0a7815075c9cbe9d8b00da791c105ae739a9
tree3dbc7ddf2571460e58f366bfad39e5e66ed43891
parenteaedf025f5c45a4e05cbf25e145215d48bea8f8d
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.
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