On 02/06/2023 17:46, Glen Choo wrote:
Phillip Wood <phillip.wood123@xxxxxxxxx> writes:
As an aside, I think we'd also want a couple of helpers for matching
keys so we can just write kvi_match_key(kvi, "user.name") or
kvi_skip_key_prefix(kvi, "core.", &p) rather than having to extract the
key name first.
Yes, and that would also abstract over implementation details like
matching keys using strcasecmp() and not strcmp(). For reasons like
this, I think your proposal paves the way for a harder-to-misuse API.
I still have some nagging, probably irrational fear that consolidating
all of the config_fn_t args is trickier to manage than adding a single
key_value_info arg. It definitely *sounds* trickier, but I can't really
think of a real downside.
Maybe I just have to try it and send the result for others to consider.
That's probably the best way to see if it is an improvement - you can
always blame me if it turns out not to be! Hopefully it isn't too much
work to add enough api to be able to convert a couple of config_fn_t
functions to see how it pans out.
Best Wishes
Phillip