search for: json_array_foreach

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

2017 Nov 23
1
Re: [PATCH 1/1] Switch from YAJL to Jansson
...witch all of libguestfs from YAJL to Jansson: > - configure checks, and buildsystem in general > - packages pulled in the appliance > - actual implementations > - contrib scripts > - documentation > > This also makes use of the better APIs available (e.g. json_object_get, > json_array_foreach, and json_object_foreach). This does not change the > API of our OCaml Yajl module. > > The only behaviour change is that Jansson by default accepts only > objects and arrays as input (even though it has a flag to make it accept > anything). Since this seems a good idea anyway, an...
2017 Nov 23
4
[PATCH 0/1] RFC: switch from YAJL to Jansson
Hi, recently, there was a discussion in the development list of libvirt on switching to a different JSON library than YAJL [1]. Since we use YAJL, and the points there IMHO apply to libguestfs as well, I decided to give a try in switching to Jansson [2]. The result IMHO is nice, with the additional APIs of Jansson that simplify some of our code. Unlike with YAJL, I did not set a minimum
2018 Feb 12
2
[PATCH v2 0/1] RFC: switch from YAJL to Jansson
Hi, recently, there was a discussion in the development list of libvirt on switching to a different JSON library than YAJL [1]. Since we use YAJL, and the points there IMHO apply to libguestfs as well, I decided to give a try in switching to Jansson [2]. The result IMHO is nice, with the additional APIs of Jansson that simplify some of our code. Unlike with YAJL, I did not set a minimum
2017 Nov 23
1
Re: [PATCH 1/1] Switch from YAJL to Jansson
...Hence, switch all of libguestfs from YAJL to Jansson: >- configure checks, and buildsystem in general >- packages pulled in the appliance >- actual implementations >- contrib scripts >- documentation > >This also makes use of the better APIs available (e.g. json_object_get, >json_array_foreach, and json_object_foreach). This does not change the >API of our OCaml Yajl module. > >The only behaviour change is that Jansson by default accepts only >objects and arrays as input (even though it has a flag to make it accept >anything). Since this seems a good idea anyway, and as...
2018 Feb 12
0
[PATCH v2 1/1] Switch from YAJL to Jansson
...license, and a much nicer API. Hence, switch all of libguestfs from YAJL to Jansson: - configure checks, and buildsystem in general - packages pulled in the appliance - actual implementations - contrib scripts - documentation This also makes use of the better APIs available (e.g. json_object_get, json_array_foreach, and json_object_foreach). This does not change the API of our OCaml Yajl module. --- appliance/packagelist.in | 13 ++-- builder/Makefile.am | 4 +- builder/yajl-c.c | 66 ++++++++++----------- contrib/p2v/aux-scripts/do-build.sh | 8 +-- contr...
2017 Nov 23
0
[PATCH 1/1] Switch from YAJL to Jansson
...license, and a much nicer API. Hence, switch all of libguestfs from YAJL to Jansson: - configure checks, and buildsystem in general - packages pulled in the appliance - actual implementations - contrib scripts - documentation This also makes use of the better APIs available (e.g. json_object_get, json_array_foreach, and json_object_foreach). This does not change the API of our OCaml Yajl module. The only behaviour change is that Jansson by default accepts only objects and arrays as input (even though it has a flag to make it accept anything). Since this seems a good idea anyway, and as it is the RFC behavi...
2018 Aug 20
0
[PATCH 4/4] mltools: JSON: unify JSON_parser type with JSON.json_t.
...onsv; } - Store_field (rv, 0, lv); - } else if (json_is_array (val)) { + Store_field (rv, 0, v); + } + else if (json_is_array (val)) { const size_t len = json_array_size (val); size_t i; json_t *jvalue; - rv = caml_alloc (1, 4); - lv = caml_alloc_tuple (len); - json_array_foreach (val, i, jvalue) { - v = convert_json_t (jvalue, level + 1); - Store_field (lv, i, v); + + rv = caml_alloc (1, JSON_LIST_TAG); + v = Val_int (0); + for (i = 0; i < len; ++i) { + /* Note we have to create the OCaml list backwards. */ + jvalue = json_array_get (val, le...
2018 Aug 22
3
[PATCH v2 0/2] mltools: JSON: unify JSON & JSON parser.
v2: - Added back the null value. - Reran the tests. Rich.
2018 Aug 20
6
[PATCH 0/4] mltools: JSON unification
An evolution of: https://www.redhat.com/archives/libguestfs/2018-August/msg00155.html