search for: pr_wrap

Displaying 7 results from an estimated 7 matches for "pr_wrap".

Did you mean: pr_warn
2023 Jun 12
1
[PATCH libnbd 2/2] generator: state machine: Be less verbose in debug messages
...event %%s: %%s -> %%s\", "; > - pr "\"%s\", \"%s\", \"%s\");" > - (string_of_external_event e) > - display_name next_state.parsed.display_name; > - in > - pr_wrap ',' print_debug_args; > - pr "\n" All that work Laszlo did to nicely wrap these lines. If we decide to go with a multi-level debug (DEBUG=1 being the default for 'make check', DEBUG=2 for extra-verbose debugging), we'd probably implement that by eithe...
2020 Sep 08
2
Re: [libnbd PATCH 1/2] generator: Refactor handling of closures in unlocked functions
...t64 n -> [n] > > let rec print_arg_list ?(wrap = false) ?maxcol ?handle ?types ?(parens = true) > + ?(closure_mark) args optargs = You don't need parens around here, you can just write ?closure_mark > + if parens then pr "("; > + if wrap then > + pr_wrap ?maxcol ',' > + (fun () -> print_arg_list' ?handle ?types ?closure_mark args optargs) > + else > + print_arg_list' ?handle ?types ?closure_mark args optargs; > + if parens then pr ")" > + > +and print_arg_list' ?(handle = false) ?(types =...
2020 Sep 07
0
[libnbd PATCH 1/2] generator: Refactor handling of closures in unlocked functions
...0644 --- a/generator/C.ml +++ b/generator/C.ml @@ -99,16 +99,17 @@ let rec name_of_arg = function | UInt64 n -> [n] let rec print_arg_list ?(wrap = false) ?maxcol ?handle ?types ?(parens = true) + ?(closure_mark) args optargs = + if parens then pr "("; + if wrap then + pr_wrap ?maxcol ',' + (fun () -> print_arg_list' ?handle ?types ?closure_mark args optargs) + else + print_arg_list' ?handle ?types ?closure_mark args optargs; + if parens then pr ")" + +and print_arg_list' ?(handle = false) ?(types = true) ?(closure_mark = "...
2023 Jun 12
3
[PATCH libnbd 0/2] Two simple patches
These patches aren't related to each other, but both are quite simple. The second one requires particular attention - it's my experience that printing out the state transitions in debug mode has never helped me to diagnose a bug, but it has made the debug logs huge and hard to follow. However that might just be me! Has it helped anyone else? Also I'm open to the concept of debug
2020 Sep 07
4
[libnbd PATCH 0/2] Fix memory leak with closures
As promised in my earlier thread on libnbd completion callback question. Eric Blake (2): generator: Refactor handling of closures in unlocked functions generator: Free closures on failure docs/libnbd.pod | 2 +- generator/C.ml | 48 +++++++++++------ generator/C.mli | 1 + lib/debug.c | 7 +-- lib/opt.c | 31 ++++++-----
2020 Mar 17
5
[PATCH libnbd v2 0/3] Unfinished golang bindings.
These bindings get as far as running very simple connections. However there are many missing parts still: * No callbacks. * No functions which handle buffers (pread/pwrite!) This is posted just for general early interest, not even for review. Rich.
2019 Oct 04
4
[PATCH libnbd 1/4] generator: Allow long ‘name - shortdesc’ in man pages.
.../generator/generator +++ b/generator/generator @@ -4487,7 +4487,8 @@ let generate_docs_nbd_pod name { args; optargs; ret; first_version = (major, minor) } () = pr "=head1 NAME\n"; pr "\n"; - pr "nbd_%s - %s\n" name shortdesc; + pr_wrap ' ' (fun () -> pr "nbd_%s - %s" name shortdesc); + pr "\n"; pr "\n"; pr "=head1 SYNOPSIS\n"; -- 2.23.0