git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v5] json_writer: new routines to create data in JSON format

From
Wink Saville <wink@saville.com>
Date
Mar 27, 2018, 22:03 UTC
Message-ID
<CAKk8ispn6kYQUqPbMc74HfdZ6hj6BwtgytgD5guLLfauspDKuA@mail.gmail.com>
In-Reply-To
<20180327210233.29076-2-git@jeffhostetler.com>
On Tue, Mar 27, 2018 at 2:02 PM <git@jeffhostetler.com> wrote:
Show 6 quoted lines
>
> From: Jeff Hostetler <jeffhost@microsoft.com>
>
> Add a series of jw_ routines and "struct json_writer" structure to compose
> JSON data.  The resulting string data can then be output by commands wanting
> to support a JSON output format.
<snip>
Show 7 quoted lines
>
>
>
>  void jw_object_intmax(struct json_writer *jw, const char *key, intmax_t value)
> +{
> +       object_common(jw, key);
> +       strbuf_addf(&jw->json, "%"PRIdMAX, (intmax_t)value);
Cast is not necessary.
> +}
> +
<snip>
Show 5 quoted lines
>
> +void jw_array_intmax(struct json_writer *jw, intmax_t value)
> +{
> +       array_common(jw);
> +       strbuf_addf(&jw->json, "%"PRIdMAX, (intmax_t)value);
Cast is not necessary
>
> +}
> +
<snip>
-- Wink
Previous: git@jeffhostetler.com
Message 3 of 3 in “routines to generate JSON data”
  1. routines to generate JSON datagit@jeffhostetler.com, Mar 27, 2018
  2. json_writer: new routines to create data in JSON formatgit@jeffhostetler.com, Mar 27, 2018
  3. Wink SavilleMar 27, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.