diff options
| author | Patrick Steinhardt <ps@pks.im> | 2019-07-11 10:56:05 +0200 |
|---|---|---|
| committer | Patrick Steinhardt <ps@pks.im> | 2019-07-11 11:10:04 +0200 |
| commit | dbeadf8a9e9cb66f65b894e4dfd1fb23f9f31d5b (patch) | |
| tree | 5b60f577ce6de9f6e371684f707b1ef095f55529 /src/parse.h | |
| parent | 3215752653885cbd33abb22ae9c356434d9f9dce (diff) | |
| download | libgit2-dbeadf8a9e9cb66f65b894e4dfd1fb23f9f31d5b.tar.gz | |
config_parse: provide parser init and dispose functions
Right now, all configuration file backends are expected to
directly mess with the configuration parser's internals in order
to set it up. Let's avoid doing that by implementing both a
`git_config_parser_init` and `git_config_parser_dispose` function
to clearly define the interface between configuration backends
and the parser.
Ideally, we would make the `git_config_parser` structure
definition private to its implementation. But as that would
require an additional memory allocation that was not required
before we just live with it being visible to others.
Diffstat (limited to 'src/parse.h')
| -rw-r--r-- | src/parse.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/parse.h b/src/parse.h index 21dcf9bd1..42a2aff1a 100644 --- a/src/parse.h +++ b/src/parse.h @@ -23,6 +23,8 @@ typedef struct { size_t line_num; } git_parse_ctx; +#define GIT_PARSE_CTX_INIT { 0 } + int git_parse_ctx_init(git_parse_ctx *ctx, const char *content, size_t content_len); void git_parse_ctx_clear(git_parse_ctx *ctx); |
