search for: s_bitmask

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

Did you mean: bitmask
2012 Jan 17
2
[PATCH 1/2] c: NFC Remove redundant parentheses
...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
2014 Aug 11
3
[PATCH] python: fix possible free on uninit memory with OStringList optargs
...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
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 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.
...tf +open Common_utils open Types open Utils open Pr @@ -176,7 +177,7 @@ fill_lvm_pv (guestfs_h *g, struct guestfs_lvm_pv *pv, size_t i) let check_optarg n printf_args = pr " fprintf (fp, \"%s: \");\n" n; pr " if (optargs->bitmask & %s_%s_BITMASK) {\n" c_optarg_prefix - (String.uppercase n); + (String.uppercase_ascii n); pr " fprintf (fp, %s);\n" printf_args; pr " } else {\n"; pr " fprintf (fp, \"unset\\n\");\n"; @@ -200,7 +201,7 @@ fill_lvm_pv...
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.
...OURCES_ML = \ blkid.ml \ devsparts.ml \ file.ml \ + is.ml \ callbacks.ml \ daemon.ml diff --git a/daemon/is.c b/daemon/is.c index 4d5e911c2..a91dab32b 100644 --- a/daemon/is.c +++ b/daemon/is.c @@ -39,36 +39,6 @@ do_exists (const char *path) /* Takes optional arguments, consult optargs_bitmask. */ int -do_is_file (const char *path, int followsymlinks) -{ - mode_t mode; - int r; - - if (!(optargs_bitmask & GUESTFS_IS_FILE_FOLLOWSYMLINKS_BITMASK)) - followsymlinks = 0; - - r = get_mode (path, &mode, followsymlinks); - if (r <= 0) return r; - return S_ISREG (mode); -} -...
2012 Sep 20
0
[PATCH] python: PyInt_* no longer exists in python3, replace with PyLong_*
...hon.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; pr " if (PyErr_Occ...
2015 Feb 10
0
[PATCH 4/4] php: fix memory leak in OStringList optargs
...| 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
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.
2013 Feb 04
1
[PATCH] generator: Add visibility to action struct
...pr " volatile VALUE v;\n"; 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"; -...
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, hd_name) != 0) return -1;\n"; pr "\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)" -...
2012 Jan 20
11
[PATCH 01/10] Revert "Revert "generator: Add CamelName flag""
This reverts commit 3f6ca541c7b24d4c86688a509582cb41a7e0078c. The original commit was reverted prematurely. --- generator/generator_actions.ml | 10 +++++----- generator/generator_checks.ml | 5 +++++ generator/generator_types.ml | 3 +++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index
2012 Jan 17
3
GObject bindings
This is the first iteration of the GObject bindings. I have 'kicked the tyres' on these, meaning I have ensured that a bunch of basic manual tests work as expected. I'm in the process of adding more comprehensive tests. Here's an example simple javascript program which uses these bindings: === const Guestfs = imports.gi.Guestfs; print('Starting'); var g = new
2017 Jul 14
0
[PATCH 02/27] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...nal 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 " else {\n"; + pr " v = "; + (match optarg with + | OBool _ -> + pr &quot...
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 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
2017 Jul 21
0
[PATCH v2 01/23] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...nal 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 & GUESTFS_%s_%s_BITMASK) == 0)\n" + uc_name uc_n; + pr " args[%d] = Val_int (0); /* None */\n" !i; + pr " else {\n"; + pr " v = "; + (match optarg with + | OBool _ -> + pr "V...