+let errcode_of_ret = function
+ | RConstOptString _ ->
+ `CannotReturnError
+ | RErr | RInt _ | RBool _ | RInt64 _ ->
+ `ErrorIsMinusOne
+ | RConstString _
+ | RString _ | RBufferOut _
+ | RStringList _ | RHashtable _
+ | RStruct _ | RStructList _ ->
+ `ErrorIsNULL
+
+let string_of_errcode = function
+ | `ErrorIsMinusOne -> "-1"
+ | `ErrorIsNULL -> "NULL"
+
+(* Generate a uuidgen-compatible UUID (used in tests). However to
+ * avoid having the UUID change every time we rebuild the tests,
+ * generate it as a function of the contents of the
+ * generator_actions.ml file.
+ *
+ * Originally I thought uuidgen was using RFC 4122, but it doesn't
+ * appear to.
+ *
+ * Note that the format must be 01234567-0123-0123-0123-0123456789ab
+ *)