git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rewrite virt-cat in C.
[libguestfs.git]
/
generator
/
generator_utils.ml
diff --git
a/generator/generator_utils.ml
b/generator/generator_utils.ml
index
b7401db
..
6dc11bf
100644
(file)
--- a/
generator/generator_utils.ml
+++ b/
generator/generator_utils.ml
@@
-83,8
+83,8
@@
let rstructs_used_by functions =
in
List.iter (
in
List.iter (
- fun (_,
style
, _, _, _, _, _) ->
- match
fst style
with
+ fun (_,
(ret, _, _)
, _, _, _, _, _) ->
+ match
ret
with
| RStruct (_, structname) -> update structname RStructOnly
| RStructList (_, structname) -> update structname RStructListOnly
| _ -> ()
| 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
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, _)
let seq_of_test = function
| TestRun s | TestOutput (s, _) | TestOutputList (s, _)
@@
-305,3
+305,12
@@
let pod2text ~width name longdesc =
(* Compare two actions (for sorting). *)
let action_compare (n1,_,_,_,_,_,_) (n2,_,_,_,_,_,_) = compare n1 n2
(* 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