search for: optstr

Displaying 20 results from an estimated 163 matches for "optstr".

Did you mean: opcstr
2018 Aug 20
1
[PATCH] common/mltools: getopt: add Getopt.OptString
...s/getopt-c.c b/common/mltools/getopt-c.c index 7b7e39be2..5fa703428 100644 --- a/common/mltools/getopt-c.c +++ b/common/mltools/getopt-c.c @@ -274,6 +274,10 @@ guestfs_int_mllib_getopt_parse (value argsv, value specsv, value anon_funv, valu has_arg = 1; break; + case 8: /* OptString of string * (string option -> unit) */ + has_arg = 2; + break; + default: error (EXIT_FAILURE, 0, "internal error: unhandled Tag_val (actionv) = %d", @@ -286,8 +290,11 @@ guestfs_int_mllib_getopt_parse (value argsv, value specsv, value a...
2018 Aug 21
0
[PATCH 1/2] common/mltools: getopt: add Getopt.OptString
...s/getopt-c.c b/common/mltools/getopt-c.c index 7b7e39be2..5fa703428 100644 --- a/common/mltools/getopt-c.c +++ b/common/mltools/getopt-c.c @@ -274,6 +274,10 @@ guestfs_int_mllib_getopt_parse (value argsv, value specsv, value anon_funv, valu has_arg = 1; break; + case 8: /* OptString of string * (string option -> unit) */ + has_arg = 2; + break; + default: error (EXIT_FAILURE, 0, "internal error: unhandled Tag_val (actionv) = %d", @@ -286,8 +290,11 @@ guestfs_int_mllib_getopt_parse (value argsv, value specsv, value a...
2018 Aug 21
4
[PATCH 0/2] RFC: add output selection for --machine-readable
...he proposed --print-estimate for virt-v2v [1] could print human output (just like the --print-source), while printing e.g. JSON to the machine-readable stream. [1] https://www.redhat.com/archives/libguestfs/2018-August/msg00158.html Thanks, Pino Toscano (2): common/mltools: getopt: add Getopt.OptString OCaml tools: add output selection for --machine-readable builder/cmdline.ml | 12 ++++---- builder/repository_main.ml | 2 +- common/mltools/getopt-c.c | 20 ++++++++++++- common/mltools/getopt.ml | 5 +++- common/mltools/getopt.mli | 4 +++ common/mltools/...
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
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
2019 May 29
0
[PATCH 3/3] daemon: implement OptString for OCaml APIs
It is already considered as string option, so create an option string value in the C glue for OptString parameters. --- generator/daemon.ml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/generator/daemon.ml b/generator/daemon.ml index a4e136aaa..c2b7c79a2 100644 --- a/generator/daemon.ml +++ b/generator/daemon.ml @@ -600,6 +600,22 @@ let generate_daemon_cam...
2012 Sep 12
2
[PATCH] drm/nouveau: add default debug level override
...DEBUG_DEFAULT; +module_param_named(debug_level, nouveau_debug_level, int, 0400); + /* compares unterminated string 'str' with zero-terminated string 'cmp' */ static inline int strncasecmpz(const char *str, const char *cmp, size_t len) @@ -86,7 +93,7 @@ nouveau_boolopt(const char *optstr, const char *opt, bool value) int nouveau_dbgopt(const char *optstr, const char *sub) { - int mode = 1, level = CONFIG_NOUVEAU_DEBUG_DEFAULT; + int mode = 1, level = nouveau_debug_level; while (optstr) { int len = strcspn(optstr, ",="); -- 1.7.12
2015 Oct 20
3
[PATCH 1/2] generator: add a RelativePathnameList parameter type
...ator/bindtests.ml index 0959704..1d9ea3e 100644 --- a/generator/bindtests.ml +++ b/generator/bindtests.ml @@ -163,7 +163,8 @@ fill_lvm_pv (guestfs_h *g, struct guestfs_lvm_pv *pv, size_t i) pr " fprintf (fp, \"\\n\");\n"; pr " }\n"; | OptString n -> pr " fprintf (fp, \"%%s\\n\", %s ? %s : \"null\");\n" n n - | StringList n | DeviceList n -> pr " print_strings (g, %s);\n" n + | StringList n | DeviceList n | RelativePathnameList n -> + pr " print_strings (g,...
2015 Oct 21
2
[PATCH 1/2] generator: add a FilenameList parameter type
...ator/bindtests.ml index 0959704..020d059 100644 --- a/generator/bindtests.ml +++ b/generator/bindtests.ml @@ -163,7 +163,8 @@ fill_lvm_pv (guestfs_h *g, struct guestfs_lvm_pv *pv, size_t i) pr " fprintf (fp, \"\\n\");\n"; pr " }\n"; | OptString n -> pr " fprintf (fp, \"%%s\\n\", %s ? %s : \"null\");\n" n n - | StringList n | DeviceList n -> pr " print_strings (g, %s);\n" n + | StringList n | DeviceList n | FilenameList n -> + pr " print_strings (g, %s);\n&q...
2013 Feb 07
12
[PATCH 01/12] generator: Add new Mountable argument type
...fa81ed 100644 --- a/generator/c.ml +++ b/generator/c.ml @@ -121,7 +121,7 @@ let rec generate_prototype ?(extern = true) ?(static = false) List.iter ( function | Pathname n - | Device n | Dev_or_Path n + | Device n | Mountable n | Dev_or_Path n | String n | OptString n | Key n -> @@ -852,6 +852,7 @@ and generate_client_actions hash () = (* parameters which should not be NULL *) | String n | Device n + | Mountable n | Pathname n | Dev_or_Path n | FileIn n @@ -969,6 +970,7 @@ and generate_client_actions...
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 change...
2009 Aug 12
23
[PATCH 0/23] factor and const-correctness
This started as a simple warning-elimination change. I'll get back to that series shortly ;-) It turned into a factorization and constification exercise during which I got a taste of ocaml. Thanks to Rich Jones for help with a few snippets in generator.ml. The overall result is that many previously-manually-maintained bits from daemon/*.c functions are now hoisted into the automatically-
2009 Mar 05
0
[PATCH 5/5] COM32/rosh: Improvements
...tr Present Working Directory string */ -void rosh_cfg(const char *cmdstr, const char *pwdstr) +void rosh_cfg() { - ROSH_DEBUG("CMD: '%s'\npwd: '%s'\n", cmdstr, pwdstr); printf("CFG: '%s'\n", syslinux_config_file()); } /* rosh_cfg */ +/* Process optstr to optarr + * optstr option string to process + * optarr option array to populate + */ +void rosh_ls_arg_opt(const char *optstr, int *optarr) +{ + char *cpos; + cpos = strchr(optstr, 'l'); + if (cpos) { + optarr[0] = cpos - optstr; + } else { + optarr[0] = -1; + } + cpos = strchr(optstr,...
2014 Jun 23
4
[PATCH] utils/isohybrid.c: 007 (2nd try) Enable promised options -u, -m, -b
...as promised by the help text. --- isohybrid.c.006_opt_mbr_standalone 2014-06-22 20:10:49.000000000 +0200 +++ isohybrid.c.007_short_opts_umb 2014-06-23 19:52:59.000000000 +0200 @@ -262,7 +262,7 @@ check_option(int argc, char *argv[]) char *err = NULL; int n = 0, ind = 0; - const char optstr[] = ":h:s:e:o:t:i:fcp?vV"; + const char optstr[] = ":h:s:e:o:t:i:b:umfcp?vV"; struct option lopt[] = \ { { "entry", required_argument, NULL, 'e' },
2018 Aug 23
3
[PATCH v2 0/2] add output selection for --machine-readable
...0158.html Changes from v1: - adjusted the formatting for help text in patch #1 - moved all the machine_readable machinery in Tools_utils - expose all in a single machine_readable () function - add a test - add the documentation bits Thanks, Pino Toscano (2): common/mltools: getopt: add Getopt.OptString OCaml tools: add output selection for --machine-readable .gitignore | 1 + builder/cmdline.ml | 16 +++--- builder/repository_main.ml | 6 ++- builder/virt-builder-repository.pod | 5 ++ builder/virt-builder.pod...
2010 May 19
0
[PATCH] generator: Some String parameters should be OptString (RHBZ#501894).
...//et.redhat.com/~rjones/virt-top -------------- next part -------------- >From 34a463e8a3f5c05f8258c2b6cfaa6d983e703c83 Mon Sep 17 00:00:00 2001 From: Richard Jones <rjones at redhat.com> Date: Wed, 19 May 2010 12:25:03 +0100 Subject: [PATCH 1/2] generator: Some String parameters should be OptString (RHBZ#501894). I haven't checked the list of functions exhaustively, but these are the obvious ones. --- src/generator.ml | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generator.ml b/src/generator.ml index 32a8140..f976d81 100755 --- a/src/generator.ml +++...
2009 Aug 17
13
total warning-removal for daemon/
The warnings in daemon were aggravating and risky for development (too easy to miss new ones) so I spent some time last week and today working on removing them. The first patch gets us down to almost no warnings with the original -Wall setting. That was by far the hardest part. Once I'd done that, I enabled nearly all of gcc's warnings via gnulib's warnings and manywarnings modules
2012 Feb 23
1
[PATCH v2] Add a flag to make some functions called only at CONFIG state(RHBZ796520)
...in snapshot mode (read-only)", "\ @@ -194,7 +194,7 @@ with the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk is added read-only, with the format being detected automatically."); - ("config", (RErr, [String "qemuparam"; OptString "qemuvalue"], []), -1, [], + ("config", (RErr, [String "qemuparam"; OptString "qemuvalue"], []), -1, [ConfigOnly], [], "add qemu parameters", "\ @@ -207,7 +207,7 @@ The first character of C<param> string must be a C<-&g...
2010 Jun 27
1
[PATCH] ROSH: Upgraded
...rking Directory string */ -void rosh_cfg(const char *cmdstr, const char *pwdstr) +void rosh_cfg(void) { - ROSH_DEBUG("CMD: '%s'\npwd: '%s'\n", cmdstr, pwdstr); printf("CFG: '%s'\n", syslinux_config_file()); } /* rosh_cfg */ +/* Process optstr to optarr + * optstr option string to process + * optarr option array to populate + */ +void rosh_ls_arg_opt(const char *optstr, int *optarr) +{ + char *cpos; + cpos = strchr(optstr, 'l'); + if (cpos) { + optarr[0] = cpos - optstr; + } else { + optarr[0] = -1; + } + cpos =...
2005 Jan 05
2
[PATCH] getopt
...ig 2005-01-04 23:18:50.229222640 -0700 +++ klibc-0.194/klibc/getopt.c 2005-01-04 23:17:05.236184008 -0700 @@ -11,7 +11,7 @@ char *optarg; int optind = 1; int opterr, optopt; -static const char *__optptr; +static const char *__optptr = NULL; int getopt(int argc, char * const *argv, const char *optstring) { @@ -51,6 +51,7 @@ optind += 2; } else { /* Missing argument */ + optind++; return (optstring[0] == ':') ? ':' : '?'; } } -- Thayne Harbaugh Linux Networx -------------- next part -------------- A non-text attachment was scrubbed... Name: no...