summaryrefslogtreecommitdiffstats
path: root/generator/generator_checks.ml
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-11-09 12:08:06 +0000
committerRichard W.M. Jones <rjones@redhat.com>2010-11-10 10:52:12 +0000
commit4ada0a7815075c9cbe9d8b00da791c105ae739a9 (patch)
tree3dbc7ddf2571460e58f366bfad39e5e66ed43891 /generator/generator_checks.ml
parenteaedf025f5c45a4e05cbf25e145215d48bea8f8d (diff)
downloadlibguestfs-4ada0a7815075c9cbe9d8b00da791c105ae739a9.tar.gz
libguestfs-4ada0a7815075c9cbe9d8b00da791c105ae739a9.tar.xz
libguestfs-4ada0a7815075c9cbe9d8b00da791c105ae739a9.zip
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.
Diffstat (limited to 'generator/generator_checks.ml')
-rw-r--r--generator/generator_checks.ml13
1 files changed, 13 insertions, 0 deletions
diff --git a/generator/generator_checks.ml b/generator/generator_checks.ml
index 34740470..0fb8ea42 100644
--- a/generator/generator_checks.ml
+++ b/generator/generator_checks.ml
@@ -129,6 +129,19 @@ let () =
) optargs
) all_functions;
+ (* Some parameter types not supported for daemon functions. *)
+ List.iter (
+ fun (name, (_, args, optargs), _, _, _, _, _) ->
+ let check_arg_type = function
+ | Pointer _ ->
+ failwithf "Pointer is not supported for daemon function %s."
+ name
+ | _ -> ()
+ in
+ List.iter check_arg_type args;
+ List.iter check_arg_type optargs;
+ ) daemon_functions;
+
(* Check short descriptions. *)
List.iter (
fun (name, _, _, _, _, shortdesc, _) ->