search for: print_endline

Displaying 20 results from an estimated 25 matches for "print_endline".

2018 Mar 16
0
[PATCH v2 4/5] tools: Add machine_output function.
...tools/tools_utils.ml index 09f1bb544..f7abd5c3e 100644 --- a/common/mltools/tools_utils.ml +++ b/common/mltools/tools_utils.ml @@ -102,6 +102,14 @@ let debug fs = let display str = if verbose () then prerr_endline str in ksprintf display fs +let machine_output fs = + let display str = + print_endline "__MACHINEBEGIN__"; + print_endline str; + print_endline "__MACHINEEND__" + in + ksprintf display fs + (* Common function to create a new Guestfs handle, with common options * (e.g. debug, tracing) already set. *) diff --git a/common/mltools/tools_utils.mli b/common...
2014 Mar 11
3
[PATCH 1/2] builder: move some language-related code into a Languages module
Mostly code motion, no behaviour changes. --- builder/Makefile.am | 3 +++ builder/languages.ml | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ builder/languages.mli | 21 ++++++++++++++++++ builder/list_entries.ml | 36 ++----------------------------- 4 files changed, 83 insertions(+), 34 deletions(-) create mode 100644 builder/languages.ml create mode 100644
2007 Sep 14
0
[LLVMdev] C interface
...e_pointer_type > (make_array_type (make_opaque_type ()) 4) |] > false) in > > (* string_of_lltype is implemented in ocaml, so the info on stdout > shows that make_*_type isn't a write-once/read-never interface. *) > print_endline ("big_fn_ty = " ^ (string_of_lltype big_fn_ty)); > > ignore(add_type_name m "big_fn_ty" big_fn_ty); > > if not (write_bitcode_file m filename) > then print_endline ("write failed: " ^ filename); > > dispose_module m > > let...
2007 Sep 12
7
[LLVMdev] C interface
...make_pointer_type (make_array_type (make_opaque_type ()) 4) |] false) in (* string_of_lltype is implemented in ocaml, so the info on stdout shows that make_*_type isn't a write-once/read-never interface. *) print_endline ("big_fn_ty = " ^ (string_of_lltype big_fn_ty)); ignore(add_type_name m "big_fn_ty" big_fn_ty); if not (write_bitcode_file m filename) then print_endline ("write failed: " ^ filename); dispose_module m let _ = if 2 = Array.length Sys.argv then...
2014 Jan 22
2
[PATCH] builder: read all the available notes from the index
...builder/builder.ml +++ b/builder/builder.ml @@ -200,9 +200,9 @@ let main () = (match mode with | `Notes -> (* --notes *) (match entry with - | { Index_parser.notes = Some notes } -> + | { Index_parser.notes = ("", notes) :: _ } -> print_endline notes; - | { Index_parser.notes = None } -> + | { Index_parser.notes = _ } -> printf (f_"There are no notes for %s\n") arg ); exit 0 diff --git a/builder/index_parser.ml b/builder/index_parser.ml index da44b21..961b91b 100644 --- a/builder/index_parser.ml +++...
2007 Aug 12
0
[LLVMdev] ocaml+llvm
...ck to find live objects. -- frame table example -- This program will create 3 call sites. 2 are not interesting, but the other will have 1 live root: example.ml: let keeplive x = "";; let heapobject = "hello " ^ "world" in print_endline heapobject; keeplive heapobject The interesting call is print_endline heapobject. After the return of this call, the root heapobject is still live, so the collector must trace it. To instruct the runtime to do so, the ocaml compiler emits the following assembly: from the program text...
2012 May 03
1
Ocaml and pthread_atfork()
...ocaml to solve this by myself. > > Yours Tony > > [1] I suspects that as a result of the demotion to secondary and things > languishing there we skipped a few builds. It looks like the PPC64 OCaml package is buggy. Can you compile any threaded program at all, eg: echo 'print_endline "hello"' > test.ml ocamlfind c -package threads -thread test.ml -linkpkg -o test ./test Unfortunately I don't have access to ppc64, so there's no way I can even look at bugs in this area, let alone fix them. Rich. -- Richard Jones, Virtualization Group, Red Hat http...
2018 Mar 16
7
[PATCH v2 0/5] Add --print-target with machine-readable version.
This adds --print-target. In addition, v2 provides a machine-readable version (in JSON format). All of the record -> JSON boilerplate in this patch could be eliminated if we moved the baseline to OCaml 4.02. Rich.
2014 Jan 22
0
Re: [PATCH] builder: read all the available notes from the index
...ilder.ml > @@ -200,9 +200,9 @@ let main () = > (match mode with > | `Notes -> (* --notes *) > (match entry with > - | { Index_parser.notes = Some notes } -> > + | { Index_parser.notes = ("", notes) :: _ } -> > print_endline notes; > - | { Index_parser.notes = None } -> > + | { Index_parser.notes = _ } -> If you have to match on _, especially: > --- a/builder/list_entries.ml > +++ b/builder/list_entries.ml > @@ -71,10 +71,10 @@ and list_entries_long ~sources index = > printf &...
2014 Jan 23
2
Re: [PATCH] builder: read all the available notes from the index
...> > > | `Notes -> (* --notes *) > > | > > (match entry with > > > > - | { Index_parser.notes = Some notes } -> > > + | { Index_parser.notes = ("", notes) :: _ } -> > > > > print_endline notes; > > > > - | { Index_parser.notes = None } -> > > + | { Index_parser.notes = _ } -> > > If you have to match on _, especially: > > --- a/builder/list_entries.ml > > +++ b/builder/list_entries.ml > > @@ -71,10 +71,10 @@ and list_entries_l...
2018 Sep 19
0
[PATCH 1/2] mltools: create a cmdline_options struct
...ommon/mltools/machine_readable_tests.ml @@ -30,7 +30,7 @@ let usage_msg = sprintf "%s: test the --machine-readable functionality" prog let opthandle = create_standard_options [] ~machine_readable:true usage_msg let () = - Getopt.parse opthandle; + Getopt.parse opthandle.getopt; print_endline "on-stdout"; prerr_endline "on-stderr"; diff --git a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml index c4f230275..2b2d43db9 100644 --- a/common/mltools/tools_utils.ml +++ b/common/mltools/tools_utils.ml @@ -259,6 +259,10 @@ let machine_readable () = in...
2012 Apr 06
2
[PATCH] virt-sysprep:add logging feature
...ing; extra_args : ((Arg.key * Arg.spec * Arg.doc) * string) list; - perform : Guestfs.guestfs -> string -> flag list; + perform : Guestfs.guestfs -> string -> bool -> flag list; } let ops = ref [] @@ -169,7 +169,7 @@ let list_operations () = *) List.iter (fun op -> print_endline op.name ) !ops -let perform_operations ?operations g root = +let perform_operations ?operations g root show_log = assert !baked; let ops = @@ -182,7 +182,7 @@ let perform_operations ?operations g root = List.map ( fun op -> (* eprintf "calling %S.perform g %S\...
2018 Sep 20
2
[PATCH 1/2] tools: Link OCaml programs with -runtime-variant _pic if available.
...l added in OCaml >= 4.03, but in theory might be disabled by +dnl downstream distros. +OCAML_RUNTIME_VARIANT_PIC_OPTION="" +if test "x$OCAMLC" != "xno"; then + AC_MSG_CHECKING([if OCaml ‘-runtime-variant _pic’ works]) + rm -f conftest.ml contest + echo 'print_endline "hello world"' > conftest.ml + if $OCAMLC conftest.ml -runtime-variant _pic -o conftest >&5 2>&5 ; then + AC_MSG_RESULT([yes]) + OCAML_RUNTIME_VARIANT_PIC_OPTION="-runtime-variant _pic" + else + AC_MSG_RESULT([no]) + fi + rm...
2016 Jul 15
5
[PATCH 0/3] mllib: Various fixes and changes to Getopt module.
The second patch is obviously not complete yet - for discussion only. Rich.
2015 Jul 28
0
[PATCH 06/10] builder: split Index_parser.index in an own module
...match mode with | `Notes -> (* --notes *) let notes = - Languages.find_notes (Languages.languages ()) entry.Index_parser.notes in + Languages.find_notes (Languages.languages ()) entry.Index.notes in (match notes with | notes :: _ -> print_endline notes @@ -267,7 +267,7 @@ let main () = (* Download the template, or it may be in the cache. *) let template = let template, delete_on_exit = - let { Index_parser.revision = revision; file_uri = file_uri; + let { Index.revision = revision; file_uri = file_uri; prox...
2016 Jul 18
0
[PATCH v2 2/3] mllib: Use L"..." and S '...' for long and short options.
...@ let display_short_options h () = List.iter ( fun (args, _, _) -> List.iter ( - fun arg -> - if is_prefix arg "-" && not (is_prefix arg "--") then - printf "%s\n" arg + function + | S _ as arg -> print_endline (string_of_option_name arg) + | L _ -> () ) args ) h.specs; exit 0 @@ -119,73 +133,44 @@ let display_long_options h () = List.iter ( fun (args, _, _) -> List.iter ( - fun arg -> - if is_prefix arg "--" && arg <> &qu...
2015 Oct 05
1
[PATCH] Fix shebang in perl scripts
...env perl use strict; use threads; + use warnings; use Sys::Guestfs; use Time::HiRes qw(time); diff --git a/generator/bindtests.ml b/generator/bindtests.ml index 5358ff1..0959704 100644 --- a/generator/bindtests.ml +++ b/generator/bindtests.ml @@ -370,11 +370,12 @@ let () = pr "print_endline \"EOF\"\n" and generate_perl_bindtests () = - pr "#!/usr/bin/perl -w\n"; + pr "#!/usr/bin/env perl\n"; generate_header HashStyle GPLv2plus; pr "\ use strict; +use warnings; use Sys::Guestfs; diff --git a/perl/examples/create_disk.pl b/perl/...
2016 Jul 18
4
[PATCH v2 0/3] mllib: Various fixes and changes to Getopt module.
v1 -> v2: - Further fixes to Getopt int parsing. - Completed the L/S changes. - Fixed the test suite so it passes now. Also we don't need the special-case tests for 64 bit arch. Rich.
2018 Aug 23
0
[PATCH v2 2/2] OCaml tools: add output selection for --machine-readable
...script. + *) + +open Printf + +open Std_utils +open Tools_utils +open Getopt.OptionName + +let usage_msg = sprintf "%s: test the --machine-readable functionality" prog + +let opthandle = create_standard_options [] ~machine_readable:true usage_msg +let () = + Getopt.parse opthandle; + + print_endline "on-stdout"; + prerr_endline "on-stderr"; + + match machine_readable () with + | Some { pr } -> + pr "machine-readable\n" + | None -> () diff --git a/common/mltools/test-machine-readable.sh b/common/mltools/test-machine-readable.sh new file mode 100755 ind...
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