search for: all_cls

Displaying 5 results from an estimated 5 matches for "all_cls".

2019 Aug 13
0
[PATCH libnbd 1/6] generator: Share single list of all Closures.
...) - | _ -> () - ) all_args - in - (* Check functions using may_set_error. *) List.iter ( function @@ -3478,20 +3441,12 @@ let print_cbarg_list ?(valid_flag = true) ?(types = true) cbargs = (* Callback typedefs in <libnbd.h> *) let print_closure_typedefs () = - let all_cls = - List.map ( - fun (_, { args }) -> - filter_map (function Closure cl -> Some cl | _ -> None) args - ) handle_calls in - let all_cls = List.flatten all_cls in - let cmp { cbname = n1 } { cbname = n2 } = compare n1 n2 in - let unique_cls = sort_uniq ~cmp all_cls in...
2019 Aug 03
1
[PATCH libnbd] generator: Generate typedefs automatically for Closure arguments.
...uot;, "; if types then pr "void *"; pr "%s_user_data" cbname @@ -3297,6 +3337,24 @@ let print_extern name args ret = print_call name args ret; pr ";\n" +(* Callback typedefs in <libnbd.h> *) +let print_closure_typedefs () = + let all_cls = + List.map ( + fun (_, { args }) -> + filter_map (function Closure cl -> Some cl | _ -> None) args + ) handle_calls in + let all_cls = List.flatten all_cls in + let cmp { cbname = n1 } { cbname = n2 } = compare n1 n2 in + let unique_cls = sort_uniq ~cmp all_cls in +...
2019 Aug 13
12
[PATCH 0/6] Implement OClosure.
Patches 1-4 are basically uncontroversial, straightforward refactoring and IMHO we should just push them. Possibly 1-3 should be squashed together, but I posted them separately so they are easier to review. Patches 5 and 6 together implement OClosure. Patch 5 adds the feature and is simple to understand. Patch 6 changes the Closure completion callbacks into OClosure, but because it doesn't
2019 Aug 09
0
[PATCH libnbd 1/2] generator: Handle closure args (cbargs) specially.
...if types then pr "unsigned "; + pr "%s" n + | CBUInt64 n -> + if types then pr "uint64_t "; + pr "%s" n + ) cbargs; + pr ")" + (* Callback typedefs in <libnbd.h> *) let print_closure_typedefs () = let all_cls = @@ -3411,7 +3439,7 @@ let print_closure_typedefs () = List.iter ( fun { cbname; cbargs } -> pr "typedef int (*nbd_%s_callback) " cbname; - print_arg_list ~valid_flag:true ~user_data:true cbargs; + print_cbarg_list cbargs; pr ";\n"; ) uniqu...
2019 Aug 09
4
[PATCH libnbd 0/2] generator: Preparatory changes to the generator.
These are some simplifications to the generator. They don't probably make much sense on their own, but they are preparatory to better handling of enums, and or'd lists of flags. Rich.