X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=generator%2Fgenerator_utils.mli;h=5dc4da25fa3d8b7c257b5658a6529c088496b4f9;hp=5104a1620f4f72039ae0652fe8701770999fe8cf;hb=dc8e4b057ecd3984d7c27c8e;hpb=b4c853f7d493af1d71f352832fed29eb7e377e8f diff --git a/generator/generator_utils.mli b/generator/generator_utils.mli index 5104a16..5dc4da2 100644 --- a/generator/generator_utils.mli +++ b/generator/generator_utils.mli @@ -1,5 +1,5 @@ (* libguestfs - * Copyright (C) 2009-2010 Red Hat Inc. + * Copyright (C) 2009-2011 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,17 @@ (** Useful utility functions. *) +val errcode_of_ret : Generator_types.ret -> Generator_types.errcode +(** Map [ret] type to the error indication that the action returns, + eg. [errcode_of_ret RErr] => [`ErrorIsMinusOne] (meaning that + these actions return [-1]). + + Note that [RConstOptString] cannot return an error indication, and + this returns [`CannotReturnError]. Callers must deal with it. *) + +val string_of_errcode : [`ErrorIsMinusOne|`ErrorIsNULL] -> string +(** Return errcode as a string. Untyped for [`CannotReturnError]. *) + val uuidgen : unit -> string (** Generate a random UUID (used in tests). *)