Displaying 20 results from an estimated 36 matches for "c_quote".
2016 Apr 11
1
[PATCH] fish: improve formatting of help text of generated commands
...deletions(-)
diff --git a/generator/fish.ml b/generator/fish.ml
index 864f65d..646674d 100644
--- a/generator/fish.ml
+++ b/generator/fish.ml
@@ -71,6 +71,11 @@ let all_functions_commands_and_aliases_sorted =
) (fish_functions_sorted @ fish_commands) [] in
List.sort func_compare all
+let c_quoted_indented ~indent str =
+ let str = c_quote str in
+ let str = replace_str str "\\n" ("\\n\"\n" ^ indent ^ "\"") in
+ str
+
(* Generate a lot of different functions for guestfish. *)
let generate_fish_cmds () =
generate_header CStyle GPLv2plus;
@@ -13...
2009 Aug 17
1
two more warning-avoidance patches
...char const *const *argv)
+static void print_strings (char *const *argv)
{
int argc;
@@ -5869,7 +5869,7 @@ and generate_test_command_call ?(expect_error = false) ?test test_name cmd =
fun i str ->
pr " const char *%s_%d = \"%s\";\n" n i (c_quote str);
) strs;
- pr " const char *%s[] = {\n" n;
+ pr " const char *const %s[] = {\n" n;
iteri (
fun i _ -> pr " %s_%d,\n" n i
) strs;
@@ -5912,7 +5912,7 @@ and generate_test_comma...
2014 Dec 01
2
[PATCH v2] fish: show synopsis if command syntax is wrong
...~trim:false ~discard:false "NAME" pod)
@@ -190,6 +190,7 @@ Guestfish will prompt for these separately."
pr "struct command_entry %s_cmd_entry = {\n" name;
pr " .name = \"%s\",\n" name2;
pr " .help = \"%s\",\n" (c_quote text);
+ pr " .synopsis = \"%s\",\n" (c_quote synopsis);
pr " .run = run_%s\n" name;
pr "};\n";
pr "\n";
@@ -393,30 +394,14 @@ Guestfish will prompt for these separately."
if argc_minimum = argc_maximum then...
2014 Dec 02
1
Re: [PATCH v2] fish: show synopsis if command syntax is wrong
...List.iter (
> fun { name = name } ->
> @@ -129,6 +133,7 @@ let generate_fish_cmds () =
> pr "struct command_entry %s_cmd_entry = {\n" name;
> pr " .name = \"%s\",\n" name2;
> pr " .help = \"%s\",\n" (c_quote text);
> + pr " .synopsis = NULL,\n";
> pr " .run = run_%s\n" name;
> pr "};\n";
> pr "\n";
> @@ -190,6 +195,7 @@ Guestfish will prompt for these separately."
> pr "struct command_entry %s_cmd_ent...
2014 Oct 22
0
[PATCH] tests: c-api: add $datadir and $databuilddir
...nerator/tests_c_api.ml
@@ -385,17 +385,16 @@ and generate_test_command_call ?(expect_error = false) ?test ?ret test_name cmd=
| String _, arg, sym
| OptString _, arg, sym
| Key _, arg, sym
- | GUID _, arg, sym ->
- pr " const char *%s = \"%s\";\n" sym (c_quote arg);
+ | GUID _, arg, sym
+ | FileIn _, arg, sym ->
+ pr " CLEANUP_FREE char *%s = substitute_environment (\"%s\");\n"
+ sym (c_quote arg)
| BufferIn _, arg, sym ->
pr " const char *%s = \"%s\";\n" sym (c_quote arg);...
2015 Feb 10
1
[PATCH] php: add a simple bindtests test
...(String.concat "," (List.map (sprintf "\"%s\"") xs))
+ | CallInt i -> string_of_int i
+ | CallInt64 i -> Int64.to_string i
+ | CallBool b -> if b then "1" else "0"
+ | CallBuffer s -> "\"" ^ c_quote s ^ "\""
+ ) args
+ )
+ in
+
+ generate_lang_bindtests (
+ fun f args optargs ->
+ pr "if (guestfs_%s ($g, %s) == false) {\n" f (mkargs args);
+ pr " echo (\"Call failed: \" . guestfs_last_error ($g) . \"\\n\");\n";
+...
2016 Aug 18
3
[PATCH v2 0/2] v2v: Use OVMF secure boot file (RHBZ#1367615).
First version was posted here:
https://www.redhat.com/archives/libguestfs/2016-August/thread.html#00100
This is semantically the same as the first version. However
I've split the patch up into two parts. In the first part,
I factor out the UEFI paths so now they are created by the
generator and written in the library and v2v/ directory directly,
instead of the complex business of having a C
2014 Nov 28
2
[PATCH] fish: show synopsis if command syntax is wrong
...4
--- a/generator/fish.ml
+++ b/generator/fish.ml
@@ -190,6 +190,7 @@ Guestfish will prompt for these separately."
pr "struct command_entry %s_cmd_entry = {\n" name;
pr " .name = \"%s\",\n" name2;
pr " .help = \"%s\",\n" (c_quote text);
+ pr " .synopsis = \"%s\",\n" (c_quote synopsis);
pr " .run = run_%s\n" name;
pr "};\n";
pr "\n";
@@ -393,30 +394,14 @@ Guestfish will prompt for these separately."
if argc_minimum = argc_maximum then...
2014 Oct 05
0
[PATCH v5 2/7] tests/c-api: Convert the C API tests to use the test harness.
...nerator/tests_c_api.ml
@@ -385,17 +385,16 @@ and generate_test_command_call ?(expect_error = false) ?test ?ret test_name cmd=
| String _, arg, sym
| OptString _, arg, sym
| Key _, arg, sym
- | GUID _, arg, sym ->
- pr " const char *%s = \"%s\";\n" sym (c_quote arg);
+ | GUID _, arg, sym
+ | FileIn _, arg, sym ->
+ pr " CLEANUP_FREE char *%s = substitute_environment (\"%s\");\n"
+ sym (c_quote arg)
| BufferIn _, arg, sym ->
pr " const char *%s = \"%s\";\n" sym (c_quote arg);...
2015 Aug 06
0
[PATCH v4 02/17] tests/c-api: Convert the C API tests to use the test harness.
...nerator/tests_c_api.ml
@@ -403,17 +403,16 @@ and generate_test_command_call ?(expect_error = false) ?test ?ret test_name cmd=
| String _, arg, sym
| OptString _, arg, sym
| Key _, arg, sym
- | GUID _, arg, sym ->
- pr " const char *%s = \"%s\";\n" sym (c_quote arg);
+ | GUID _, arg, sym
+ | FileIn _, arg, sym ->
+ pr " CLEANUP_FREE char *%s = substitute_environment (\"%s\");\n"
+ sym (c_quote arg)
| BufferIn _, arg, sym ->
pr " const char *%s = \"%s\";\n" sym (c_quote arg);...
2011 Nov 10
5
[PATCH v2] Add tune2fs command.
The changes since the previous patch:
- safe ADD_ARG macro for adding arguments to a fixed size stack array
- support for testing functions that return RHashtable, ie. tune2fs-l.
- add tests that set (tune2fs) and get (tune2fs-l) various parameters.
- only one 'intervalbetweenchecks' parameter (in seconds)
Rich.
2016 Jan 27
2
[PATCH 1/2] generator: add TestRunOrUnsupported test type
...tils.ml
index 6eff6ad..34edf9d 100644
--- a/generator/utils.ml
+++ b/generator/utils.ml
@@ -266,7 +266,8 @@ let seq_of_test = function
| TestResultDevice (s, _)
| TestResultTrue s
| TestResultFalse s
- | TestLastFail s -> s
+ | TestLastFail s
+ | TestRunOrUnsupported s -> s
let c_quote str =
let str = replace_str str "\\" "\\\\" in
--
2.5.0
2014 Feb 10
5
[PATCH 0/4] add GUID validation (RHBZ#1008417)
Hi,
this patch serie adds a new GUID type in the generator, which would do
the same as String, but also validating (just in the C output) the
passed GUID string.
This allows to reject invalid GUIDs before passing them to low-level
tools.
Pino Toscano (4):
utils: add a function to validate a GUID string
generator: add a GUID parameter type
generator: generate code for parameter validation
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
2016 Dec 08
4
[PATCH] generator: Share Common_utils code.
...place_char n '_' '-') non_c_aliases in
+ List.map (fun n -> String.replace_char n '_' '-') non_c_aliases in
fish_alias @ non_c_aliases
let all_functions_commands_and_aliases_sorted =
@@ -73,7 +74,7 @@ let all_functions_commands_and_aliases_sorted =
let c_quoted_indented ~indent str =
let str = c_quote str in
- let str = replace_str str "\\n" ("\\n\"\n" ^ indent ^ "\"") in
+ let str = String.replace str "\\n" ("\\n\"\n" ^ indent ^ "\"") in
str
(* Generate run_* func...
2009 Nov 09
1
use STREQ(a,b), not strcmp(a,b) == 0
...hello.vers);
diff --git a/src/generator.ml b/src/generator.ml
index 917fea9..3c1ff2b 100644
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -6001,7 +6001,7 @@ and generate_one_test_body name i test_name init test =
pr " const char *expected = \"%s\";\n" (c_quote expected);
let seq, last = get_seq_last seq in
let test () =
- pr " if (strcmp (r, expected) != 0) {\n";
+ pr " if (STRNEQ (r, expected)) {\n";
pr " fprintf (stderr, \"%s: expected \\\"%%s\\\" but got \\\"%...
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
2011 Nov 09
6
[PATCH] Add tune2fs support to libguestfs.
At the moment OpenStack uses kpartx and nbd to resize filesystems and
inject files to guests. I sincerely hope they don't allow untrusted
users to upload guest images / AMIs :-(
To fix this I'm looking into adding libguestfs support as an optional
backend in OpenStack.
The only missing feature in libguestfs is the ability to call tune2fs
on a filesystem. This patch series adds tune2fs
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.