search for: actionv

Displaying 15 results from an estimated 15 matches for "actionv".

Did you mean: action
2016 Jul 15
0
[PATCH 1/3] mllib: Fix parsing of integers on the command line and use correct int type.
...-c.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mllib/getopt-c.c b/mllib/getopt-c.c index 1f129a7..afb8793 100644 --- a/mllib/getopt-c.c +++ b/mllib/getopt-c.c @@ -247,7 +247,8 @@ guestfs_int_mllib_getopt_parse (value argsv, value specsv, value anon_funv, valu actionv = Field (specv, 1); switch (Tag_val (actionv)) { - int num; + long num; + int nchars; case 0: /* Unit of (unit -> unit) */ v = Field (actionv, 0); @@ -274,7 +275,8 @@ guestfs_int_mllib_getopt_parse (value argsv, value specsv, value anon_funv, valu break;...
2018 Aug 20
1
[PATCH] common/mltools: getopt: add Getopt.OptString
...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 anon_funv, valu caml_raise_out_of_memory (); optstring = newstring; optstring[optstring_len++] = key[0]; - if (has_arg) + if (has_arg > 0) { op...
2016 Jul 18
2
[PATCH] mllib: Getopt: fix integer parsing
...nt -> unit) */ - if (sscanf (optarg, "%d", &num) != 1) { - fprintf (stderr, _("'%s' is not a numeric value.\n"), - guestfs_int_program_name); - show_error (EXIT_FAILURE); - } + num = strtoint (optarg); v = Field (actionv, 1); do_call1 (v, Val_int (num)); break; case 6: /* Set_int of string * int ref */ - if (sscanf (optarg, "%d", &num) != 1) { - fprintf (stderr, _("'%s' is not a numeric value.\n"), - guestfs_int_program_name); -...
2007 Mar 01
0
7 commits - libswfdec/swfdec_connection.c libswfdec/swfdec_js_connection.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_js_net_stream.c libswfdec/swfdec_js_xml.c libswfdec/swfdec_net_stream.c libswfdec/swfdec_scriptable.c libswfdec/swfdec_scriptable.h
...rst (context->movielist); g; g = g_list_next (g)) { - listentry = (struct mc_list_entry *)g->data; - - if (listentry->movie == movie) - return listentry->mc; - } - - return NULL; -} - -static void -swfdec_native_ASSetPropFlags (SwfdecActionContext *context, int num_args, - ActionVal *_this) -{ - ActionVal *a; - ActionVal *b; - ActionVal *c; - ActionVal *d; - int allowFalse = 0; - int flags; - - a = stack_pop (context); /* obj */ - action_val_convert_to_object (a); - b = stack_pop (context); /* property list */ - c = stack_pop (context); /* flags */ - action_val_co...
2016 Jul 11
2
[PATCH v2] OCaml tools: add and use a Getopt module
...buf; + + while (len > 0) { + r = write (fd, buf, len); + if (r == -1) + error (EXIT_FAILURE, errno, "write"); + buf += r; + len -= r; + } +} + +static void +show_help (value specsv, value usage_msgv) +{ + CAMLparam2 (specsv, usage_msgv); + CAMLlocal4 (specv, keysv, actionv, docv); + FILE *f; + CLEANUP_FREE char *buf = NULL; + size_t buf_len = 0; + size_t i, specs_len; + + f = open_memstream (&buf, &buf_len); + if (f == NULL) + error (EXIT_FAILURE, errno, "open_memstream"); + + fprintf (f, _("%s\n" + "Options:\...
2018 Aug 21
0
[PATCH 1/2] common/mltools: getopt: add Getopt.OptString
...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 anon_funv, valu caml_raise_out_of_memory (); optstring = newstring; optstring[optstring_len++] = key[0]; - if (has_arg) + if (has_arg > 0) { op...
2016 Jul 18
0
Re: [PATCH] mllib: Getopt: fix integer parsing
...scanf (optarg, "%d", &num) != 1) { > - fprintf (stderr, _("'%s' is not a numeric value.\n"), > - guestfs_int_program_name); > - show_error (EXIT_FAILURE); > - } > + num = strtoint (optarg); > v = Field (actionv, 1); > do_call1 (v, Val_int (num)); > break; > > case 6: /* Set_int of string * int ref */ > - if (sscanf (optarg, "%d", &num) != 1) { > - fprintf (stderr, _("'%s' is not a numeric value.\n"), > -...
2018 Aug 21
4
[PATCH 0/2] RFC: add output selection for --machine-readable
Hi, this is a first approach (hence RFC, since it misses tests & documentation) in selecting the output for --machine-readable. The possible choices are: * --machine-readable: to stdout, like before * --machine-readable=file:name-of-file: to the specified file * --machine-readable=stream:stdout: explicitly to stdout * --machine-readable=stream:stderr: explicitly to stderr This makes it
2016 Jul 18
4
[PATCH 1/3] mllib: Getopt: point to man page as additional help
On error, point also to the man page of the current tool in addition to '$TOOL --help'. --- mllib/getopt-c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mllib/getopt-c.c b/mllib/getopt-c.c index bf40f91..3efd5d3 100644 --- a/mllib/getopt-c.c +++ b/mllib/getopt-c.c @@ -69,8 +69,8 @@ cleanup_option_list (void *ptr) static void __attribute__((noreturn))
2016 Jul 13
3
[PATCH v3 1/2] OCaml tools: add and use a Getopt module
...opt callback: %s\n", + caml_format_exception (Extract_exception (rv))); + + CAMLreturn0; +} + +value +guestfs_int_mllib_getopt_parse (value argsv, value specsv, value anon_funv, value usage_msgv) +{ + CAMLparam4 (argsv, specsv, anon_funv, usage_msgv); + CAMLlocal5 (specv, keysv, actionv, v, v2); + size_t argc; + CLEANUP_FREE_STRING_LIST char **argv = NULL; + size_t specs_len, i; + CLEANUP_FREE char *optstring = NULL; + int optstring_len = 0; + CLEANUP_FREE_OPTION_LIST struct option *longopts = NULL; + int longopts_len = 0; + int c; + int specv_index; + + argc = Wosize_va...
2016 Jun 24
2
[PATCH] RFC: OCaml tools: add and use a Getopt module
...buf; + + while (len > 0) { + r = write (fd, buf, len); + if (r == -1) + error (EXIT_FAILURE, errno, "write"); + buf += r; + len -= r; + } +} + +static void +show_help (value specsv, value usage_msgv) +{ + CAMLparam2 (specsv, usage_msgv); + CAMLlocal4 (specv, keysv, actionv, docv); + FILE *f; + CLEANUP_FREE char *buf = NULL; + size_t buf_len = 0; + size_t i, specs_len; + + f = open_memstream (&buf, &buf_len); + if (f == NULL) + error (EXIT_FAILURE, errno, "open_memstream"); + + fprintf (f, _("%s: %s\n" + "Optio...
2016 Jul 15
5
[PATCH 0/3] mllib: Various fixes and changes to Getopt module.
The second patch is obviously not complete yet - for discussion only. Rich.
2018 Aug 23
3
[PATCH v2 0/2] add output selection for --machine-readable
Hi, this adds the possibility to select the output for --machine-readable in OCaml tools. The possible choices are: * --machine-readable: to stdout, like before * --machine-readable=file:name-of-file: to the specified file * --machine-readable=stream:stdout: explicitly to stdout * --machine-readable=stream:stderr: explicitly to stderr This makes it possible to add additional output for
2016 Jun 27
0
Re: [PATCH] RFC: OCaml tools: add and use a Getopt module
...n ... > + if (newopts == NULL) > + caml_raise_out_of_memory (); > + longopts = newopts; > + longopts[longopts_len].name = key; the same pointer is copied to longopts, but ... > + case 0: /* Unit of (unit -> unit) */ > + do_call1 (Field (actionv, 0), Val_unit); At this point you're calling an OCaml function which is likely to allocate, and could therefore call the GC, and could therefore compact the heap, which would move that string around, and make your pointer invalid. (You could try adding `Gc.compact ()' to one of these call...
2017 Apr 04
1
[PATCH] Use Unicode single quotes ‘’ in place of short single quoted strings throughout.
...s not a numeric value.\n"), + fprintf (stderr, _("%s: ‘%s’ is not a numeric value.\n"), getprogname (), arg); show_error (EXIT_FAILURE); } @@ -375,10 +375,10 @@ guestfs_int_mllib_getopt_parse (value argsv, value specsv, value anon_funv, valu v = Field (actionv, 1); if (!list_mem (v, optarg)) { if (c != 0) { - fprintf (stderr, _("%s: '%s' is not allowed for -%c; allowed values are:\n"), + fprintf (stderr, _("%s: ‘%s’ is not allowed for -%c; allowed values are:\n"), getprogna...