search for: paramv

Displaying 9 results from an estimated 9 matches for "paramv".

Did you mean: param
2016 Jul 11
0
Re: [PATCH v2] OCaml tools: add and use a Getopt module
On Mon, Jul 11, 2016 at 06:03:39PM +0200, Pino Toscano wrote: > diff --git a/mllib/getopt-c.c b/mllib/getopt-c.c > new file mode 100644 > index 0000000..e5e832c > --- /dev/null > +++ b/mllib/getopt-c.c > +static void > +do_call1 (value funv, value paramv) > +{ > + CAMLparam2 (funv, paramv); > + CAMLlocal1 (rv); > + > + rv = caml_callback_exn (funv, paramv); > + > + if (Is_exception_result (rv)) > + fprintf (stderr, > + "libguestfs: uncaught OCaml exception in getopt callback: %s", Does this n...
2016 Jul 18
2
[PATCH] mllib: Getopt: fix integer parsing
...0644 --- a/mllib/getopt-c.c +++ b/mllib/getopt-c.c @@ -30,6 +30,8 @@ #include <error.h> #include <assert.h> +#include "xstrtol.h" + #include <caml/alloc.h> #include <caml/fail.h> #include <caml/memory.h> @@ -117,6 +119,26 @@ do_call1 (value funv, value paramv) CAMLreturn0; } +static int +strtoint (const char *arg) +{ + long int num; + + if (xstrtol (arg, NULL, 0, &num, NULL) != LONGINT_OK) { + fprintf (stderr, _("%s: '%s' is not a numeric value.\n"), + guestfs_int_program_name, arg); + show_error (EXIT_FAI...
2006 Jun 05
1
error with running ''rake migrate''
when I run (under dev.../trunk/www): rake migrate, I get the error: rake aborted! Syntax error on line 36, col 2: ''host: localhost'' when I run (under dev.../trunk/www): ruby script\server, I get the same error msg with: c:/ruby/lib/ruby/1.8/yaml.rb:133:in ''load'': <error msg> help !?! -- Posted via http://www.ruby-forum.com/.
2016 Jul 18
0
Re: [PATCH] mllib: Getopt: fix integer parsing
...> @@ -30,6 +30,8 @@ > #include <error.h> > #include <assert.h> > > +#include "xstrtol.h" > + > #include <caml/alloc.h> > #include <caml/fail.h> > #include <caml/memory.h> > @@ -117,6 +119,26 @@ do_call1 (value funv, value paramv) > CAMLreturn0; > } This function needs to return something other than 'int', since on 64 bit OCaml integers (the final destination) are signed 63 bits. I think returning 'long' is a better idea, and the receiving 'num' should also be 'long' (as in my pat...
2016 Jul 11
2
[PATCH v2] OCaml tools: add and use a Getopt module
...0; j < len; ++j) { + const char *key = String_val (Field (keysv, j)); + + if (key[0] == '-' && key[1] == opt) { + ret = i; + goto done; + } + } + } + + ret = -1; + + done: + CAMLreturnT (int, ret); +} + +static void +do_call1 (value funv, value paramv) +{ + CAMLparam2 (funv, paramv); + CAMLlocal1 (rv); + + rv = caml_callback_exn (funv, paramv); + + if (Is_exception_result (rv)) + fprintf (stderr, + "libguestfs: uncaught OCaml exception in getopt callback: %s", + caml_format_exception (Extract_exception (r...
2016 Jul 18
2
Re: [PATCH] mllib: Getopt: fix integer parsing
...lt;error.h> > > #include <assert.h> > > > > +#include "xstrtol.h" > > + > > #include <caml/alloc.h> > > #include <caml/fail.h> > > #include <caml/memory.h> > > @@ -117,6 +119,26 @@ do_call1 (value funv, value paramv) > > CAMLreturn0; > > } > > This function needs to return something other than 'int', since on 64 > bit OCaml integers (the final destination) are signed 63 bits. I > think returning 'long' is a better idea, and the receiving 'num' > should a...
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
...0; j < len; ++j) { + const char *key = String_val (Field (keysv, j)); + + if (key[0] == '-' && key[1] == opt) { + ret = i; + goto done; + } + } + } + + ret = -1; + + done: + CAMLreturnT (int, ret); +} + +static void +do_call1 (value funv, value paramv) +{ + CAMLparam2 (funv, paramv); + CAMLlocal1 (rv); + + rv = caml_callback_exn (funv, paramv); + + if (Is_exception_result (rv)) + fprintf (stderr, + "libguestfs: uncaught OCaml exception in getopt callback: %s\n", + caml_format_exception (Extract_exception...
2016 Jun 24
2
[PATCH] RFC: OCaml tools: add and use a Getopt module
...0; j < len; ++j) { + const char *key = String_val (Field (keysv, j)); + + if (key[0] == '-' && key[1] == opt) { + ret = i; + goto done; + } + } + } + + ret = -1; + + done: + CAMLreturnT (int, ret); +} + +static void +do_call1 (value funv, value paramv) +{ + CAMLparam2 (funv, paramv); + CAMLlocal1 (rv); + + rv = caml_callback_exn (funv, paramv); + + if (Is_exception_result (rv)) + fprintf (stderr, + "libguestfs: uncaught OCaml exception in getopt callback: %s", + caml_format_exception (Extract_exception (r...