diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2019-06-10 12:08:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-10 12:08:57 +0100 |
commit | f4584a1e8bf3095b90f5564c0f89878ef79855c5 (patch) | |
tree | 211a0ea1861341242b3996d7d09721fa65a398df | |
parent | dd47a3ef7d131a96b3d6513c54d3cd9c73378124 (diff) | |
parent | 178df697e3650972a70c8b812c7a1222eecaffb7 (diff) | |
download | libgit2-f4584a1e8bf3095b90f5564c0f89878ef79855c5.tar.gz |
Merge pull request #5102 from libgit2/ethomson/callback_names
Callback type names should be suffixed with `_cb`
-rw-r--r-- | include/git2/deprecated.h | 30 | ||||
-rw-r--r-- | include/git2/trace.h | 4 | ||||
-rw-r--r-- | include/git2/transport.h | 12 | ||||
-rw-r--r-- | src/trace.c | 2 | ||||
-rw-r--r-- | src/trace.h | 4 | ||||
-rw-r--r-- | src/transports/cred.c | 4 |
6 files changed, 43 insertions, 13 deletions
diff --git a/include/git2/deprecated.h b/include/git2/deprecated.h index 9fe986116..177efa61a 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`. @@ -246,6 +247,35 @@ GIT_EXTERN(void) giterr_set_oom(void); /**@}*/ +/** @name Deprecated Credential 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_cred_sign_cb git_cred_sign_callback; +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 f8bbfb28c..8cee3a94e 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/include/git2/transport.h b/include/git2/transport.h index 2ba2d7ee6..91d27c7f1 100644 --- a/include/git2/transport.h +++ b/include/git2/transport.h @@ -165,8 +165,8 @@ typedef struct _LIBSSH2_USERAUTH_KBDINT_PROMPT LIBSSH2_USERAUTH_KBDINT_PROMPT; typedef struct _LIBSSH2_USERAUTH_KBDINT_RESPONSE LIBSSH2_USERAUTH_KBDINT_RESPONSE; #endif -typedef int GIT_CALLBACK(git_cred_sign_callback)(LIBSSH2_SESSION *session, unsigned char **sig, size_t *sig_len, const unsigned char *data, size_t data_len, void **abstract); -typedef void GIT_CALLBACK(git_cred_ssh_interactive_callback)(const char* name, int name_len, const char* instruction, int instruction_len, int num_prompts, const LIBSSH2_USERAUTH_KBDINT_PROMPT* prompts, LIBSSH2_USERAUTH_KBDINT_RESPONSE* responses, void **abstract); +typedef int GIT_CALLBACK(git_cred_sign_cb)(LIBSSH2_SESSION *session, unsigned char **sig, size_t *sig_len, const unsigned char *data, size_t data_len, void **abstract); +typedef void GIT_CALLBACK(git_cred_ssh_interactive_cb)(const char* name, int name_len, const char* instruction, int instruction_len, int num_prompts, const LIBSSH2_USERAUTH_KBDINT_PROMPT* prompts, LIBSSH2_USERAUTH_KBDINT_RESPONSE* responses, void **abstract); /** * A ssh key from disk @@ -185,7 +185,7 @@ typedef struct git_cred_ssh_key { typedef struct git_cred_ssh_interactive { git_cred parent; char *username; - git_cred_ssh_interactive_callback prompt_callback; + git_cred_ssh_interactive_cb prompt_callback; void *payload; } git_cred_ssh_interactive; @@ -197,7 +197,7 @@ typedef struct git_cred_ssh_custom { char *username; char *publickey; size_t publickey_len; - git_cred_sign_callback sign_callback; + git_cred_sign_cb sign_callback; void *payload; } git_cred_ssh_custom; @@ -262,7 +262,7 @@ GIT_EXTERN(int) git_cred_ssh_key_new( GIT_EXTERN(int) git_cred_ssh_interactive_new( git_cred **out, const char *username, - git_cred_ssh_interactive_callback prompt_callback, + git_cred_ssh_interactive_cb prompt_callback, void *payload); /** @@ -300,7 +300,7 @@ GIT_EXTERN(int) git_cred_ssh_custom_new( const char *username, const char *publickey, size_t publickey_len, - git_cred_sign_callback sign_callback, + git_cred_sign_cb sign_callback, void *payload); /** diff --git a/src/trace.c b/src/trace.c index f2f353891..ec6a90aad 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 1eaf6c92a..6cf16776f 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; diff --git a/src/transports/cred.c b/src/transports/cred.c index dfacc96d3..621cae027 100644 --- a/src/transports/cred.c +++ b/src/transports/cred.c @@ -264,7 +264,7 @@ static int git_cred_ssh_key_type_new( int git_cred_ssh_interactive_new( git_cred **out, const char *username, - git_cred_ssh_interactive_callback prompt_callback, + git_cred_ssh_interactive_cb prompt_callback, void *payload) { git_cred_ssh_interactive *c; @@ -312,7 +312,7 @@ int git_cred_ssh_custom_new( const char *username, const char *publickey, size_t publickey_len, - git_cred_sign_callback sign_callback, + git_cred_sign_cb sign_callback, void *payload) { git_cred_ssh_custom *c; |