diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/git2/indexer.h | 13 | ||||
| -rw-r--r-- | include/git2/remote.h | 8 |
2 files changed, 19 insertions, 2 deletions
diff --git a/include/git2/indexer.h b/include/git2/indexer.h index 87f48fe27..0d3c9dd51 100644 --- a/include/git2/indexer.h +++ b/include/git2/indexer.h @@ -23,6 +23,11 @@ typedef struct git_indexer_stats { } git_indexer_stats; +/** + * Type for progress callbacks during indexing + */ +typedef void (*git_indexer_progress_callback)(const git_indexer_stats *stats, void *payload); + typedef struct git_indexer git_indexer; typedef struct git_indexer_stream git_indexer_stream; @@ -31,8 +36,14 @@ typedef struct git_indexer_stream git_indexer_stream; * * @param out where to store the indexer instance * @param path to the directory where the packfile should be stored + * @param progress_cb function to call with progress information + * @param progress_payload payload for the progress callback */ -GIT_EXTERN(int) git_indexer_stream_new(git_indexer_stream **out, const char *path); +GIT_EXTERN(int) git_indexer_stream_new( + git_indexer_stream **out, + const char *path, + git_indexer_progress_callback progress_cb, + void *progress_callback_payload); /** * Add data to the indexer diff --git a/include/git2/remote.h b/include/git2/remote.h index 9327320b4..ca75126f9 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -184,9 +184,15 @@ GIT_EXTERN(int) git_remote_ls(git_remote *remote, git_headlist_cb list_cb, void * * @param remote the remote to download from * @param filename where to store the temporary filename + * @param progress_cb function to call with progress information + * @param progress_payload payload for the progress callback * @return 0 or an error code */ -GIT_EXTERN(int) git_remote_download(git_remote *remote, git_off_t *bytes); +GIT_EXTERN(int) git_remote_download( + git_remote *remote, + git_off_t *bytes, + git_indexer_progress_callback progress_cb, + void *progress_payload); /** * Check whether the remote is connected |
