trace: suffix the callbacks with `_cb` The trace logging callbacks should match the other callback naming conventions, using the `_cb` suffix instead of a `_callback` suffix.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
diff --git a/include/git2/deprecated.h b/include/git2/deprecated.h
index 4c11b07..177efa6 100644
--- a/include/git2/deprecated.h
+++ b/include/git2/deprecated.h
@@ -14,6 +14,7 @@
#include "object.h"
#include "refs.h"
#include "remote.h"
+#include "trace.h"
/*
* Users can avoid deprecated functions by defining `GIT_DEPRECATE_HARD`.
@@ -261,6 +262,20 @@ typedef git_cred_ssh_interactive_cb git_cred_ssh_interactive_callback;
/**@}*/
+/** @name Deprecated Trace Callback Types
+ *
+ * These types are retained for backward compatibility. The newer
+ * versions of these values should be preferred in all new code.
+ *
+ * There is no plan to remove these backward compatibility values at
+ * this time.
+ */
+/**@{*/
+
+typedef git_trace_cb git_trace_callback;
+
+/**@}*/
+
/** @name Deprecated Transfer Progress Types
*
* These types are retained for backward compatibility. The newer
diff --git a/include/git2/trace.h b/include/git2/trace.h
index f8bbfb2..8cee3a9 100644
--- a/include/git2/trace.h
+++ b/include/git2/trace.h
@@ -49,7 +49,7 @@ typedef enum {
/**
* An instance for a tracing function
*/
-typedef void GIT_CALLBACK(git_trace_callback)(git_trace_level_t level, const char *msg);
+typedef void GIT_CALLBACK(git_trace_cb)(git_trace_level_t level, const char *msg);
/**
* Sets the system tracing configuration to the specified level with the
@@ -60,7 +60,7 @@ typedef void GIT_CALLBACK(git_trace_callback)(git_trace_level_t level, const cha
* @param cb Function to call with trace data
* @return 0 or an error code
*/
-GIT_EXTERN(int) git_trace_set(git_trace_level_t level, git_trace_callback cb);
+GIT_EXTERN(int) git_trace_set(git_trace_level_t level, git_trace_cb cb);
/** @} */
GIT_END_DECL
diff --git a/src/trace.c b/src/trace.c
index f2f3538..ec6a90a 100644
--- a/src/trace.c
+++ b/src/trace.c
@@ -17,7 +17,7 @@ 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_cb callback)
{
#ifdef GIT_TRACE
assert(level == 0 || callback != NULL);
diff --git a/src/trace.h b/src/trace.h
index 1eaf6c9..6cf1677 100644
--- a/src/trace.h
+++ b/src/trace.h
@@ -16,7 +16,7 @@
struct git_trace_data {
git_trace_level_t level;
- git_trace_callback callback;
+ git_trace_cb callback;
};
extern struct git_trace_data git_trace__data;
@@ -25,7 +25,7 @@ GIT_INLINE(void) git_trace__write_fmt(
git_trace_level_t level,
const char *fmt, ...)
{
- git_trace_callback callback = git_trace__data.callback;
+ git_trace_cb callback = git_trace__data.callback;
git_buf message = GIT_BUF_INIT;
va_list ap;