Re: [PATCH v3 12/12] config: pass source to config_parser_event_fn_t
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 20, 2023, 21:46 UTC
- Message-ID
- <xmqqwmzxkdrp.fsf@gitster.g>
- In-Reply-To
- <484d553cc7da360b134e7cfcc02e587073b1f9fa.1687290233.git.gitgitgadget@gmail.com>
"Glen Choo via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 18 quoted lines
> From: Glen Choo <chooglen@google.com> > > ..so that the callback can use a "struct config_source" parameter > instead of "config_reader.source". "struct config_source" is internal to > config.c, so we are adding a pointer to a struct defined in config.c > into a public function signature defined in config.h, but this is okay > because this function has only ever been (and probably ever will be) > used internally by config.c. > > As a result, the_reader isn't used anywhere, so "struct config_reader" > is obsolete (it was only intended to be used with the_reader). Remove > them. > > Signed-off-by: Glen Choo <chooglen@google.com> > --- > config.c | 77 ++++++++++---------------------------------------------- > config.h | 6 +++++ > 2 files changed, 19 insertions(+), 64 deletions(-)
Together with the removal of current_* functions in earlier steps, getting rid of the_reader interface makes the config API more easily reused in other contexts, I guess. Nicely done.