mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
generator: Don't die if an API call isn't listed in API versions file.
For example, it may just have been added.
This commit is contained in:
@@ -39,6 +39,5 @@ let load_api_versions filename =
|
||||
close_in chan
|
||||
|
||||
let lookup_api_version sym =
|
||||
try Hashtbl.find hash sym
|
||||
with Not_found ->
|
||||
failwithf "API symbol \"%s\" not found in API versions file" sym
|
||||
try Some (Hashtbl.find hash sym)
|
||||
with Not_found -> None
|
||||
|
||||
@@ -25,7 +25,8 @@
|
||||
val load_api_versions : string -> unit
|
||||
(** Load the data from the named file. *)
|
||||
|
||||
val lookup_api_version : string -> string
|
||||
val lookup_api_version : string -> string option
|
||||
(** [lookup_api_version c_api] looks up the version that the C API call
|
||||
(which must be the full C name, eg. ["guestfs_launch"]) was
|
||||
added. This returns the version string, eg. ["0.3"]. *)
|
||||
added. This returns the version string, eg. [Some "0.3"], or
|
||||
[None] if no version could be found. *)
|
||||
|
||||
@@ -255,8 +255,10 @@ L</KEYS AND PASSPHRASES> for more information.\n\n";
|
||||
| None -> ()
|
||||
| Some txt -> pr "%s\n\n" txt
|
||||
);
|
||||
let version = lookup_api_version name in
|
||||
pr "(Added in %s)\n\n" version;
|
||||
(match lookup_api_version name with
|
||||
| Some version -> pr "(Added in %s)\n\n" version
|
||||
| None -> ()
|
||||
);
|
||||
|
||||
(* Handling of optional argument variants. *)
|
||||
if optargs <> [] then (
|
||||
|
||||
Reference in New Issue
Block a user