Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
f4584a1e
Unverified
Commit
f4584a1e
authored
Jun 10, 2019
by
Edward Thomson
Committed by
GitHub
Jun 10, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5102 from libgit2/ethomson/callback_names
Callback type names should be suffixed with `_cb`
parents
dd47a3ef
178df697
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
13 deletions
+43
-13
include/git2/deprecated.h
+30
-0
include/git2/trace.h
+2
-2
include/git2/transport.h
+6
-6
src/trace.c
+1
-1
src/trace.h
+2
-2
src/transports/cred.c
+2
-2
No files found.
include/git2/deprecated.h
View file @
f4584a1e
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include "object.h"
#include "object.h"
#include "refs.h"
#include "refs.h"
#include "remote.h"
#include "remote.h"
#include "trace.h"
/*
/*
* Users can avoid deprecated functions by defining `GIT_DEPRECATE_HARD`.
* Users can avoid deprecated functions by defining `GIT_DEPRECATE_HARD`.
...
@@ -246,6 +247,35 @@ GIT_EXTERN(void) giterr_set_oom(void);
...
@@ -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
/** @name Deprecated Transfer Progress Types
*
*
* These types are retained for backward compatibility. The newer
* These types are retained for backward compatibility. The newer
...
...
include/git2/trace.h
View file @
f4584a1e
...
@@ -49,7 +49,7 @@ typedef enum {
...
@@ -49,7 +49,7 @@ typedef enum {
/**
/**
* An instance for a tracing function
* An instance for a tracing function
*/
*/
typedef
void
GIT_CALLBACK
(
git_trace_c
allback
)(
git_trace_level_t
level
,
const
char
*
msg
);
typedef
void
GIT_CALLBACK
(
git_trace_c
b
)(
git_trace_level_t
level
,
const
char
*
msg
);
/**
/**
* Sets the system tracing configuration to the specified level with the
* 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
...
@@ -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
* @param cb Function to call with trace data
* @return 0 or an error code
* @return 0 or an error code
*/
*/
GIT_EXTERN
(
int
)
git_trace_set
(
git_trace_level_t
level
,
git_trace_c
allback
cb
);
GIT_EXTERN
(
int
)
git_trace_set
(
git_trace_level_t
level
,
git_trace_c
b
cb
);
/** @} */
/** @} */
GIT_END_DECL
GIT_END_DECL
...
...
include/git2/transport.h
View file @
f4584a1e
...
@@ -165,8 +165,8 @@ typedef struct _LIBSSH2_USERAUTH_KBDINT_PROMPT LIBSSH2_USERAUTH_KBDINT_PROMPT;
...
@@ -165,8 +165,8 @@ typedef struct _LIBSSH2_USERAUTH_KBDINT_PROMPT LIBSSH2_USERAUTH_KBDINT_PROMPT;
typedef
struct
_LIBSSH2_USERAUTH_KBDINT_RESPONSE
LIBSSH2_USERAUTH_KBDINT_RESPONSE
;
typedef
struct
_LIBSSH2_USERAUTH_KBDINT_RESPONSE
LIBSSH2_USERAUTH_KBDINT_RESPONSE
;
#endif
#endif
typedef
int
GIT_CALLBACK
(
git_cred_sign_c
allback
)(
LIBSSH2_SESSION
*
session
,
unsigned
char
**
sig
,
size_t
*
sig_len
,
const
unsigned
char
*
data
,
size_t
data_len
,
void
**
abstract
);
typedef
int
GIT_CALLBACK
(
git_cred_sign_c
b
)(
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_c
allback
)(
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
void
GIT_CALLBACK
(
git_cred_ssh_interactive_c
b
)(
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
* A ssh key from disk
...
@@ -185,7 +185,7 @@ typedef struct git_cred_ssh_key {
...
@@ -185,7 +185,7 @@ typedef struct git_cred_ssh_key {
typedef
struct
git_cred_ssh_interactive
{
typedef
struct
git_cred_ssh_interactive
{
git_cred
parent
;
git_cred
parent
;
char
*
username
;
char
*
username
;
git_cred_ssh_interactive_c
allback
prompt_callback
;
git_cred_ssh_interactive_c
b
prompt_callback
;
void
*
payload
;
void
*
payload
;
}
git_cred_ssh_interactive
;
}
git_cred_ssh_interactive
;
...
@@ -197,7 +197,7 @@ typedef struct git_cred_ssh_custom {
...
@@ -197,7 +197,7 @@ typedef struct git_cred_ssh_custom {
char
*
username
;
char
*
username
;
char
*
publickey
;
char
*
publickey
;
size_t
publickey_len
;
size_t
publickey_len
;
git_cred_sign_c
allback
sign_callback
;
git_cred_sign_c
b
sign_callback
;
void
*
payload
;
void
*
payload
;
}
git_cred_ssh_custom
;
}
git_cred_ssh_custom
;
...
@@ -262,7 +262,7 @@ GIT_EXTERN(int) git_cred_ssh_key_new(
...
@@ -262,7 +262,7 @@ GIT_EXTERN(int) git_cred_ssh_key_new(
GIT_EXTERN
(
int
)
git_cred_ssh_interactive_new
(
GIT_EXTERN
(
int
)
git_cred_ssh_interactive_new
(
git_cred
**
out
,
git_cred
**
out
,
const
char
*
username
,
const
char
*
username
,
git_cred_ssh_interactive_c
allback
prompt_callback
,
git_cred_ssh_interactive_c
b
prompt_callback
,
void
*
payload
);
void
*
payload
);
/**
/**
...
@@ -300,7 +300,7 @@ GIT_EXTERN(int) git_cred_ssh_custom_new(
...
@@ -300,7 +300,7 @@ GIT_EXTERN(int) git_cred_ssh_custom_new(
const
char
*
username
,
const
char
*
username
,
const
char
*
publickey
,
const
char
*
publickey
,
size_t
publickey_len
,
size_t
publickey_len
,
git_cred_sign_c
allback
sign_callback
,
git_cred_sign_c
b
sign_callback
,
void
*
payload
);
void
*
payload
);
/**
/**
...
...
src/trace.c
View file @
f4584a1e
...
@@ -17,7 +17,7 @@ struct git_trace_data git_trace__data = {0};
...
@@ -17,7 +17,7 @@ struct git_trace_data git_trace__data = {0};
#endif
#endif
int
git_trace_set
(
git_trace_level_t
level
,
git_trace_c
allback
callback
)
int
git_trace_set
(
git_trace_level_t
level
,
git_trace_c
b
callback
)
{
{
#ifdef GIT_TRACE
#ifdef GIT_TRACE
assert
(
level
==
0
||
callback
!=
NULL
);
assert
(
level
==
0
||
callback
!=
NULL
);
...
...
src/trace.h
View file @
f4584a1e
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
struct
git_trace_data
{
struct
git_trace_data
{
git_trace_level_t
level
;
git_trace_level_t
level
;
git_trace_c
allback
callback
;
git_trace_c
b
callback
;
};
};
extern
struct
git_trace_data
git_trace__data
;
extern
struct
git_trace_data
git_trace__data
;
...
@@ -25,7 +25,7 @@ GIT_INLINE(void) git_trace__write_fmt(
...
@@ -25,7 +25,7 @@ GIT_INLINE(void) git_trace__write_fmt(
git_trace_level_t
level
,
git_trace_level_t
level
,
const
char
*
fmt
,
...)
const
char
*
fmt
,
...)
{
{
git_trace_c
allback
callback
=
git_trace__data
.
callback
;
git_trace_c
b
callback
=
git_trace__data
.
callback
;
git_buf
message
=
GIT_BUF_INIT
;
git_buf
message
=
GIT_BUF_INIT
;
va_list
ap
;
va_list
ap
;
...
...
src/transports/cred.c
View file @
f4584a1e
...
@@ -264,7 +264,7 @@ static int git_cred_ssh_key_type_new(
...
@@ -264,7 +264,7 @@ static int git_cred_ssh_key_type_new(
int
git_cred_ssh_interactive_new
(
int
git_cred_ssh_interactive_new
(
git_cred
**
out
,
git_cred
**
out
,
const
char
*
username
,
const
char
*
username
,
git_cred_ssh_interactive_c
allback
prompt_callback
,
git_cred_ssh_interactive_c
b
prompt_callback
,
void
*
payload
)
void
*
payload
)
{
{
git_cred_ssh_interactive
*
c
;
git_cred_ssh_interactive
*
c
;
...
@@ -312,7 +312,7 @@ int git_cred_ssh_custom_new(
...
@@ -312,7 +312,7 @@ int git_cred_ssh_custom_new(
const
char
*
username
,
const
char
*
username
,
const
char
*
publickey
,
const
char
*
publickey
,
size_t
publickey_len
,
size_t
publickey_len
,
git_cred_sign_c
allback
sign_callback
,
git_cred_sign_c
b
sign_callback
,
void
*
payload
)
void
*
payload
)
{
{
git_cred_ssh_custom
*
c
;
git_cred_ssh_custom
*
c
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment