search for: add_char

Displaying 20 results from an estimated 36 matches for "add_char".

2018 Feb 22
0
[PATCH 1/5] v2v: DOM: Add doc_to_string function.
...er.add_string buf ">"; let last_child_was_element = ref false in List.iter ( function | Element _ as child -> last_child_was_element := true; - output_char chan '\n'; - node_to_chan ~indent:(indent+2) chan child; + Buffer.add_char buf '\n'; + node_to_buf ~indent:(indent+2) buf child; | PCData _ as child -> last_child_was_element := false; - node_to_chan ~indent:(indent+2) chan child; + node_to_buf ~indent:(indent+2) buf child; | Comment _ as child -> last_chi...
2017 Jul 31
0
[PATCH v11 03/10] daemon: utils: New functions unix_canonical_path, utf16le_to_utf8 and tests.
...else if c < 0x800 then + (0xc0, 2) + else if c < 0x10000 then + (0xe0, 3) + else if c < 0x200000 then + (0xf0, 4) + else if c < 0x4000000 then + (0xf8, 5) + else + (0xfc, 6) in + let rec loop i c = + if i = 0 then Buffer.add_char outbuf (Char.chr (c lor first)) + else if i > 0 then ( + loop (i-1) (c lsr 6); + Buffer.add_char outbuf (Char.chr ((c land 0x3f) lor 0x80)) + ) + in + loop (len-1) c + in + + (* Loop over the input UTF16-LE characters. *) + let is_high_surrogate c = c >= 0xd80...
2015 Jan 21
2
[PATCH] customize: add --commands-from-file
Pass to --commands-from-file the name of a file containing customization commands in each line, as if they were specified as command line arguments. This eases the reuse of commands among different builder/customize/sysprep invocations. --- builder/cmdline.ml | 3 +- customize/customize_run.ml | 5 +++ generator/customize.ml | 98 ++++++++++++++++++++++++++++++++++++++++++++-- 3
2016 Jul 13
0
[PATCH v3 2/2] mllib: Getopt: support hidden options
...gue; + let specs = List.filter ( + fun (_, _, doc) -> + doc <> hidden_option_description + ) h.specs in + List.iter ( fun (keys, spec, doc) -> let columns = ref 0 in @@ -88,7 +95,7 @@ let show_help h () = ); Buffer.add_string b doc; Buffer.add_char b '\n'; - ) h.specs; + ) specs; Buffer.output_buffer stdout b; exit 0 @@ -158,8 +165,8 @@ let create specs ?anon_fun usage_msg = } in let specs = specs @ [ - [ "--short-options" ], Unit (display_short_options t), s_"List short options (internal)";...
2017 Jul 19
2
Re: [PATCH 02/27] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...p i = > + if i < n-3 && path.[i] = '\\' then ( > + let to_int c = Char.code c - Char.code '0' in > + let v = > + (to_int path.[i+1] lsl 6) lor > + (to_int path.[i+2] lsl 3) lor > + to_int path.[i+3] in > + Buffer.add_char b (Char.chr v); > + loop (i+4) > + ) > + else if i < n then ( > + Buffer.add_char b path.[i]; > + loop (i+1) > + ) > + else > + Buffer.contents b > + in > + loop 0 > + > +let is_small_file path = > + is_regular_file path &...
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
2015 Mar 31
0
[PATCH] WIP: New virt-dib tool
...// "install-packages.sh") script_install_packages; + + do_mkdir (destdir // "perm") + +let timing_output ~target_name entries timings = + let buf = Buffer.create 4096 in + Buffer.add_string buf "----------------------- PROFILING -----------------------\n"; + Buffer.add_char buf '\n'; + bprintf buf "Target: %s\n" target_name; + Buffer.add_char buf '\n'; + bprintf buf "%-40s %9s\n" "Script" "Seconds"; + bprintf buf "%-40s %9s\n" "---------------------------------------" "----------&quot...
2015 Oct 06
0
[PATCH 5/5] mllib: Replace various ad hoc string_* functions with String.*
...Buffer.create 16 in + let len = length str in + let rec loop start len = + try + let i = index_from str start '\n' in + if i > 0 && str.[i-1] = '\\' then ( + Buffer.add_substring buf str start (i-start-1); + Buffer.add_char buf '\n'; + loop (i+1) len + ) else ( + Buffer.add_substring buf str start (i-start); + i+1 + ) + with Not_found -> + if len > 0 && str.[len-1] = '\\' then ( + Buffer.add_substring buf str st...
2015 May 29
0
[PATCH v3] RFC: New virt-dib tool
...ot;install-packages.sh") script_install_packages; + ); + + do_mkdir (destdir // "perm") + +let timing_output ~target_name entries timings = + let buf = Buffer.create 4096 in + Buffer.add_string buf "----------------------- PROFILING -----------------------\n"; + Buffer.add_char buf '\n'; + bprintf buf "Target: %s\n" target_name; + Buffer.add_char buf '\n'; + bprintf buf "%-40s %9s\n" "Script" "Seconds"; + bprintf buf "%-40s %9s\n" "---------------------------------------" "----------&quot...
2015 Jul 03
1
[PATCH v5] New tool: virt-dib
...ot;install-packages.sh") script_install_packages; + ); + + do_mkdir (destdir // "perm") + +let timing_output ~target_name entries timings = + let buf = Buffer.create 4096 in + Buffer.add_string buf "----------------------- PROFILING -----------------------\n"; + Buffer.add_char buf '\n'; + bprintf buf "Target: %s\n" target_name; + Buffer.add_char buf '\n'; + bprintf buf "%-40s %9s\n" "Script" "Seconds"; + bprintf buf "%-40s %9s\n" "---------------------------------------" "----------&quot...
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.
2015 Jun 16
2
[PATCH v4] RFC: New tool: virt-dib
...ot;install-packages.sh") script_install_packages; + ); + + do_mkdir (destdir // "perm") + +let timing_output ~target_name entries timings = + let buf = Buffer.create 4096 in + Buffer.add_string buf "----------------------- PROFILING -----------------------\n"; + Buffer.add_char buf '\n'; + bprintf buf "Target: %s\n" target_name; + Buffer.add_char buf '\n'; + bprintf buf "%-40s %9s\n" "Script" "Seconds"; + bprintf buf "%-40s %9s\n" "---------------------------------------" "----------&quot...
2017 Jul 14
0
[PATCH 02/27] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...= Buffer.create n in + let rec loop i = + if i < n-3 && path.[i] = '\\' then ( + let to_int c = Char.code c - Char.code '0' in + let v = + (to_int path.[i+1] lsl 6) lor + (to_int path.[i+2] lsl 3) lor + to_int path.[i+3] in + Buffer.add_char b (Char.chr v); + loop (i+4) + ) + else if i < n then ( + Buffer.add_char b path.[i]; + loop (i+1) + ) + else + Buffer.contents b + in + loop 0 + +let is_small_file path = + is_regular_file path && + (stat path).st_size <= 2 * 1048 * 1024 diff --g...
2016 Jul 13
3
[PATCH v3 1/2] OCaml tools: add and use a Getopt module
...arg, _) + | Set_string (arg, _) + | Int (arg, _) + | Set_int (arg, _) -> Some arg in + (match arg with + | None -> () + | Some arg -> + add (sprintf " <%s>" arg) + ); + if !columns >= column_wrap then ( + Buffer.add_char b '\n'; + Buffer.add_string b (spaces column_wrap); + ) else ( + Buffer.add_string b (spaces (column_wrap - !columns)); + ); + Buffer.add_string b doc; + Buffer.add_char b '\n'; + ) h.specs; + + Buffer.output_buffer stdout b; + exit 0 + +let is_p...
2017 Jun 03
3
[PATCH 0/3]: daemon: Reimplement ‘file’ API in OCaml.
This patch series is just FYI at the moment. However it does pass the tests. The daemon is a self-contained program. We don't need to write it all in C. Writing parts of it in OCaml would make it simpler and less error-prone. In particular if the daemon was written in a more sane programming language then we could move the inspection code to run entirely inside the appliance, which would
2017 Jul 21
0
[PATCH v2 01/23] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...= Buffer.create n in + let rec loop i = + if i < n-3 && path.[i] = '\\' then ( + let to_int c = Char.code c - Char.code '0' in + let v = + (to_int path.[i+1] lsl 6) lor + (to_int path.[i+2] lsl 3) lor + to_int path.[i+3] in + Buffer.add_char b (Char.chr v); + loop (i+4) + ) + else if i < n then ( + Buffer.add_char b path.[i]; + loop (i+1) + ) + else + Buffer.contents b + in + loop 0 + +let is_small_file path = + is_regular_file path && + (stat path).st_size <= 2 * 1048 * 1024 diff --g...
2017 Jun 15
0
[PATCH v6 04/41] mllib: Split ‘Common_utils’ into ‘Std_utils’ + ‘Common_utils’.
...Buffer.create 16 in + let len = length str in + let rec loop start len = + try + let i = index_from str start '\n' in + if i > 0 && str.[i-1] = '\\' then ( + Buffer.add_substring buf str start (i-start-1); + Buffer.add_char buf '\n'; + loop (i+1) len + ) else ( + Buffer.add_substring buf str start (i-start); + i+1 + ) + with Not_found -> + if len > 0 && str.[len-1] = '\\' then ( + Buffer.add_substring buf str st...
2018 Aug 23
3
[PATCH v2 0/2] add output selection for --machine-readable
Hi, this adds the possibility to select the output for --machine-readable in OCaml tools. The possible choices are: * --machine-readable: to stdout, like before * --machine-readable=file:name-of-file: to the specified file * --machine-readable=stream:stdout: explicitly to stdout * --machine-readable=stream:stderr: explicitly to stderr This makes it possible to add additional output for
2015 Dec 02
3
[PATCH 0/3] [FOR COMMENTS ONLY] Rework inspection.
This is something I've been working on: Reworking inspection so it's not a big mess of ad hoc C code, but instead uses a well-defined domain-specific language to describe how we inspect guests. The best introduction to this is the manual page, which I include below (it's also included in patch 2/3). Rich. ---------------------------------------------------------------------- NAME
2016 Feb 23
4
[PATCH v3 0/4] [FOR COMMENTS ONLY] Rework inspection.
Previously posted: https://www.redhat.com/archives/libguestfs/2015-December/msg00038.html Inspection now really succeeds on a small number of simple guests. To test it out: $ ./run guestfish -v -x -a /tmp/centos-6.img ><fs> run ><fs> debug sh "guestfs-inspection --verbose" Rich.