X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=generator%2Fgenerator_utils.ml;h=6dc11bfd84474e4fd45cde801dbcbbb41ce656da;hp=e3a74e08c157ffec96e65070342a95bd195a52ca;hb=d8346d5d6428c7293d1ddf58e4f9ec4b7de25380;hpb=451a28349b11fe08cb3f7ca84e58b6e69646707b diff --git a/generator/generator_utils.ml b/generator/generator_utils.ml index e3a74e0..6dc11bf 100644 --- a/generator/generator_utils.ml +++ b/generator/generator_utils.ml @@ -83,8 +83,8 @@ let rstructs_used_by functions = in List.iter ( - fun (_, style, _, _, _, _, _) -> - match fst style with + fun (_, (ret, _, _), _, _, _, _, _) -> + match ret with | RStruct (_, structname) -> update structname RStructOnly | RStructList (_, structname) -> update structname RStructListOnly | _ -> () @@ -230,7 +230,7 @@ let map_chars f str = let name_of_argt = function | Pathname n | Device n | Dev_or_Path n | String n | OptString n | StringList n | DeviceList n | Bool n | Int n | Int64 n - | FileIn n | FileOut n | BufferIn n | Key n -> n + | FileIn n | FileOut n | BufferIn n | Key n | Pointer (_, n) -> n let seq_of_test = function | TestRun s | TestOutput (s, _) | TestOutputList (s, _) @@ -239,6 +239,8 @@ let seq_of_test = function | TestOutputTrue s | TestOutputFalse s | TestOutputLength (s, _) | TestOutputBuffer (s, _) | TestOutputStruct (s, _) + | TestOutputFileMD5 (s, _) + | TestOutputDevice (s, _) | TestLastFail s -> s let c_quote str = @@ -301,3 +303,14 @@ let pod2text ~width name longdesc = pod2text_memo_updated (); lines +(* Compare two actions (for sorting). *) +let action_compare (n1,_,_,_,_,_,_) (n2,_,_,_,_,_,_) = compare n1 n2 + +let chars c n = + let str = String.create n in + for i = 0 to n-1 do + String.unsafe_set str i c + done; + str + +let spaces n = chars ' ' n