Re: [PATCH v5 2/6] json: Implement wrapping interface

2019-12-08 Thread Daniel Kiper
On Fri, Dec 06, 2019 at 06:24:28PM +0100, Patrick Steinhardt wrote: > On Fri, Nov 29, 2019 at 04:34:58PM +0100, Daniel Kiper wrote: > > On Fri, Nov 29, 2019 at 07:51:46AM +0100, Patrick Steinhardt wrote: > [snip] > > > +grub_err_t > > > +grub_json_getsize (grub_size_t *out, const grub_json_t *json)

Re: [PATCH v5 2/6] json: Implement wrapping interface

2019-12-06 Thread Patrick Steinhardt
On Fri, Nov 29, 2019 at 04:34:58PM +0100, Daniel Kiper wrote: > On Fri, Nov 29, 2019 at 07:51:46AM +0100, Patrick Steinhardt wrote: [snip] > > +grub_err_t > > +grub_json_getsize (grub_size_t *out, const grub_json_t *json) > > +{ > > + int size; > > I hope that ((jsmntok_t *)json->tokens)() return

Re: [PATCH v5 2/6] json: Implement wrapping interface

2019-11-29 Thread Daniel Kiper
On Fri, Nov 29, 2019 at 07:51:46AM +0100, Patrick Steinhardt wrote: > While the newly added jsmn library provides the parsing interface, it > does not provide any kind of interface to act on parsed tokens. Instead, > the caller is expected to handle pointer arithmetics inside of the token > array i

[PATCH v5 2/6] json: Implement wrapping interface

2019-11-28 Thread Patrick Steinhardt
While the newly added jsmn library provides the parsing interface, it does not provide any kind of interface to act on parsed tokens. Instead, the caller is expected to handle pointer arithmetics inside of the token array in order to extract required information. While simple, this requires users t