summaryrefslogtreecommitdiff
path: root/sprinter-json.c
AgeCommit message (Collapse)Author
2022-01-18CLI: stash pointer to database in sprinter structsDavid Bremner
We already use an allocated (and presumably open) database as a talloc context. Keeping the pointer in the allocated struct will allow us to e.g. interrogate the configuration in a sprinter function without threading the database all the way through the various levels of function.
2021-03-13cli: run uncrustifyuncrustify
This is the result of running $ uncrustify --replace --config devel/uncrustify.cfg *.c *.h in the top level source directory Line breaks were then adjusted manually to keep argc and argv together.
2020-02-13sprinter: change integer method to use int64_tPeter Wang
In particular, timestamps beyond 2038 could overflow the sprinter interface on systems where time_t is 64-bit but 'int' is a signed 32-bit integer type.
2017-10-09cli: convert notmuch_bool_t to stdboolJani Nikula
C99 stdbool turned 18 this year. There really is no reason to use our own, except in the library interface for backward compatibility. Convert the cli and test binaries to stdbool.
2012-08-12sprinters: bugfix when NULL passed for a string.Mark Walters
The string function in a sprinter may be called with a NULL string pointer (eg if a header is absent). This causes a segfault. We fix this by checking for a null pointer in the string functions and update the sprinter documentation. At the moment some output when format=text is done directly rather than via an sprinter: in that case a null pointer is passed to printf or similar and a "(null)" appears in the output. That behaviour is not changed in this patch.
2012-08-03sprinter: Add a string_len methodAustin Clements
This method allows callers to output strings with specific lengths. It's useful both for strings with embedded NULs (which JSON can represent, though parser support is apparently spotty), and non-terminated strings.
2012-07-24Add structured output formatter for JSON and plain text (but don't use them yet).craven@gmx.net
Using the new structured printer support in sprinter.h, implement sprinter_json_create, which returns a new JSON structured output formatter. The formatter prints output similar to the existing JSON, but with differences in whitespace (mostly newlines, --output=summary prints the entire message summary on one line, not split across multiple lines). Also implement a "structured" formatter for plain text that prints prefixed strings, to be used with notmuch-search.c plain text output.