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

[PATCH v4] routines to generate JSON data

From
Ggit@jeffhostetler.com <git@jeffhostetler.com>
Date
Mar 26, 2018, 14:31 UTC
Message-ID
<20180326143136.47116-1-git@jeffhostetler.com>
From: Jeff Hostetler <jeffhost@microsoft.com>
This is version 4 of my JSON data format routines.

This version adds a "pretty" formatted output. I consider this to be mainly for debugging, but worth keeping available in release builds.

I simplified the stack-level tracing as suggested by René Scharfe and hinted at by Peff.

I converted the _double() routines to take an integer precision rather than a format specification and build a known-to-be-good format string to minimize the __attribute__(...) issues raised by René Scharfe.

It fixes the PRIuMAX and "void inline" compiler warnings on OSX that were reported by Wink Saville and Ramsay Jones. And resolved the "sparse" warnings repoted by Ramsay Jones.

And I updated the commit message and header file documnetation to address the JSON-like (Unicode limitations) mentioned by Jonathan Nieder.

Jeff Hostetler (1):
  json_writer: new routines to create data in JSON format
 Makefile                    |   2 +
 json-writer.c               | 395 +++++++++++++++++++++++++++++
 json-writer.h               |  92 +++++++
 t/helper/test-json-writer.c | 590 ++++++++++++++++++++++++++++++++++++++++++++
 t/t0019-json-writer.sh      | 253 +++++++++++++++++++
 5 files changed, 1332 insertions(+)
 create mode 100644 json-writer.c
 create mode 100644 json-writer.h
 create mode 100644 t/helper/test-json-writer.c
 create mode 100755 t/t0019-json-writer.sh
-- 
2.9.3
Next: git@jeffhostetler.com
Message 1 of 14 in “routines to generate JSON data”
  1. routines to generate JSON datagit@jeffhostetler.com, Mar 26, 2018
  2. json_writer: new routines to create data in JSON formatgit@jeffhostetler.com, Mar 26, 2018
  3. Ramsay JonesMar 27, 2018
  4. Jeff HostetlerMar 27, 2018
  5. Ramsay JonesMar 27, 2018
  6. Jeff HostetlerMar 27, 2018
  7. Wink SavilleMar 27, 2018
  8. Randall S. BeckerMar 27, 2018
  9. Junio C HamanoMar 28, 2018
  10. Ramsay JonesMar 27, 2018
  11. Junio C HamanoMar 28, 2018
  12. Duy NguyenJun 2, 2018
  13. Jeff KingJun 2, 2018
  14. Jeff HostetlerJun 4, 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.