jansson
jansson copied to clipboard
Provide better typed json_typeof
Further down in the header the function json_error_code() is defined to return the enum json_error_code.
That function has a much better documentation value, as it also defines what values the returned value can have.
It also sets a naming precedent, of having a function of the same name as the enum, which makes a lot of sense to me.
In the future, when you bump the major version of the library anyway, you could change the define of json_typeof to
#define json_typeof json_type
and maybe start a deprecation cycle of the old name.
What do you think? Would that be a good patch?