Displaying 12 results from an estimated 12 matches for "map_char".
Did you mean:
map_chars
2017 Sep 25
0
[PATCH] customize: Unconditionally set the machine-id if not set already.
...; None in
+ (match statbuf with
+ | Some { G.st_size = 0L; G.st_mode = mode }
+ when (Int64.logand mode 0o170000_L) = 0o100000_L ->
+ message (f_"Setting the machine ID in %s") etc_machine_id;
+ let id = Urandom.urandom_bytes 16 in
+ let id = String.map_chars (fun c -> sprintf "%02x" (Char.code c)) id in
+ let id = String.concat "" id in
+ let id = id ^ "\n" in
+ g#write etc_machine_id id
+ | _ -> ()
+ ) in
+
(* Store the passwords and set them all at the end. *)
let passwords = Hash...
2016 Dec 09
0
Re: [PATCH] generator: Share Common_utils code.
...c = String.unsafe_get str i then incr count
> - done;
> - !count
Ditto.
> -let explode str =
> - let r = ref [] in
> - for i = 0 to String.length str - 1 do
> - let c = String.unsafe_get str i in
> - r := c :: !r;
> - done;
> - List.rev !r
Ditto.
> -let map_chars f str =
> - List.map f (explode str)
Ditto.
> -let spaces n = String.make n ' '
Oh there's a copy of this in mllib/getopt.ml, so could you please
include that in this patch?
> -
> -let html_escape text =
> - let text = replace_str text "&" "&...
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...ot; } else {\n";
pr " fprintf (fp, \"unset\\n\");\n";
@@ -583,7 +584,7 @@ public class Bindtests {
| CallBool b -> string_of_bool b
| CallBuffer s ->
"new byte[] { " ^ String.concat "," (
- map_chars (fun c -> string_of_int (Char.code c)) s
+ String.map_chars (fun c -> string_of_int (Char.code c)) s
) ^ " }"
) args
)
@@ -845,7 +846,7 @@ and generate_golang_bindtests () =
generate_lang_bindtests (
fun f args optargs ->
- pr...
2017 Jun 15
0
[PATCH v6 04/41] mllib: Split ‘Common_utils’ into ‘Std_utils’ + ‘Common_utils’.
...str - 1 do
+ if c = String.unsafe_get str i then incr count
+ done;
+ !count
+
+ let explode str =
+ let r = ref [] in
+ for i = 0 to String.length str - 1 do
+ let c = String.unsafe_get str i in
+ r := c :: !r;
+ done;
+ List.rev !r
+
+ let map_chars f str =
+ List.map f (explode str)
+
+ let spaces n = String.make n ' '
+end
+
+let (//) = Filename.concat
+let quote = Filename.quote
+
+let subdirectory parent path =
+ if path = parent then
+ ""
+ else if String.is_prefix path (parent // "") then (
+...
2012 Jan 09
1
[PATCH 1/2] generator: Rename java_structs to camel_structs to better reflect their purpose
This map was originally included just for the java bindings, but is generally
useful to any binding which uses camel case by requirement or convention.
---
generator/generator_haskell.ml | 4 ++--
generator/generator_java.ml | 10 +++++-----
generator/generator_main.ml | 2 +-
generator/generator_structs.ml | 12 +++++-------
generator/generator_structs.mli | 8 ++++----
5
2013 Jan 24
3
[REVIEW ONLY] Mountable patches
These 3 patches implement support for APIs which must accept a mountable, but
don't update apis which must return mountables.
Matt
2013 Feb 07
12
[PATCH 01/12] generator: Add new Mountable argument type
...*)
| Dev_or_Path of string (* /dev device name or Pathname, cannot be NULL *)
| OptString of string (* const char *name, may be NULL *)
diff --git a/generator/utils.ml b/generator/utils.ml
index 67a6747..6a94009 100644
--- a/generator/utils.ml
+++ b/generator/utils.ml
@@ -250,7 +250,7 @@ let map_chars f str =
List.map f (explode str)
let name_of_argt = function
- | Pathname n | Device n | Dev_or_Path n | String n | OptString n
+ | Pathname n | Device n | Mountable n | Dev_or_Path n | String n | OptString n
| StringList n | DeviceList n | Bool n | Int n | Int64 n
| FileIn n | FileO...
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.
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