search for: val_non

Displaying 20 results from an estimated 29 matches for "val_non".

Did you mean: val_none
2018 Aug 22
3
Re: [PATCH 4/4] mltools: JSON: unify JSON_parser type with JSON.json_t.
On Monday, 20 August 2018 18:02:06 CEST Richard W.M. Jones wrote: > - } else > - rv = Val_none; > + } > + else { > + /* Previously we had a special JSON_parser_null value we could > + * use here, making the returned type (sort of) an option. > + * This is a best effort which is better than crashing / > + * throwing an error. > + */ > + rv = ca...
2016 Apr 14
1
[PATCH supermin] ext2: fix printf formatters
...src, blocks, data->fs->blocksize, (uint64_t) statbuf.st_size, ext2fs_free_blocks_count (data->fs->super)); unix_error (ENOSPC, (char *) "block size", data->fs->device_name ? caml_copy_string (data->fs->device_name) : Val_none); -- 2.5.5
2016 Jan 22
1
[supermin] [PATCH] ext2: check for needed block size
...\n", + src, blocks, data->fs->blocksize, statbuf.st_size, + ext2fs_free_blocks_count (data->fs->super)); + unix_error (ENOSPC, (char *) "block size", + data->fs->device_name ? caml_copy_string (data->fs->device_name) : Val_none); + } + /* Sanity check the path. These rules are always true for the paths * passed to us here from the appliance layer. The assertions just * verify that the rules haven't changed. -- 2.5.0
2014 Jan 30
2
[PATCH] builder: output translated notes
...lt;locale.h> + +#include <caml/alloc.h> +#include <caml/fail.h> +#include <caml/memory.h> +#include <caml/mlvalues.h> + +static const int lc_string_table[7] = { + LC_ALL, + LC_CTYPE, + LC_NUMERIC, + LC_TIME, + LC_COLLATE, + LC_MONETARY, + LC_MESSAGES +}; + +#define Val_none (Val_int (0)) + +value +virt_builder_setlocale (value val_category, value val_name) +{ + CAMLparam2 (val_category, val_name); + CAMLlocal2 (rv, rv2); + char *ret, *locstring; + int category; + + category = lc_string_table[Int_val (val_category)]; + locstring = val_name == Val_none ? NULL : S...
2018 Aug 22
0
Re: [PATCH 4/4] mltools: JSON: unify JSON_parser type with JSON.json_t.
On Wed, Aug 22, 2018 at 01:20:55PM +0200, Pino Toscano wrote: > On Monday, 20 August 2018 18:02:06 CEST Richard W.M. Jones wrote: > > - } else > > - rv = Val_none; > > + } > > + else { > > + /* Previously we had a special JSON_parser_null value we could > > + * use here, making the returned type (sort of) an option. > > + * This is a best effort which is better than crashing / > > + * throwing an error. &...
2018 Aug 20
1
[PATCH] common/mltools: getopt: add Getopt.OptString
...e anon_funv, valu do_call1 (v, v2); break; + case 8: /* OptString of string * (string option -> unit) */ + v = Field (actionv, 1); + if (optarg) { + v2 = caml_alloc (1, 0); + Store_field (v2, 0, caml_copy_string (optarg)); + } else { + v2 = Val_none; + } + do_call1 (v, v2); + break; + default: error (EXIT_FAILURE, 0, "internal error: unhandled Tag_val (actionv) = %d", diff --git a/common/mltools/getopt.ml b/common/mltools/getopt.ml index 9d20855f7..da461457b 100644 --- a/common/mltools/getopt...
2018 Aug 20
0
[PATCH 4/4] mltools: JSON: unify JSON_parser type with JSON.json_t.
...at path as JSON tree. *) diff --git a/common/mltools/JSON_parser-c.c b/common/mltools/JSON_parser-c.c index 32432dc5b..dce9f6a15 100644 --- a/common/mltools/JSON_parser-c.c +++ b/common/mltools/JSON_parser-c.c @@ -28,7 +28,12 @@ #include <stdio.h> #include <string.h> -#define Val_none (Val_int (0)) +#define JSON_STRING_TAG 0 +#define JSON_INT_TAG 1 +#define JSON_FLOAT_TAG 2 +#define JSON_BOOL_TAG 3 +#define JSON_LIST_TAG 4 +#define JSON_DICT_TAG 5 value virt_builder_json_parser_tree_parse (value stringv); @@ -36,60 +41,87 @@ static value convert_json_t (json_t *...
2018 Aug 22
3
[PATCH v2 0/2] mltools: JSON: unify JSON & JSON parser.
v2: - Added back the null value. - Reran the tests. Rich.
2015 Aug 12
0
[PATCH 2/2] builder: support Simple Streams v1.0 as index metadata
...-1301 USA. + */ + +#include <config.h> + +#include <caml/alloc.h> +#include <caml/fail.h> +#include <caml/memory.h> +#include <caml/mlvalues.h> + +#if HAVE_YAJL +#include <yajl/yajl_tree.h> +#endif + +#include <stdio.h> +#include <string.h> + +#define Val_none (Val_int (0)) + +extern value virt_builder_yajl_is_available (value unit); +extern value virt_builder_yajl_tree_parse (value stringv); + +#if HAVE_YAJL +static value +convert_yajl_value (yajl_val val, int level) +{ + CAMLparam0 (); + CAMLlocal4 (rv, lv, v, sv); + + if (level > 20) + caml_...
2018 Aug 21
0
[PATCH 1/2] common/mltools: getopt: add Getopt.OptString
...e anon_funv, valu do_call1 (v, v2); break; + case 8: /* OptString of string * (string option -> unit) */ + v = Field (actionv, 1); + if (optarg) { + v2 = caml_alloc (1, 0); + Store_field (v2, 0, caml_copy_string (optarg)); + } else { + v2 = Val_none; + } + do_call1 (v, v2); + break; + default: error (EXIT_FAILURE, 0, "internal error: unhandled Tag_val (actionv) = %d", diff --git a/common/mltools/getopt.ml b/common/mltools/getopt.ml index 9d20855f7..da461457b 100644 --- a/common/mltools/getopt...
2013 Mar 25
86
[PATCH 00/28] libxl: ocaml: improve the bindings
The following series of patches fill in most of the gaps in the OCaml bindings to libxl, to make them useful for clients such as xapi/xenopsd (from XCP). There are a number of bugfixes to the existing bindings as well. I have an experimental version of xenopsd that successfully uses the new bindings. An earlier version of the first half of the series was submitted to the last by Ian Campbell on
2018 Aug 20
6
[PATCH 0/4] mltools: JSON unification
An evolution of: https://www.redhat.com/archives/libguestfs/2018-August/msg00155.html
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
2015 Aug 12
4
[PATCH 0/2 v2] RFC: builder: support for Simple Streams metadata
Hi, this series adds a basic support for Simple Streams v1.0 metadata files. This makes it possible to create a repository .conf files with [cirros] uri=http://download.cirros-cloud.net format=simplestreams to read the latest version of each CirrOS image. TODO items: - check the pasted metadata: listing and creating images works, so most of the current metadata is correct - possibly wait
2014 Sep 17
4
[PATCH 0/2] supermin: use librpm for rpm support
Hi, this work makes supermin use the rpm library instead of invoking rpm directly. This, together with a needed refactoring of the dependency resolution, should help in make supermin faster on rpm-based systems. Surely the patches will still need polishing, especially for behaviours of newly added stuff, but at least it's a good starting point. Noting that you need rpm-devel on most of rpm
2016 Jan 09
0
[PATCH] build: Require qemu >= 1.3.0 and yajl.
...er/yajl-c.c index 194fa34..f34196e 100644 --- a/builder/yajl-c.c +++ b/builder/yajl-c.c @@ -23,18 +23,13 @@ #include <caml/memory.h> #include <caml/mlvalues.h> -#if HAVE_YAJL #include <yajl/yajl_tree.h> -#endif #include <stdio.h> #include <string.h> #define Val_none (Val_int (0)) -value virt_builder_yajl_is_available (value unit); - -#if HAVE_YAJL value virt_builder_yajl_tree_parse (value stringv); static value @@ -95,13 +90,6 @@ convert_yajl_value (yajl_val val, int level) } value -virt_builder_yajl_is_available (value unit) -{ - /* NB: noalloc */...
2015 Sep 07
5
[PATCH 0/4 v3] builder: support for Simple Streams metadata
Hi, this series adds a basic support for Simple Streams v1.0 metadata files. This makes it possible to create a repository .conf files with [cirros] uri=http://download.cirros-cloud.net format=simplestreams to read the latest version of each CirrOS image. Thanks, Pino Toscano (4): builder: add non-int revisions builder: add simple libyajl binding build: expose HAVE_YAJL to automake
2018 Aug 17
0
[PATCH v3 1/4] mltools: Rename Yajl module as JSON_parser and move to common/mltools.
...,5 +1,5 @@ -/* virt-builder - * Copyright (C) 2015 Red Hat Inc. +/* JSON parser + * Copyright (C) 2015-2018 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ #define Val_none (Val_int (0)) -value virt_builder_yajl_tree_parse (value stringv); +value virt_builder_json_parser_tree_parse (value stringv); static value convert_json_t (json_t *val, int level) @@ -95,7 +95,7 @@ convert_json_t (json_t *val, int level) } value -virt_builder_yajl_tree_parse (value strin...
2018 Feb 12
0
[PATCH v2 1/1] Switch from YAJL to Jansson
...* GCC can't work out that the YAJL_IS_<foo> test is sufficient to - * ensure that YAJL_GET_<foo> later doesn't return NULL. - */ -#if defined(__GNUC__) && __GNUC__ >= 6 /* gcc >= 6 */ -#pragma GCC diagnostic ignored "-Wnull-dereference" -#endif - #define Val_none (Val_int (0)) value virt_builder_yajl_tree_parse (value stringv); static value -convert_yajl_value (yajl_val val, int level) +convert_json_t (json_t *val, int level) { CAMLparam0 (); CAMLlocal4 (rv, lv, v, sv); @@ -48,46 +41,51 @@ convert_yajl_value (yajl_val val, int level) if (le...
2017 Nov 23
0
[PATCH 1/1] Switch from YAJL to Jansson
...* GCC can't work out that the YAJL_IS_<foo> test is sufficient to - * ensure that YAJL_GET_<foo> later doesn't return NULL. - */ -#if defined(__GNUC__) && __GNUC__ >= 6 /* gcc >= 6 */ -#pragma GCC diagnostic ignored "-Wnull-dereference" -#endif - #define Val_none (Val_int (0)) value virt_builder_yajl_tree_parse (value stringv); static value -convert_yajl_value (yajl_val val, int level) +convert_json_t (json_t *val, int level) { CAMLparam0 (); CAMLlocal4 (rv, lv, v, sv); @@ -48,46 +41,51 @@ convert_yajl_value (yajl_val val, int level) if (le...