diff options
author | Russell Belfer <rb@github.com> | 2014-04-29 15:05:58 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-05-02 09:21:33 -0700 |
commit | 9c8ed4999740e921ecc2966bbcd0dbcfc725f59a (patch) | |
tree | cf801e2026c9fca6b4e28bfc2c35e981d9ccea6e /include/git2/sys/diff.h | |
parent | 7a2e56a3f6115c3a145e4f73d0aa8bea6dded899 (diff) | |
download | libgit2-9c8ed4999740e921ecc2966bbcd0dbcfc725f59a.tar.gz |
Remove trace / add git_diff_perfdata struct + api
Diffstat (limited to 'include/git2/sys/diff.h')
-rw-r--r-- | include/git2/sys/diff.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/git2/sys/diff.h b/include/git2/sys/diff.h index bc6cdf393..48d72f4f9 100644 --- a/include/git2/sys/diff.h +++ b/include/git2/sys/diff.h @@ -10,6 +10,8 @@ #include "git2/common.h" #include "git2/types.h" #include "git2/oid.h" +#include "git2/diff.h" +#include "git2/status.h" /** * @file git2/sys/diff.h @@ -58,6 +60,32 @@ GIT_EXTERN(int) git_diff_print_callback__to_file_handle( const git_diff_line *line, void *payload); /*< payload must be a `FILE *` */ + +typedef struct { + unsigned int version; + size_t stat_calls; + size_t oid_calculations; +} git_diff_perfdata; + +#define GIT_DIFF_PERFDATA_VERSION 1 +#define GIT_DIFF_PERFDATA_INIT {GIT_DIFF_PERFDATA_VERSION,0,0} + +/** + * Get performance data for a diff object. + * + * @param out Structure to be filled with diff performance data + * @param diff Diff to read performance data from + * @return 0 for success, <0 for error + */ +GIT_EXTERN(int) git_diff_get_perfdata( + git_diff_perfdata *out, const git_diff *diff); + +/** + * Get performance data for diffs from a git_status_list + */ +GIT_EXTERN(int) git_status_list_get_perfdata( + git_diff_perfdata *out, const git_status_list *status); + /** @} */ GIT_END_DECL #endif |