diff options
Diffstat (limited to 'src/patch_parse.h')
| -rw-r--r-- | src/patch_parse.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/patch_parse.h b/src/patch_parse.h index d5e86073f..da56dad7c 100644 --- a/src/patch_parse.h +++ b/src/patch_parse.h @@ -7,6 +7,31 @@ #ifndef INCLUDE_patch_parse_h__ #define INCLUDE_patch_parse_h__ +typedef struct { + git_refcount rc; + + /* Original content buffer */ + const char *content; + size_t content_len; + + git_patch_options opts; + + /* The remaining (unparsed) buffer */ + const char *remain; + size_t remain_len; + + const char *line; + size_t line_len; + size_t line_num; +} git_patch_parse_ctx; + +extern git_patch_parse_ctx *git_patch_parse_ctx_init( + const char *content, + size_t content_len, + const git_patch_options *opts); + +extern void git_patch_parse_ctx_free(git_patch_parse_ctx *ctx); + /** * Create a patch for a single file from the contents of a patch buffer. * @@ -22,4 +47,8 @@ extern int git_patch_from_buffer( size_t contents_len, const git_patch_options *opts); +extern int git_patch_parse( + git_patch **out, + git_patch_parse_ctx *ctx); + #endif |
