search for: optargs_s

Displaying 20 results from an estimated 31 matches for "optargs_s".

2014 Aug 11
3
[PATCH] python: fix possible free on uninit memory with OStringList optargs
When using optional arguments of type OStringList, the code free'ing the member in the optargs_s struct corresponding to that optional argument would just check for a non-PyNone PyObject for that argument. If before that optional argument there are other arguments which can cause an earlier error return from that binding function, the free'ing code will then act on garbage values. Enhance...
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.
2017 May 09
1
[PATCH v2] python: add simple wrappers for PyObject<->string functions
...pr " guestfs_int_py_fromstringsize (&%s->%s, 1));\n" + typ name ) cols; pr " return dict;\n"; pr "};\n"; @@ -419,13 +401,7 @@ and generate_python_actions actions () = pr " optargs_s.%s = PyLong_AsLongLong (py_%s);\n" n n; pr " if (PyErr_Occurred ()) goto out;\n" | OString _ -> - pr "#ifdef HAVE_PYSTRING_ASSTRING\n"; - pr " optargs_s.%s = PyString_AsString (py_%s);\n" n n; -...
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
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 May 09
0
[PATCH] python: add simple wrappers for PyObject<->string functions
...pr " guestfs_int_py_fromstringsize (&%s->%s, 1));\n" + typ name ) cols; pr " return dict;\n"; pr "};\n"; @@ -419,13 +401,7 @@ and generate_python_actions actions () = pr " optargs_s.%s = PyLong_AsLongLong (py_%s);\n" n n; pr " if (PyErr_Occurred ()) goto out;\n" | OString _ -> - pr "#ifdef HAVE_PYSTRING_ASSTRING\n"; - pr " optargs_s.%s = PyString_AsString (py_%s);\n" n n; -...
2012 Aug 25
1
[PATCH] python: Fixed syntax errors in python/guestfs-py.c
...1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/generator_python.ml b/generator/generator_python.ml index dc9cbca..b11df6e 100644 --- a/generator/generator_python.ml +++ b/generator/generator_python.ml @@ -391,7 +391,7 @@ free_strings (char **argv) pr " optargs_s.%s = PyString_AsString (py_%s);\n" n n; pr "#else\n"; pr " PyObject *bytes;\n"; - pr " bytes = PyUnicode_AsUTF8String (py_%s));\n" n; + pr " bytes = PyUnicode_AsUTF8String (py_%s);\n" n;...
2012 Sep 20
0
[PATCH] python: PyInt_* no longer exists in python3, replace with PyLong_*
--- generator/python.ml | 2 +- 1 file changed, 1 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; p...
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.
2018 Aug 10
2
[PATCH] Change wording from "twice" to "more than once" in error messages
...), 11 deletions(-) diff --git a/generator/fish.ml b/generator/fish.ml index 33da789bd..708c1b3a9 100644 --- a/generator/fish.ml +++ b/generator/fish.ml @@ -367,7 +367,7 @@ let generate_fish_run_cmds actions () = pr " }\n"; pr "\n"; pr " if (optargs_s.bitmask & this_mask) {\n"; - pr " fprintf (stderr, _(\"%%s: optional argument \\\"%%s\\\" given twice\\n\"),\n"; + pr " fprintf (stderr, _(\"%%s: optional argument \\\"%%s\\\" given more than once\\n\"),\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.
2020 Jun 01
1
[PATCH] erlang: Port to libei for Erlang 23
...idx, &%s) != 0) return -1;\n" n | Pointer (t, n) -> pr " void * /* %s */ %s = POINTER_NOT_IMPLEMENTED (\"%s\");\n" t n t ) args; @@ -394,11 +400,13 @@ instead of erl_interface. pr "\n"; pr " struct %s optargs_s = { .bitmask = 0 };\n" c_function; pr " struct %s *optargs = &optargs_s;\n" c_function; - pr " ETERM *optargst = ARG (%d);\n" (List.length args); - pr " while (!ERL_IS_EMPTY_LIST (optargst)) {\n"; - pr " ETERM *hd = ERL...
2015 Feb 10
0
[PATCH 4/4] php: fix memory leak in OStringList optargs
...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 for errors. *) (match errcode_of_ret ret with -- 1.9.3
2013 Feb 04
1
[PATCH] generator: Add visibility to action struct
..._except_generated ~skip:["java/com/redhat/et/libguestfs/LibGuestFSException.java"; "java/com/redhat/et/libguestfs/EventCallback.java"] @@ -186,7 +186,7 @@ Run it from the top source directory using the command output_to filename (generate_gobject_optargs_source short name optargs f) | { style = _, _, [] } -> () - ) all_functions; + ) external_functions; delete_except_generated "gobject/include/guestfs-gobject/optargs-*.h"; delete_except_generated "gobject/src/optargs-*.c"; diff --git a/generator/ocaml.ml b/genera...
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.
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...ate_client_actions_variants () = fun argt -> let n = name_of_optargt argt in pr " case GUESTFS_%s_%s:\n" - (String.uppercase c_name) (String.uppercase n); + (String.uppercase_ascii c_name) (String.uppercase_ascii n); pr " optargs_s.%s = va_arg (args, " n; (match argt with | OBool _ | OInt _ -> pr "int" @@ -2273,7 +2275,8 @@ guestfs_event_to_string (uint64_t event) List.iter ( fun name -> - pr " if ((event & GUESTFS_EVENT_%s) != 0) {\n" (String.uppercase name...
2014 Jun 27
3
[PATCH WIP] Can't generate argv variant
Hi everyone, lately I've been getting familiar with library and working on slight re-layering of the library. It's about having locking layer in public API and tracing one layer below that (let's call it __t_ layer. I'm not very good at making up names, so this is temporary:) ). Then making sure that all generated public stuff call __t_ layer and all other internal stuff
2015 Jun 16
5
[PATCH threads v2 0/5] Add support for thread-safe handle.
Previous discussion here: https://www.redhat.com/archives/libguestfs/2015-June/thread.html#00048 v2: - Use a cleanup handler to release the lock. - Rebase to upstream. Note I have not fixed the problem(s) with error handling (patch 3).
2014 Dec 17
3
[PATCH 0/3] Allow environment variables to have boolean values.
https://bugzilla.redhat.com/show_bug.cgi?id=1175196 Currently if you write something like LIBGUESTFS_DEBUG=0 or LIBGUESTFS_DEBUG=true then it doesn't do what you probably expect. This patch series fixes that. Rich.
2020 Mar 17
0
[PATCH libnbd v2 3/3] golang: Add straightforward bindings, without callbacks.
--- generator/GoLang.ml | 336 +++++++++++++++++- .../libnbd/libnbd_200_connect_command_test.go | 35 ++ 2 files changed, 367 insertions(+), 4 deletions(-) diff --git a/generator/GoLang.ml b/generator/GoLang.ml index 1b8f20b..e5fb97c 100644 --- a/generator/GoLang.ml +++ b/generator/GoLang.ml @@ -23,6 +23,304 @@ open Printf open API open Utils +let go_name_of_arg =