search for: find_callback

Displaying 9 results from an estimated 9 matches for "find_callback".

2019 Jul 16
0
[libnbd PATCH 2/2] RFC: generator: Handle shared callbacks in Python
...| String n -> pr "const char *%s" n | StringList n -> pr "char **%s" n @@ -3715,155 +3738,138 @@ let print_python_binding name { args; ret } = * have to generate a wrapper function which translates the * callback parameters back to Python. *) - let find_callback opaque_id = - let cb = - try - List.find ( - function - | Callback (_, args) | CallbackPersist (_, args) -> - List.mem (Opaque opaque_id) args - | _ -> false - ) args - with - Not_found -> - failwithf "%s:...
2019 Jun 18
0
[libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
...ot;s\"" | StringList n -> pr " \"O\"" @@ -3584,6 +3604,7 @@ let print_python_binding name { args; ret } = | Int n -> pr ", &%s" n | Int64 n -> pr ", &%s" n | Opaque n -> pr ", &%s_data->data" (find_callback n) + | ReadStatus n -> pr ", XXX5 &%s" n | Path n -> pr ", PyUnicode_FSConverter, &%s" n | SockAddrAndLen (n, _) -> pr ", &%s" n | String n -> pr ", &%s" n @@ -3634,6 +3655,7 @@ let print_python_binding name { arg...
2019 Jun 25
3
[PATCH libnbd] generator: Add Mutable type to the generator.
...e { args; ret } = | Flags n -> pr ", &%s" n | Int n -> pr ", &%s" n | Int64 n -> pr ", &%s" n + | Mutable arg -> pr ", &%s" (List.hd (name_of_arg arg)) | Opaque n -> pr ", &%s_data->data" (find_callback n) | Path n -> pr ", PyUnicode_FSConverter, &%s" n | SockAddrAndLen (n, _) -> pr ", &%s" n @@ -3525,6 +3553,8 @@ let print_python_binding name { args; ret } = | Flags n -> pr " %s_u32 = %s;\n" n n | Int _ -> () | Int64 n -&...
2019 Jul 16
3
[RFC libnbd PATCH 0/2] Start fixing python nbd.pread_structured_callback
Posting now that I got something to compile (at the expense of breaking OCaml bindings), but I'm open to ideas on how to improve it. Eric Blake (2): generator: Tweak print_c_arg_list to take alternate first arg RFC: generator: Handle shared callbacks in Python generator/generator | 556 ++++++++++++++++++++++---------------------- 1 file changed, 280 insertions(+), 276 deletions(-) --
2019 Jun 20
1
Re: [libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
...| StringList n -> pr " \"O\"" > @@ -3584,6 +3604,7 @@ let print_python_binding name { args; ret } = > | Int n -> pr ", &%s" n > | Int64 n -> pr ", &%s" n > | Opaque n -> pr ", &%s_data->data" (find_callback n) > + | ReadStatus n -> pr ", XXX5 &%s" n > | Path n -> pr ", PyUnicode_FSConverter, &%s" n > | SockAddrAndLen (n, _) -> pr ", &%s" n > | String n -> pr ", &%s" n > @@ -3634,6 +3655,7 @@ let print_...
2019 Jun 27
1
[libnbd PATCH] python: Fix bindings for Path parameters
...hs for the different socket types.\n"; @@ -3699,7 +3701,7 @@ let print_python_binding name { args; ret } = | Int64 n -> pr ", &%s" n | Mutable arg -> pr ", &%s" (List.hd (name_of_arg arg)) | Opaque n -> pr ", &%s_data->data" (find_callback n) - | Path n -> pr ", PyUnicode_FSConverter, &%s" n + | Path n -> pr ", PyUnicode_FSConverter, &py_%s" n | SockAddrAndLen (n, _) -> pr ", &%s" n | String n -> pr ", &%s" n | StringList n -> pr ", &...
2019 Jul 16
0
[PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...are special because we - * have to generate a wrapper function which translates the - * callback parameters back to Python. + (* Functions with a Closure parameter are special because we + * have to generate wrapper functions which translate the + * callbacks back to Python. *) - let find_callback opaque_id = - let cb = - try - List.find ( - function - | Callback (_, args) | CallbackPersist (_, args) -> - List.mem (Opaque opaque_id) args - | _ -> false - ) args - with - Not_found -> - failwithf "%s:...
2019 Jul 16
2
[PATCH libnbd v2] generator: Define new Closure type
As before, but this one has working Python bindings. OCaml still TBD. Rich.
2019 Jun 18
17
[libnbd PATCH 0/8] Add nbd_pread_callback
I've mentioned this topic before (in fact, the idea of adding NBD_CMD_FLAG_DF was first mentioned at [1]), but finally finished enough of an implementation to feel confident in posting it. I'd still like to add something under examples/ that uses the new API to implement strict checking of a server's structured replies read implementation (ensure that a server never sends data after