summaryrefslogtreecommitdiff
path: root/src/config_parse.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2017-07-21 13:01:43 +0200
committerPatrick Steinhardt <ps@pks.im>2017-11-11 17:12:34 +0000
commit9e66590bdb57cd376d064d9bb6b762264580d30b (patch)
tree11fd67729a715eba92743a14c0850eb65a3752cd /src/config_parse.h
parent1953c68b7550626b4ca6c37294d8d18479222143 (diff)
downloadlibgit2-9e66590bdb57cd376d064d9bb6b762264580d30b.tar.gz
config_parse: use common parser interface
As the config parser is now cleanly separated from the config file code, we can easily refactor the code and make use of the common parser module. This removes quite a lot of duplicated functionality previously used for handling the actual parser state and replaces it with the generic interface provided by the parser context.
Diffstat (limited to 'src/config_parse.h')
-rw-r--r--src/config_parse.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/config_parse.h b/src/config_parse.h
index a3d53d2ae..6c1863952 100644
--- a/src/config_parse.h
+++ b/src/config_parse.h
@@ -8,6 +8,7 @@
#include "common.h"
#include "array.h"
#include "oid.h"
+#include "parse.h"
static const char *git_config_escapes = "ntb\"\\";
static const char *git_config_escaped = "\n\t\b\"\\";
@@ -20,10 +21,7 @@ typedef struct config_file {
typedef struct {
struct config_file *file;
- git_buf buffer;
- char *read_ptr;
- int line_number;
- int eof;
+ git_parse_ctx ctx;
} git_config_parser;
typedef int (*git_config_parser_section_cb)(