search for: specv_index

Displaying 4 results from an estimated 4 matches for "specv_index".

2016 Jul 11
0
Re: [PATCH v2] OCaml tools: add and use a Getopt module
...fprintf (stderr, > + "libguestfs: uncaught OCaml exception in getopt callback: %s", Does this need \n? > + case 0: > + if (STREQ (longopts[option_index].name, "help")) { > + show_help (specsv, usage_msgv); > + } > + /* specv_index set already -- nothing to do. */ > + break; > + > + case 'h': > + show_help (specsv, usage_msgv); > + break; Is this right? Several commands (eg. virt-df) take a -h option which isn't for help. The new code seems to be GC-safe as far as I can tell. &...
2016 Jul 11
2
[PATCH v2] OCaml tools: add and use a Getopt module
...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_val (argsv); + argv = malloc (sizeof (char *) * (argc + 1)); + if (argv == NULL) + caml_raise_out_of_memory (); + for (i = 0; i < argc; ++i) { + argv[i] = strdup (String_val (Field (argsv, i))); + if (argv[i] == NULL) + caml_raise_out_of_memory (); + } + ar...
2016 Jul 13
3
[PATCH v3 1/2] OCaml tools: add and use a Getopt module
...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_val (argsv); + argv = malloc (sizeof (char *) * (argc + 1)); + if (argv == NULL) + caml_raise_out_of_memory (); + for (i = 0; i < argc; ++i) { + argv[i] = strdup (String_val (Field (argsv, i))); + if (argv[i] == NULL) + caml_raise_out_of_memory (); + } + ar...
2016 Jun 24
2
[PATCH] RFC: OCaml tools: add and use a Getopt module
...usage_msgv); + CAMLlocal4 (specv, keysv, actionv, v); + 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 struct option *longopts = NULL; + int longopts_len = 0; + int c; + int specv_index; + + argc = Wosize_val (argsv); + argv = malloc (sizeof (char *) * (argc + 1)); + if (argv == NULL) + caml_raise_out_of_memory (); + for (i = 0; i < argc; ++i) { + argv[i] = strdup (String_val (Field (argsv, i))); + if (argv[i] == NULL) + caml_raise_out_of_memory (); + } + ar...