From 05c0cd0db19063cd3a4043a5401c00b874ededa7 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Mon, 1 Aug 2022 11:20:32 -0300 Subject: git: Make `parse_key_value_file()` externally accessable --- git.c | 4 +--- git.h | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/git.c b/git.c index e3abcae..2a09841 100644 --- a/git.c +++ b/git.c @@ -280,9 +280,7 @@ int parse_comment_reply(void *ctx, void *ret, const keyword *key, keyword_val va return 1; } -typedef int (parse_callback)(void **ret, void *ctx, char *buf); - -static int parse_key_value_file(void *ret, void *ctx, const keyword **keywords, char *buf, const char *delm, parse_callback *parse_cb) { +int parse_key_value_file(void *ret, void *ctx, const keyword **keywords, char *buf, const char *delm, parse_callback *parse_cb) { if (buf != NULL) { int ret_val = 0; for (;;) { diff --git a/git.h b/git.h index b8bba77..b430aa6 100644 --- a/git.h +++ b/git.h @@ -12,6 +12,7 @@ typedef struct file file; typedef struct comment comment; typedef struct git_branch git_branch; typedef struct git_repo git_repo; +typedef int (parse_callback)(void **ret, void *ctx, char *buf); struct file { char *name; /* Name of file. */ @@ -53,6 +54,7 @@ struct pull_request { extern void cleanup_git(git_repo **repos); extern void cleanup_pull_request(pull_request *pr); extern git_repo **init_git(config *cfg); +extern int parse_key_value_file(void *ret, void *ctx, const keyword **keywords, char *buf, const char *delm, parse_callback *parse_cb); extern pull_request *get_pull_request(index_t *idx, const char *root, const char *repo); extern int add_comment(comment *comment, const char *pr_root); extern int create_pull_request_dir(pull_request *pr, index_t *idx, const char *root, const char *repo); -- cgit v1.2.3-13-gbd6f