search for: output_spaces

Displaying 17 results from an estimated 17 matches for "output_spaces".

2018 Feb 22
0
[PATCH 1/5] v2v: DOM: Add doc_to_string function.
...but readability is useful. *) -let rec node_to_chan ?(indent = 0) chan = function - | PCData str -> output_string chan (xml_quote_pcdata str) +let rec node_to_buf ?(indent = 0) buf = function + | PCData str -> + Buffer.add_string buf (xml_quote_pcdata str) | Comment str -> - output_spaces chan indent; - fprintf chan "<!-- %s -->" (xml_quote_pcdata str) - | Element e -> element_to_chan ~indent chan e -and element_to_chan ?(indent = 0) chan + buffer_add_spaces buf indent; + bprintf buf "<!-- %s -->" (xml_quote_pcdata str) + | Element e -...
2014 Dec 04
2
[PATCH v3 0/2] v2v: When picking a default kernel, favour non-debug
Since v2: - Use string_suffix kernel_name "-debug" || string_suffix kernel_name "-dbg" - This requires addition of the string_suffix function and some tests
2017 Oct 08
0
[PATCH v2 3/4] common/mlstdutils: Introduce Option submodule.
...| None -> () + | Some x -> f x + + let map f = function + | None -> None + | Some x -> Some (f x) + + let default def = function + | None -> def + | Some x -> x +end + let (//) = Filename.concat let quote = Filename.quote @@ -575,10 +589,6 @@ and output_spaces chan n = for i = 0 to n-1 do output_char chan ' ' done let unique = let i = ref 0 in fun () -> incr i; !i -let may f = function - | None -> () - | Some x -> f x - type ('a, 'b) maybe = Either of 'a | Or of 'b let protect ~f ~finally = diff --git a/common/...
2017 Jun 15
0
[PATCH v6 04/41] mllib: Split ‘Common_utils’ into ‘Std_utils’ + ‘Common_utils’.
...t len = String.length str in + _wrap chan indent 0 0 len str + +and _wrap chan indent column i len str = + if i < len then ( + let (j, break) = _wrap_find_next_break i len str in + let next_column = + if column + (j-i) >= 76 then ( + output_char chan '\n'; + output_spaces chan indent; + indent + (j-i) + 1 + ) + else column + (j-i) + 1 in + output chan (Bytes.of_string str) i (j-i); + match break with + | WrapEOS -> () + | WrapSpace -> + output_char chan ' '; + _wrap chan indent next_column (j+1) len str + | Wra...
2018 Feb 22
11
[PATCH 0/5] v2v: Add -o rhv-upload output mode.
The first four patches are straightforward. The final patch adds the -o rhv-upload output mode. It is still spooling into a temporary file because I've had some trouble getting streaming conversions working. There are other problems as outlined in the commit message, so this patch is not ready for upstream but is good for discussion. Also I hit this, which I'm assuming for now will be
2017 Oct 08
4
[PATCH 0/3] common/mlstdutils: Add Std_utils List and Option modules.
In Std_utils we already extend Char and String. These commits take it a little further by extending List and adding a new Option submodule. All basically simple refactoring. Rich.
2017 Oct 08
7
[[PATCH v2 0/4] common/mlstdutils: Add Std_utils List and Option modules.
This time including the first commit ...
2015 Oct 06
0
[PATCH 5/5] mllib: Replace various ad hoc string_* functions with String.*
...concat "" ( + List.map ( + fun _ -> + let c = Random.int 36 in + let c = chars.[c] in + make 1 c + ) [1;2;3;4;5;6;7;8] + ) end let (//) = Filename.concat @@ -123,114 +223,6 @@ and _wrap_find_next_break i len str = and output_spaces chan n = for i = 0 to n-1 do output_char chan ' ' done -let string_prefix str prefix = - let n = String.length prefix in - String.length str >= n && String.sub str 0 n = prefix - -let string_suffix str suffix = - let sufflen = String.length suffix - and len = String.length...
2017 Apr 11
4
v2v: Implement -i vmx to read VMware vmx files directly (RHBZ#1441197).
https://bugzilla.redhat.com/show_bug.cgi?id=1441197
2015 Oct 06
10
[PATCH 0/5] mllib: Hide bad String functions and miscellaneous refactoring.
Hide/prevent the use of bad string functions like String.lowercase. These are replaced by safe functions that won't break UTF-8 strings. Other miscellaneous refactoring. Rich.
2017 Nov 21
2
[PATCH v3 0/2] common/mlstdutils: Extend the List module.
v2 -> v3: - Renamed List.assoc_ -> List.assoc_lbl. - Rebased on top of current master branch. Rich.
2017 Jun 19
16
[PATCH v7 00/13] Refactor utilities
This is just the utilities part of the patch series from: https://www.redhat.com/archives/libguestfs/2017-June/msg00103.html I believe this addresses everything raised in comments on that patch series. Rich.
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...#39;..'9' -> true - | 'a'..'f' -> true - | 'A'..'F' -> true - | _ -> false - type wrap_break_t = WrapEOS | WrapSpace | WrapNL let rec wrap ?(chan = stdout) ?(indent = 0) str = @@ -237,6 +304,8 @@ and _wrap_find_next_break i len str = and output_spaces chan n = for i = 0 to n-1 do output_char chan ' ' done +let (|>) x f = f x + (* Drop elements from a list while a predicate is true. *) let rec dropwhile f = function | [] -> [] @@ -255,6 +324,13 @@ let rec filter_map f = function | Some y -> y :: filter_map f xs...
2017 Jun 09
12
[PATCH 00/12] Refactor utility functions.
This turned out to be rather more involved than I thought. We have lots of utility functions, spread all over the repository, with not a lot of structure. This moves many of them under common/ and structures them so there are clear dependencies. This doesn't complete the job by any means. Other items I had on my to-do list for this change were: - Split up mllib/common_utils into: -
2017 Jun 12
32
[PATCH v5 00/32] Refactor utilities, implement some APIs in OCaml.
This is a combination of: https://www.redhat.com/archives/libguestfs/2017-June/msg00046.html [PATCH 00/12] Refactor utility functions. plus: https://www.redhat.com/archives/libguestfs/2017-June/msg00023.html [PATCH v3 00/19] Allow APIs to be implemented in OCaml. with the second patches rebased on top of the utility refactoring, and some other adjustments and extensions. This passes
2017 Jun 15
45
[PATCH v6 00/41] Refactor utilities, reimplement inspection in the daemon.
v5: https://www.redhat.com/archives/libguestfs/2017-June/msg00065.html Since v5, this now implements inspection almost completely for Linux and Windows guests. Rich.
2017 Jun 21
45
[PATCH v8 00/42] Refactor utilities and reimplement inspection.
v7 was: https://www.redhat.com/archives/libguestfs/2017-June/msg00169.html https://www.redhat.com/archives/libguestfs/2017-June/msg00184.html I believe this addresses all comments received so far. Also it now passes a test where I compared about 100 disk images processed with old and new virt-inspector binaries. The output is identical in all cases except one which is caused by a bug in blkid