Displaying 20 results from an estimated 28 matches for "external_structs".
2013 Jan 30
1
[PATCH] Make internal-only functions and structures private
...t char *
pr "extern GUESTFS_DLL_PUBLIC void guestfs_free_%s (struct guestfs_%s *);\n" typ typ;
pr "extern GUESTFS_DLL_PUBLIC void guestfs_free_%s_list (struct guestfs_%s_list *);\n" typ typ;
pr "\n"
- ) structs;
+ ) in
+
+ generate_all_structs external_structs;
pr "\
/* Actions. */
@@ -673,7 +675,7 @@ extern GUESTFS_DLL_PUBLIC void *guestfs_next_private (guestfs_h *g, const char *
pr "\n"
in
- List.iter (
+ let generate_all_headers = List.iter (
fun ({ name = name; style = ret, args, _ } as f) ->
(* If once...
2016 Feb 24
3
[PATCH 1/3] src: generate code for printing contents of structs
...gt;%s, linesep);\n"
+ name typ name;
+ pr " else\n";
+ pr " fprintf (dest, \"%%s%s: %%s\", indent, linesep);\n" name
+ ) cols;
+ pr "}\n";
+ pr "\n";
+ ) in
+
+ write_structs external_structs;
+
+ pr "\
+#if GUESTFS_PRIVATE
+
+";
+
+ write_structs internal_structs;
+
+ pr "\
+#endif /* End of GUESTFS_PRIVATE. */
+"
+
+(* Generate structs-print.h file. *)
+and generate_client_structs_print_h () =
+ generate_header CStyle LGPLv2plus;
+
+ pr "\
+#ifndef GUESTF...
2014 Jul 01
2
[PATCH] generator: Sort the structs.
...ons(-)
diff --git a/generator/structs.ml b/generator/structs.ml
index 1bc6e08..65c78b2 100644
--- a/generator/structs.ml
+++ b/generator/structs.ml
@@ -382,6 +382,10 @@ let camel_name_of_struct name = (lookup_struct name).s_camel_name
let cols_of_struct name = (lookup_struct name).s_cols
-let external_structs = List.filter (fun x -> not x.s_internal) structs
+let compare_structs { s_name = n1 } { s_name = n2 } = compare n1 n2
-let internal_structs = List.filter (fun x -> x.s_internal) structs
+let external_structs =
+ List.sort compare_structs (List.filter (fun x -> not x.s_internal) structs...
2019 Jun 27
0
[PATCH 5/9] Rust bindings: Add generator of structs for optional arguments
...unsafe"]
+
+let translate_bad_symbols s =
+ if List.exists (fun x -> s = x) black_list then
+ s ^ "_"
+ else
+ s
+
let generate_rust () =
generate_header CStyle LGPLv2plus;
@@ -204,3 +226,52 @@ impl UUID {
pr " }\n";
pr "}\n"
) external_structs;
+ List.iter (
+ fun ({ name = name; shortdesc = shortdesc;
+ style = (ret, args, optargs) }) ->
+ let cname = snake2caml name in
+ if optargs <> [] then (
+ pr "\n";
+ pr "/* Optional Structs */\n";
+ pr "#[derive(Defaul...
2019 Jun 27
0
[PATCH 4/9] Rust bindings: Add generator of structs
...->
+ pr "%s: (*raw).%s,\n" n n
+ | n, FOptPercent ->
+ pr "%s: if (*raw).%s < 0.0 { None } else { Some((*raw).%s) },\n" n n n
+ ) cols;
+ pr " } }\n";
+ pr " }\n";
+ pr "}\n"
+ ) external_structs;
--
2.20.1 (Apple Git-117)
2019 Jun 27
0
[PATCH 6/9] Rust bindings: Add generator of function signatures
...dle, &'static str> {
let g = unsafe { guestfs_create() };
@@ -151,6 +165,10 @@ impl Handle {
}
}\
+pub struct Error {
+ // TODO
+}
+
pub struct UUID {
uuid: [u8; 32]
}
@@ -226,6 +244,8 @@ impl UUID {
pr " }\n";
pr "}\n"
) external_structs;
+
+ (* generate structs for optional arguments *)
List.iter (
fun ({ name = name; shortdesc = shortdesc;
style = (ret, args, optargs) }) ->
@@ -275,3 +295,120 @@ impl UUID {
pr "}\n\n";
);
) (actions |> external_functions |> sort);
+
+ pr...
2013 Feb 04
1
[PATCH] generator: Add visibility to action struct
..., args, optargs as style } as f) =
diff --git a/generator/csharp.ml b/generator/csharp.ml
index bc92cf1..0fbd02c 100644
--- a/generator/csharp.ml
+++ b/generator/csharp.ml
@@ -131,7 +131,7 @@ namespace Guestfs
) cols;
pr " }\n";
pr "\n"
- ) structs;
+ ) external_structs;
(* Generate C# function bindings. *)
List.iter (
@@ -286,7 +286,7 @@ namespace Guestfs
pr "\n";
List.iter generate_alias non_c_aliases
- ) all_functions_sorted;
+ ) external_functions_sorted;
pr " }
}
diff --git a/generator/erlang.ml b/generator/erla...
2015 Sep 15
3
[PATCH 3/3] python: Allow bindings to be compiled with different version of libguestfs (RHBZ#1262983).
Patch to fix:
https://bugzilla.redhat.com/show_bug.cgi?id=1262983
Note this won't help until the first two patches get backported to the
stable branches, since <guestfs.h> won't define the necessary
GUESTFS_HAVE_* macros.
Rich.
2019 Jun 27
16
[PATCH 1/9] Rust bindings: Add Rust bindings
From: Hiroyuki_Katsura <hiroyuki.katsura.0513@gmail.com>
---
Makefile.am | 4 ++++
configure.ac | 3 +++
generator/Makefile.am | 3 +++
generator/bindtests.ml | 3 +++
generator/bindtests.mli | 1 +
generator/main.ml | 5 +++++
generator/rust.ml | 34 ++++++++++++++++++++++++++++++++++
generator/rust.mli | 19 +++++++++++++++++++
2019 Jun 27
0
Re: [PATCH 08/11] Rust bindings: Fix memory management and format the file
...uot;;
+ indent 4; pr " Some((*raw).%s)\n" n;
+ indent 4; pr"},\n"
) cols;
- pr " } }\n";
+ pr " }\n";
+ pr " })\n";
pr " }\n";
pr "}\n"
) external_structs;
+ (* generate free functionf of structs *)
+ pr "\n";
+ pr "extern \"C\" {\n";
+ List.iter (
+ fun { s_camel_name = name; s_name = c_name; } ->
+ pr " #[allow(dead_code)]\n";
+ pr " fn guestfs_free_%s(v: *const Raw%s);\n"...
2016 Nov 08
4
[PATCH 1/3] generator: c: move internal functions
...s).
- *
- * To reiterate, we will pass these structures to and from the client
- * with a simple assignment or memcpy, so the format must be
- * identical to what rpcgen / the RFC defines.
- *)
-
(* Public structures. *)
- let generate_all_structs = List.iter (
+ generate_all_structs external_structs;
+
+ pr "\
+/* Actions. */
+";
+
+ generate_all_headers public_functions_sorted;
+
+ pr "\
+#if GUESTFS_PRIVATE
+/* Symbols protected by GUESTFS_PRIVATE are NOT part of the public,
+ * stable API, and can change at any time! We export them because
+ * they are used by some of the...
2020 Jun 01
1
[PATCH] erlang: Port to libei for Erlang 23
...fs_%s_list *%ss);\n"
typ typ typ;
in
List.iter (
fun { s_name = typ; s_cols = cols } ->
- pr "ETERM *make_%s (const struct guestfs_%s *%s);\n" typ typ typ;
+ pr "int make_%s (ei_x_buff *buff, const struct guestfs_%s *%s);\n" typ typ typ;
) external_structs;
List.iter (
@@ -229,7 +229,7 @@ extern int64_t get_int64 (ETERM *term);
List.iter (
fun { name } ->
- pr "ETERM *run_%s (ETERM *args_tuple);\n" name
+ pr "int run_%s (ei_x_buff *retbuff, const char *buff, int *index);\n" name
) (actions |> exte...
2019 Jun 27
4
Re: [PATCH 9/9] Rust bindings: Complete bindings
Patch 9 is a kind of dumping ground of all kinds of stuff. It may be
better to spend some time with git rebase -i trying to work this into
more coherent patches.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live
2016 Feb 05
7
[PATCH 0/7] lib: Stop exporting the safe_malloc, etc. functions.
The safe_malloc (etc) functions call g->abort_fn on failure. That's
not appropriate for language bindings, and we never intended that
these internal functions be used from language bindings, that was just
a historical accident.
This patch series removes any external use of the safe_* functions.
Rich.
2019 Jul 02
16
[PATCH] Add Rust bindings
I fixed the patch I submitted before based on comments, and there are some
commits which are merged or divided. So, I will re-send all the patches.
Regards,
Hiroyuki Katsura
2019 Jun 27
0
[PATCH 9/9] Rust bindings: Complete bindings
...uot;;
+ indent 4; pr " Some((*raw).%s)\n" n;
+ indent 4; pr"},\n"
) cols;
- pr " } }\n";
+ pr " }\n";
+ pr " })\n";
pr " }\n";
pr "}\n"
) external_structs;
@@ -361,11 +397,26 @@ impl UUID {
pr "extern \"C\" {\n";
List.iter (
fun { s_camel_name = name; s_name = c_name; } ->
- pr "fn guestfs_free_%s(v: *const Raw%s);\n" c_name name;
- pr "fn guestfs_free_%s_list(l: *const RawList<Raw%s>)...
2019 Jul 20
0
[PATCH] Rust bindings: Add Rust bindings
...indent 4; pr "} else {\n";
+ indent 4; pr " Some((*raw).%s)\n" n;
+ indent 4; pr"},\n"
+ ) cols;
+ pr " }\n";
+ pr " })\n";
+ pr " }\n";
+ pr "}\n"
+ ) external_structs;
+
+ (* generate free functionf of structs *)
+ pr "\n";
+ pr "extern \"C\" {\n";
+ List.iter (
+ fun { s_camel_name = name; s_name = c_name; } ->
+ pr " #[allow(dead_code)]\n";
+ pr " fn guestfs_free_%s(v: *const Raw%s);\n&quo...
2019 Jul 23
2
Re: [PATCH] Rust bindings: Add Rust bindings
...;;
> + indent 4; pr " Some((*raw).%s)\n" n;
> + indent 4; pr"},\n"
> + ) cols;
> + pr " }\n";
> + pr " })\n";
> + pr " }\n";
> + pr "}\n"
> + ) external_structs;
> +
> + (* generate free functionf of structs *)
> + pr "\n";
> + pr "extern \"C\" {\n";
> + List.iter (
> + fun { s_camel_name = name; s_name = c_name; } ->
> + pr " #[allow(dead_code)]\n";
> + pr " fn...
2019 Jul 23
0
Re: [PATCH] Rust bindings: Add Rust bindings
...indent 4; pr "} else {\n";
+ indent 4; pr " Some((*raw).%s)\n" n;
+ indent 4; pr"},\n"
+ ) cols;
+ pr " }\n";
+ pr " })\n";
+ pr " }\n";
+ pr "}\n"
+ ) external_structs;
+
+ (* generate free functionf of structs *)
+ pr "\n";
+ pr "extern \"C\" {\n";
+ List.iter (
+ fun { s_camel_name = name; s_name = c_name; } ->
+ pr " #[allow(dead_code)]\n";
+ pr " fn guestfs_free_%s(v: *const Raw%s);\n&quo...
2019 Jul 20
2
Re: [PATCH] Rust bindings: Add Rust bindings
> Is this just trying if the guestfs can be linked with?
Yes. In OCaml bindings, there is the corresponding test(
https://github.com/libguestfs/libguestfs/blob/master/ocaml/t/guestfs_010_load.ml).
I just mimicked it. If it is not required, I will remove it.
divided the generated files and handmade files in rust/src/ directory. I'll
send this fixed patch to this mailing list.
I'm not