search for: args_of_optargs

Displaying 20 results from an estimated 29 matches for "args_of_optargs".

2015 Feb 10
3
[PATCH 1/3] generator: add a simple HTML escaping function
--- generator/utils.ml | 8 +++++++- generator/utils.mli | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/generator/utils.ml b/generator/utils.ml index b24ba8c..3a62084 100644 --- a/generator/utils.ml +++ b/generator/utils.ml @@ -360,4 +360,10 @@ let args_of_optargs optargs = | OInt64 n -> Int64 n | OString n -> String n | OStringList n -> StringList n - ) optargs; + ) optargs + +let html_escape text = + let text = replace_str text "&" "&amp;" in + let text = replace_str text "<" "&l...
2016 Jun 14
1
[PATCH] generator: Remove unnecessary 'chars' function.
...o actions (for sorting). *) let action_compare { name = n1 } { name = n2 } = compare n1 n2 -let chars c n = - let str = String.create n in - for i = 0 to n-1 do - String.unsafe_set str i c - done; - str - -let spaces n = chars ' ' n +let spaces n = String.make n ' ' let args_of_optargs optargs = List.map ( diff --git a/generator/utils.mli b/generator/utils.mli index aec1f71..41dd47d 100644 --- a/generator/utils.mli +++ b/generator/utils.mli @@ -123,9 +123,6 @@ val pod2text : ?width:int -> ?trim:bool -> ?discard:bool -> string -> string -> val action_compare : T...
2013 Aug 24
46
[PATCH 00/46] Proposed patches for libguestfs 1.20.11.
Tested with 'make check-release'. tests/parallel (in check-slow) failed, although it does regularly and that seems to be because of libvirt. Rich.
2017 May 04
1
[PATCH] perl: drop %guestfs_introspection stuff
..." - ) args; - pr " ],\n"; - if optargs <> [] then ( - pr " optargs => {\n"; - iteri (fun i arg -> - pr " %s => " (name_of_argt arg); - pr_type i arg; - pr ",\n" - ) (args_of_optargs optargs); - pr " },\n"; - ); - pr " name => \"%s\",\n" name; - pr " description => %S,\n" shortdesc; - pr " },\n"; - ) (actions |> external_functions |> sort); - pr ");\n\n"; - - pr &quot...
2017 Apr 20
6
[PATCH 0/5] generator: daemon: Various simplifications to stubs code.
This is a series of simplifications to the stubs code. It's all refactoring, there is no functional change. Rich.
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...pr "#define OPTGROUP_%s_NOT_AVAILABLE \\\n" (String.uppercase group); + pr "#define OPTGROUP_%s_NOT_AVAILABLE \\\n" + (String.uppercase_ascii group); List.iter ( fun { name = name; style = ret, args, optargs } -> let style = ret, args @ args_of_optargs optargs, [] in diff --git a/generator/docstrings.ml b/generator/docstrings.ml index 9d3fd0b..845ec63 100644 --- a/generator/docstrings.ml +++ b/generator/docstrings.ml @@ -21,6 +21,7 @@ open Unix open Printf +open Common_utils open Types open Utils open Pr @@ -41,7 +42,7 @@ let deprecation_n...
2016 May 04
9
[PATCH 0/8] python: PEP 8 fixes
Hi, this series cleans up the Python sources, either static or generated, including also tests, to make them PEP 8 compliant; see https://www.python.org/dev/peps/pep-0008/ and tools like pep8. Almost all the issues reported by pep8 are fixed, reducing the issues from 3818 to 7. The changes should have no effect on the actual code, while it will help Python users with consistency with other
2017 Oct 04
0
[PATCH 2/9] ocaml: Replace pattern matching { field = field } with { field }.
...+++ b/generator/daemon.ml @@ -59,7 +59,7 @@ let generate_daemon_actions_h () = ) (actions |> daemon_functions |> sort); List.iter ( - fun { name = name; style = ret, args, optargs } -> + fun { name; style = ret, args, optargs } -> let args_passed_to_daemon = args @ args_of_optargs optargs in let args_passed_to_daemon = List.filter (function String ((FileIn|FileOut), _) -> false | _ -> true) @@ -83,7 +83,7 @@ let generate_daemon_stubs_h () = "; List.iter ( - fun { name = name } -> + fun { name } -> pr "extern void %s_st...
2013 Aug 24
67
[PATCH 00/67] Proposed patches for libguestfs 1.22.6.
In the kernel and qemu communities it is routine for patches that will be backported to stable branches to be posted for review. I'm proposing we do the same for libguestfs stable branches. All of the attached have been tested with 'make check-release'. Rich.
2017 Jul 14
0
[PATCH 02/27] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...fun ({ name = name; style = ret, args, optargs } as f) -> + 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 + let args_do_function = + List.filter (function + | String ((FileIn|FileOut), _) -> false | _ -> true) + args_do_function in + let style = ret, args_do_function, [] in + generate_prototype ~extern:false ~semicolon:false...
2017 Apr 21
0
[PATCH 1/2] generator: Simplify the handling of string parameters.
...gt; pr "bool -> " | Int _ -> pr "int -> " diff --git a/generator/XDR.ml b/generator/XDR.ml index 634a4f336..b0ca26558 100644 --- a/generator/XDR.ml +++ b/generator/XDR.ml @@ -90,27 +90,25 @@ let generate_xdr () = *) let args_passed_to_daemon = args @ args_of_optargs optargs in let args_passed_to_daemon = - List.filter (function FileIn _ | FileOut _ -> false | _ -> true) - args_passed_to_daemon in + List.filter (function String ((FileIn|FileOut), _) -> false | _ -> true) + args_passed_to_daemon in...
2017 Oct 04
11
[PATCH 0/9] build: Require OCaml >= 4.02.
Per my previous email: https://www.redhat.com/archives/libguestfs/2017-September/msg00203.html I'd like to talk about requiring a more modern version of the OCaml compiler. These commits show some of the code changes which would be possible with OCaml >= 3.12 [which it turns out we already require by accident] and also with OCaml >= 4.02. The latter is my favoured option. Rich.
2017 Apr 21
4
[PATCH 0/2] generator: Simplify the handling of string parameters.
Very large but mechanical change to the generator. Rich.
2013 Feb 04
1
[PATCH] generator: Add visibility to action struct
...) args; pr " self._check_not_closed ()\n"; - pr " return libguestfsmod.%s (self._o" name; + pr " return libguestfsmod.%s (self._o" f.name; List.iter (fun arg -> pr ", %s" (name_of_argt arg)) (args @ args_of_optargs optargs); pr ")\n\n"; @@ -794,6 +794,6 @@ class GuestFS(object): (* Aliases. *) List.iter ( fun alias -> - pr " %s = %s\n\n" alias name - ) non_c_aliases - ) all_functions + pr " %s = %s\n\n" alias f.name +...
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
2013 Jan 24
3
[REVIEW ONLY] Mountable patches
These 3 patches implement support for APIs which must accept a mountable, but don't update apis which must return mountables. Matt
2017 Jul 21
0
[PATCH v2 01/23] daemon: Allow parts of the daemon and APIs to be written in OCaml.
...s 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 + let args_do_function = + List.filter (function + | String ((FileIn|FileOut), _) -> false | _ -> true) + args_do_function in + let style = ret, args_do_function, [] in + generate_prototype ~extern:false ~semicolon:false...
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.
2013 Feb 07
12
[PATCH 01/12] generator: Add new Mountable argument type
This type is initially identical to Device. --- generator/bindtests.ml | 2 +- generator/c.ml | 7 +++++-- generator/csharp.ml | 6 ++++-- generator/daemon.ml | 4 ++-- generator/erlang.ml | 6 +++--- generator/fish.ml | 8 ++++---- generator/gobject.ml | 11 ++++++----- generator/haskell.ml | 11 +++++++---- generator/java.ml | 10 +++++-----
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.