Displaying 5 results from an estimated 5 matches for "c_name_of_arg".
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
0
[PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...Flags "flags" ];
ret = RInt64;
permitted_states = [ Connected ];
@@ -3143,19 +3151,19 @@ let generate_lib_libnbd_syms () =
pr " local: *;\n";
pr "};\n"
-let rec name_of_arg = function
-| ArrayAndLen (arg, n) -> name_of_arg arg @ [n]
+let rec c_name_of_arg = function
+| ArrayAndLen (arg, n) -> c_name_of_arg arg @ [n]
| Bool n -> [n]
| BytesIn (n, len) -> [n; len]
| BytesOut (n, len) -> [n; len]
| BytesPersistIn (n, len) -> [n; len]
| BytesPersistOut (n, len) -> [n; len]
-| Callback (n, _) | CallbackPersist (n, _) -> [n]
+| C...
2019 Jul 16
1
Re: [PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...tic and doesn't affect the patch's operation.
> @@ -3143,19 +3151,19 @@ let generate_lib_libnbd_syms () =
> pr " local: *;\n";
> pr "};\n"
>
> -let rec name_of_arg = function
> -| ArrayAndLen (arg, n) -> name_of_arg arg @ [n]
> +let rec c_name_of_arg = function
> +| ArrayAndLen (arg, n) -> c_name_of_arg arg @ [n]
> | Bool n -> [n]
> | BytesIn (n, len) -> [n; len]
> | BytesOut (n, len) -> [n; len]
> | BytesPersistIn (n, len) -> [n; len]
> | BytesPersistOut (n, len) -> [n; len]
> -| Callback (n, _) | Ca...
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
1
[libnbd PATCH] generator: Prefer closure opaque after function pointer in C
...flags) == -1) {
fprintf (stderr, "%s\n", nbd_get_error ());
exit (EXIT_FAILURE);
diff --git a/generator/generator b/generator/generator
index fab7281..485a76a 100755
--- a/generator/generator
+++ b/generator/generator
@@ -3173,7 +3173,7 @@ let rec c_name_of_arg = function
| BytesPersistIn (n, len) -> [n; len]
| BytesPersistOut (n, len) -> [n; len]
| Closure (_, closures) ->
- "user_data" :: List.map (fun { cbname } -> cbname) closures
+ List.map (fun { cbname } -> cbname) closures @ ["user_data"]
| Flags n ->...