diff options
author | Glen Choo <chooglen@google.com> | 2023-06-28 21:26:30 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-06-28 23:06:40 +0200 |
commit | 6e8e7981eb86e2c19401825dbdb55d5860d11313 (patch) | |
tree | c5c1585221546325e71d5718f9a4f96b3152a4ec /config.h | |
parent | config: add kvi.path, use it to evaluate includes (diff) | |
download | git-6e8e7981eb86e2c19401825dbdb55d5860d11313.tar.xz git-6e8e7981eb86e2c19401825dbdb55d5860d11313.zip |
config: pass source to config_parser_event_fn_t
..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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.h')
-rw-r--r-- | config.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -72,6 +72,7 @@ enum config_event_t { CONFIG_EVENT_ERROR }; +struct config_source; /* * The parser event function (if not NULL) is called with the event type and * the begin/end offsets of the parsed elements. @@ -81,6 +82,7 @@ enum config_event_t { */ typedef int (*config_parser_event_fn_t)(enum config_event_t type, size_t begin_offset, size_t end_offset, + struct config_source *cs, void *event_fn_data); struct config_options { @@ -100,6 +102,10 @@ struct config_options { const char *commondir; const char *git_dir; + /* + * event_fn and event_fn_data are for internal use only. Handles events + * emitted by the config parser. + */ config_parser_event_fn_t event_fn; void *event_fn_data; enum config_error_action { |