diff options
Diffstat (limited to 'src/trace.c')
-rw-r--r-- | src/trace.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/trace.c b/src/trace.c index ee5039f56..6ee2cf2ce 100644 --- a/src/trace.c +++ b/src/trace.c @@ -17,22 +17,25 @@ struct git_trace_data git_trace__data = {0}; #endif -int git_trace_set(git_trace_level_t level, git_trace_callback callback) +int git_trace_set( + git_trace_level_t level, git_trace_callback cb, void *cb_payload) { #ifdef GIT_TRACE - assert(level == 0 || callback != NULL); + assert(level == 0 || cb != NULL); git_trace__data.level = level; - git_trace__data.callback = callback; + git_trace__data.callback = cb; + git_trace__data.callback_payload = cb_payload; GIT_MEMORY_BARRIER; return 0; #else GIT_UNUSED(level); - GIT_UNUSED(callback); + GIT_UNUSED(cb); + GIT_UNUSED(cb_payload); - giterr_set(GITERR_INVALID, - "This version of libgit2 was not built with tracing."); + giterr_set( + GITERR_INVALID, "This version of libgit2 was not built with tracing."); return -1; #endif } |