Roi Dayan <r...@nvidia.com> writes:
> On 2021-01-06 3:16 PM, Petr Machata wrote: >> Regarding the publishing, the _jw reference can be changed to a call to >> is_json_context(), which does the same thing. Then _jw can stay private >> in json_print.c. >> Exposing an _IS_JSON_CONTEXT / _IS_FP_CONTEXT might be odd on account of >> the initial underscore, but since it's only used in implementations, >> maybe it's OK? >> > > With is_json_context() I cannot check the type passed by the caller. > i.e. PRINT_JSON, PRINT_FP, PRINT_ANY. I meant s/_jw/is_json_context()/. Like this: #define _IS_JSON_CONTEXT(type) \ ((type & PRINT_JSON || type & PRINT_ANY) && is_json_context()) Then _jw can stay private.