Displaying 20 results from an estimated 29 matches for "uc_n".
2014 Aug 11
3
[PATCH] python: fix possible free on uninit memory with OStringList optargs
...104 100644
--- a/generator/python.ml
+++ b/generator/python.ml
@@ -511,7 +511,9 @@ put_table (char * const * const argv)
function
| OBool _ | OInt _ | OInt64 _ | OString _ -> ()
| OStringList n ->
- pr " if (py_%s != Py_None)\n" n;
+ let uc_n = String.uppercase n in
+ pr " if (py_%s != Py_None && (optargs_s.bitmask |= %s_%s_BITMASK) != 0)\n"
+ n c_optarg_prefix uc_n;
pr " free ((char **) optargs_s.%s);\n" n
) optargs;
--
1.9.3
2012 Jan 09
1
[PATCH 1/2] generator: Rename java_structs to camel_structs to better reflect their purpose
This map was originally included just for the java bindings, but is generally
useful to any binding which uses camel case by requirement or convention.
---
generator/generator_haskell.ml | 4 ++--
generator/generator_java.ml | 10 +++++-----
generator/generator_main.ml | 2 +-
generator/generator_structs.ml | 12 +++++-------
generator/generator_structs.mli | 8 ++++----
5
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...; (String.uppercase_ascii shortname);
if optargs <> [] then (
iteri (
fun i argt ->
- let uc_shortname = String.uppercase shortname in
+ let uc_shortname = String.uppercase_ascii shortname in
let n = name_of_optargt argt in
- let uc_n = String.uppercase n in
+ let uc_n = String.uppercase_ascii n in
pr "#define GUESTFS_%s_%s %d\n" uc_shortname uc_n i;
) optargs;
);
@@ -682,9 +684,9 @@ extern GUESTFS_DLL_PUBLIC void *guestfs_next_private (guestfs_h *g, const char *
| OInt64 n...
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.
2012 Aug 14
7
[PATCH 0/7] Add tar compress, numericowner, excludes flags.
https://bugzilla.redhat.com/show_bug.cgi?id=847880
https://bugzilla.redhat.com/show_bug.cgi?id=847881
This patch series adds various optional arguments to the tar-in and
tar-out commands.
Firstly (1/7) an optional "compress" flag is added to select
compression. This makes the calls tgz-in/tgz-out/txz-in/txz-out
deprecated, and expands the range of compression types available.
2012 Jan 17
2
[PATCH 1/2] c: NFC Remove redundant parentheses
....ml b/generator/generator_c.ml
index 4324ec0..9cfb2b7 100644
--- a/generator/generator_c.ml
+++ b/generator/generator_c.ml
@@ -1187,7 +1187,7 @@ trace_send_line (guestfs_h *g)
let n = name_of_optargt argt in
let uc_shortname = String.uppercase shortname in
let uc_n = String.uppercase n in
- pr " if ((optargs->bitmask & GUESTFS_%s_%s_BITMASK))\n"
+ pr " if (optargs->bitmask & GUESTFS_%s_%s_BITMASK)\n"
uc_shortname uc_n;
(match argt with
| OBool n
--
1.7.7.5
2015 Feb 10
4
[PATCH 1/4] php: fix invalid memory access with OptString
OptString maps to a "s!" argument, which makes zend_parse_parameters not
touch the variables (char* and length) when NULL is passed as parameter.
Hence, set both to NULL/0, and check for non-NULL char* variable before
checking its length.
---
generator/php.ml | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/generator/php.ml b/generator/php.ml
index
2017 Jul 14
0
[PATCH 07/27] daemon: Reimplement ‘is_dir’, ‘is_file’ and ‘is_symlink’ APIs in OCaml.
...uot;]]), [];
diff --git a/generator/daemon.ml b/generator/daemon.ml
index 3ffe91537..ef6086bfe 100644
--- a/generator/daemon.ml
+++ b/generator/daemon.ml
@@ -577,6 +577,7 @@ return_string_list (value retv)
List.iter (
fun ({ name = name; style = ret, args, optargs } as f) ->
+ let uc_name = String.uppercase_ascii name in
let ocaml_function =
match f.impl with
| OCaml f -> f
@@ -625,8 +626,8 @@ return_string_list (value retv)
let uc_n = String.uppercase_ascii n in
(* optargs are all passed as [None|Some _] *)
- pr "...
2015 Feb 10
0
[PATCH 4/4] php: fix memory leak in OStringList optargs
...58,6 +458,16 @@ PHP_FUNCTION (guestfs_last_error)
pr "\n"
| Bool _ | Int _ | Int64 _ | Pointer _ -> ()
) args;
+ List.iter (
+ function
+ | OBool n | OInt n | OInt64 n | OString n -> ()
+ | OStringList n ->
+ let uc_n = String.uppercase n in
+ pr " if ((optargs_s.bitmask & %s_%s_BITMASK) != 0)\n"
+ c_optarg_prefix uc_n;
+ pr " guestfs_efree_stringlist ((char **) optargs_s.%s);\n" n;
+ pr "\n"
+ ) optargs;
(* Check f...
2012 Jul 14
6
[PATCH 0/6] Allow non-optargs functions to gain optional arguments.
This rather complex set of patches allow non-optargs functions to gain
optional arguments, while preserving source and binary backwards
compatibility.
The problem is that we cannot add an optional argument to an existing
function. For example, we might want to add flags to the 'lvresize'
API which currently has no optional arguments.
2012 Sep 20
0
[PATCH] python: PyInt_* no longer exists in python3, replace with PyLong_*
...insertion(+), 1 deletion(-)
diff --git a/generator/python.ml b/generator/python.ml
index 482b189..b4bc3ce 100644
--- a/generator/python.ml
+++ b/generator/python.ml
@@ -381,7 +381,7 @@ free_strings (char **argv)
pr " optargs_s.bitmask |= %s_%s_BITMASK;\n" c_optarg_prefix uc_n;
(match optarg with
| OBool _ | OInt _ ->
- pr " optargs_s.%s = PyInt_AsLong (py_%s);\n" n n;
+ pr " optargs_s.%s = PyLong_AsLong (py_%s);\n" n n;
pr " if (PyErr_Occurred ()) return NULL;\n"...
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.
2017 Jul 14
0
[PATCH 02/27] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...ml_function;
+ pr "\n";
+
+ (* Construct the actual call, but note that we want to pass
+ * the optional arguments first in the list.
+ *)
+ let i = ref 0 in
+ List.iter (
+ fun optarg ->
+ let n = name_of_optargt optarg in
+ let uc_n = String.uppercase_ascii n in
+
+ (* optargs are all passed as [None|Some _] *)
+ pr " if ((optargs_bitmask & %s_%s_BITMASK) == 0)\n"
+ f.c_optarg_prefix uc_n;
+ pr " args[%d] = Val_int (0); /* None */\n" !i;
+ pr " e...
2013 Feb 04
1
[PATCH] generator: Add visibility to action struct
...";
List.iter (
fun argt ->
@@ -575,7 +574,7 @@ ruby_user_cancel (VALUE gv)
pr " optargs_s.%s = r;\n" n;
pr " }\n"
);
- pr " optargs_s.bitmask |= %s_%s_BITMASK;\n" c_optarg_prefix uc_n;
+ pr " optargs_s.bitmask |= %s_%s_BITMASK;\n" f.c_optarg_prefix uc_n;
pr " }\n";
) optargs;
pr "\n";
@@ -597,8 +596,8 @@ ruby_user_cancel (VALUE gv)
);
pr "\n";
- pr " r = %s " c_f...
2017 Jun 03
3
[PATCH 0/3]: daemon: Reimplement ‘file’ API in OCaml.
This patch series is just FYI at the moment. However it
does pass the tests.
The daemon is a self-contained program. We don't need to write it all
in C. Writing parts of it in OCaml would make it simpler and less
error-prone. In particular if the daemon was written in a more sane
programming language then we could move the inspection code to run
entirely inside the appliance, which would
2017 Jul 21
0
[PATCH v2 01/23] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...tListOnly | RStructAndList) ->
+ emit_return_struct typ;
+ emit_return_struct_list typ
+ ) (rstructs_used_by (actions |> impl_ocaml_functions));
+
+ (* Implement the wrapper functions. *)
+ List.iter (
+ fun ({ name = name; style = ret, args, optargs } as f) ->
+ let uc_name = String.uppercase_ascii name in
+ let ocaml_function =
+ match f.impl with
+ | OCaml f -> f
+ | C -> assert false in
+
+ pr "/* Wrapper for OCaml function ‘%s’. */\n" ocaml_function;
+
+ let args_do_function = args @ args_of_optargs optargs in...
2017 Jun 03
12
[PATCH v2 00/12] Allow APIs to be implemented in OCaml.
Version 1 was here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00003.html
This patch series reimplements a few more APIs in OCaml, including
some very important core APIs like ?list_filesystems? and ?mount?.
All the tests pass after this.
The selection of APIs that I have moved may look a little random, but
in fact they are all APIs consumed by the inspection code (and some
more
2020 Jun 01
1
[PATCH] erlang: Port to libei for Erlang 23
...r "\n";
List.iter (
fun argt ->
@@ -407,21 +415,22 @@ instead of erl_interface.
pr " if (atom_equals (hd_name, \"%s\")) {\n" n;
pr " optargs_s.bitmask |= %s_%s_BITMASK;\n"
c_optarg_prefix uc_n;
- pr " optargs_s.%s = " n;
+ pr " ";
(match argt with
- | OBool _ -> pr "get_bool (hd_value)"
- | OInt _ -> pr "get_int (hd_value)"
- | OInt64 _ -> pr "get_int64 (...
2017 Jun 05
19
[PATCH v3 00/19] Allow APIs to be implemented in OCaml.
v2 was here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00008.html
This series gets as far as a working (and faster) reimplementation of
‘guestfs_list_filesystems’.
I also have another patch series on top of this one which reimplements
the inspection APIs inside the daemon, but that needs a bit more work
still, since inspection turns out to be a very large piece of code.
Rich.
2016 Sep 02
6
[PATCH 0/4] generator: Some work to split large C files
By splitting up large C files we can make parallel compiles
a bit faster.
Rich.