search for: print_c_arg_list

Displaying 17 results from an estimated 17 matches for "print_c_arg_list".

Did you mean: print_arg_list
2019 Jun 04
0
[PATCH libnbd v2 2/4] generator: Callback returns int instead of void.
...ion returning void *) +| Callback of string * arg list (* callback function returning int *) | CallbackPersist of string * arg list (* as above, but callback persists *) | Flags of string (* NBD_CMD_FLAG_* flags *) | Int of string (* small int *) @@ -2680,7 +2680,7 @@ let rec print_c_arg_list ?(handle = false) args = | BytesPersistOut (n, len) -> pr "void *%s, size_t %s" n len | Callback (n, args) | CallbackPersist (n, args) -> - pr "void (*%s) " n; print_c_arg_list args + pr "int (*%s) " n; print_c_arg_list args...
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(-) -- 2.20.1
2019 Jul 16
2
[PATCH libnbd] generator: Define new Closure type
** INCOMPLETE ** This is the generator change as discussed on the list already. The Python and OCaml bindings are not yet done. It passes all [C only] tests and valgrind. Note that nbd_add_close_callback is inconsistent with other closure types because it passes the user_data parameter after the function. (This is not caused by the current patch, it was already inconsistent). We decided that
2019 Jul 16
0
[libnbd PATCH 2/2] RFC: generator: Handle shared callbacks in Python
...; [n] | Int64 n -> [n] -| Opaque n -> [n] +| OpaqueAndCallbacks (n, cbs) | OpaqueAndCallbacksPersist (n, cbs) -> + [n] @ List.map (fun cb -> cb.name) cbs | Mutable arg -> name_of_arg arg | Path n -> [n] | SockAddrAndLen (n, len) -> [n; len] @@ -3185,15 +3206,17 @@ let rec print_c_arg_list ?(handle = None) args = | BytesPersistIn (n, len) -> pr "const void *%s, size_t %s" n len | BytesOut (n, len) | BytesPersistOut (n, len) -> pr "void *%s, size_t %s" n len - | Callback (n, args) - | CallbackPersist (n, args) -> - pr...
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 Jul 16
1
[libnbd PATCH] generator: Prefer closure opaque after function pointer in C
...len) -> [n; len] | Closure (_, closures) -> - "user_data" :: List.map (fun { cbname } -> cbname) closures + List.map (fun { cbname } -> cbname) closures @ ["user_data"] | Flags n -> [n] | Int n -> [n] | Int64 n -> [n] @@ -3211,12 +3211,13 @@ let rec print_c_arg_list ?(handle = false) ?(user_data = false) args = | BytesOut (n, len) | BytesPersistOut (n, len) -> pr "void *%s, size_t %s" n len | Closure (_, cls) -> - pr "void *user_data"; List.iter ( fun { cbname; cbargs } -> -...
2019 Jul 16
0
[PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...gt; [n] -| Opaque n -> [n] -| Mutable arg -> name_of_arg arg +| Mutable arg -> c_name_of_arg arg | Path n -> [n] | SockAddrAndLen (n, len) -> [n; len] | String n -> [n] @@ -3164,13 +3172,18 @@ let rec name_of_arg = function | UInt32 n -> [n] | UInt64 n -> [n] -let rec print_c_arg_list ?(handle = false) args = +let rec print_c_arg_list ?(handle = false) ?(user_data = false) args = pr "("; let comma = ref false in if handle then ( comma := true; pr "struct nbd_handle *h"; ); + if user_data then ( + if !comma then pr ", "; +...
2019 May 28
0
[PATCH] api: Add a special type for the flags argument.
...header HashStyle; @@ -2517,6 +2533,7 @@ let rec name_of_arg = function | BytesPersistIn (n, len) -> [n; len] | BytesPersistOut (n, len) -> [n; len] | Callback (n, _) -> [n] +| Flags n -> [n] | Int n -> [n] | Int64 n -> [n] | Opaque n -> [n] @@ -2548,6 +2565,7 @@ let rec print_c_arg_list ?(handle = false) args = | BytesOut (n, len) | BytesPersistOut (n, len) -> pr "void *%s, size_t %s" n len | Callback (n, args) -> pr "void (*%s) " n; print_c_arg_list args + | Flags n -> pr "uint32_t %s" n | Int n -> pr &quo...
2019 May 28
2
[PATCH] api: Add a special type for the flags argument.
This applies on top of patches 1 & 2 here (instead of patch 3): https://www.redhat.com/archives/libguestfs/2019-May/msg00206.html https://www.redhat.com/archives/libguestfs/2019-May/msg00207.html Rich.
2019 Jun 04
9
[PATCH libnbd v2 0/4] api: Implement concurrent writer.
v1: https://www.redhat.com/archives/libguestfs/2019-June/msg00014.html I pushed a few bits which are uncontroversial. The main changes since v1 are: An extra patch removes the want_to_send / check for nbd_aio_is_ready in examples/threaded-reads-and-writes.c. This logic was wrong since commit 6af72b87 as was pointed out by Eric in his review. Comments and structure of
2019 Jul 16
1
Re: [PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...ameter name (in C) implies that you can have at most one Closure in an arg list. Should we enforce that (the same way we enforce that there is at most one Flags)? > @@ -3164,13 +3172,18 @@ let rec name_of_arg = function > | UInt32 n -> [n] > | UInt64 n -> [n] > > -let rec print_c_arg_list ?(handle = false) args = > +let rec print_c_arg_list ?(handle = false) ?(user_data = false) args = > pr "("; > let comma = ref false in > if handle then ( > comma := true; > pr "struct nbd_handle *h"; > ); > + if user_data then ( &g...
2019 May 23
2
[PATCH libnbd] api: Get rid of nbd_connection.
This isn't quite finished because not all of the tests or examples have been updated, but it demonstrates an idea: Should we forget about the concept of having multiple connections managed under a single handle? In this patch there is a single ‘struct nbd_handle *’ which manages a single state machine and connection (and therefore no nbd_connection). To connect to a multi-conn server you must
2019 Jun 18
0
[libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
...-----------------------------------*) @@ -2812,6 +2816,7 @@ let rec name_of_arg = function | Int64 n -> [n] | Opaque n -> [n] | Path n -> [n] +| ReadStatus n -> [n] | SockAddrAndLen (n, len) -> [n; len] | String n -> [n] | StringList n -> [n] @@ -2845,6 +2850,7 @@ let rec print_c_arg_list ?(handle = false) args = | Int n -> pr "int %s" n | Int64 n -> pr "int64_t %s" n | Opaque n -> pr "void *%s" n + | ReadStatus n -> pr "enum nbd_read_status %s" n | Path n | String n -> pr "const char...
2019 Jun 20
1
Re: [libnbd RFC PATCH 9/8] wip: generator: Add ReadStatus enum type
...-2812,6 +2816,7 @@ let rec name_of_arg = function > | Int64 n -> [n] > | Opaque n -> [n] > | Path n -> [n] > +| ReadStatus n -> [n] > | SockAddrAndLen (n, len) -> [n; len] > | String n -> [n] > | StringList n -> [n] > @@ -2845,6 +2850,7 @@ let rec print_c_arg_list ?(handle = false) args = > | Int n -> pr "int %s" n > | Int64 n -> pr "int64_t %s" n > | Opaque n -> pr "void *%s" n > + | ReadStatus n -> pr "enum nbd_read_status %s" n > | Path n > | Stri...
2019 Jun 25
3
[PATCH libnbd] generator: Add Mutable type to the generator.
...struct sockaddr * + socklen_t *) @@ -2708,6 +2709,7 @@ let rec name_of_arg = function | Int n -> [n] | Int64 n -> [n] | Opaque n -> [n] +| Mutable arg -> name_of_arg arg | Path n -> [n] | SockAddrAndLen (n, len) -> [n; len] | String n -> [n] @@ -2741,6 +2743,8 @@ let rec print_c_arg_list ?(handle = false) args = | Flags n -> pr "uint32_t %s" n | Int n -> pr "int %s" n | Int64 n -> pr "int64_t %s" n + | Mutable (Int n) -> pr "int *%s" n + | Mutable arg -> assert false | Opaque n -> pr &qu...
2019 May 28
6
[RFC libnbd PATCH 0/4] Add CMD_FLAG_DF support
RFC because this is an API break, but we haven't declared stable API yet. If we like it, I'm working on using libnbd to implement the nbdkit-nbd plugin; knowing whether it is API version 0.1 or 0.2 will be useful. I also dabbled with allowing optional parameters in python, although my OCaml is weak enough that there may be cleaner ways to approach that. Eric Blake (4): api: Add flags
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