Don't redefine the same callback types, their signatures may change
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 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252
diff --git a/examples/network/fetch.c b/examples/network/fetch.c
index fdd82a1..03f1541 100644
--- a/examples/network/fetch.c
+++ b/examples/network/fetch.c
@@ -97,7 +97,7 @@ int fetch(git_repository *repo, int argc, char **argv)
// Set up the callbacks (only update_tips for now)
callbacks.update_tips = &update_cb;
- callbacks.progress = &progress_cb;
+ callbacks.sideband_progress = &progress_cb;
callbacks.credentials = cred_acquire_cb;
git_remote_set_callbacks(remote, &callbacks);
diff --git a/include/git2/indexer.h b/include/git2/indexer.h
index e4c03ad..d2d315e 100644
--- a/include/git2/indexer.h
+++ b/include/git2/indexer.h
@@ -32,7 +32,7 @@ GIT_EXTERN(int) git_indexer_new(
const char *path,
unsigned int mode,
git_odb *odb,
- git_transfer_progress_callback progress_cb,
+ git_transfer_progress_cb progress_cb,
void *progress_cb_payload);
/**
diff --git a/include/git2/odb.h b/include/git2/odb.h
index c71e306..114f6b3 100644
--- a/include/git2/odb.h
+++ b/include/git2/odb.h
@@ -338,7 +338,7 @@ GIT_EXTERN(int) git_odb_open_rstream(git_odb_stream **out, git_odb *db, const gi
GIT_EXTERN(int) git_odb_write_pack(
git_odb_writepack **out,
git_odb *db,
- git_transfer_progress_callback progress_cb,
+ git_transfer_progress_cb progress_cb,
void *progress_payload);
/**
diff --git a/include/git2/pack.h b/include/git2/pack.h
index 29c926c..e7f060d 100644
--- a/include/git2/pack.h
+++ b/include/git2/pack.h
@@ -140,7 +140,7 @@ GIT_EXTERN(int) git_packbuilder_write(
git_packbuilder *pb,
const char *path,
unsigned int mode,
- git_transfer_progress_callback progress_cb,
+ git_transfer_progress_cb progress_cb,
void *progress_cb_payload);
/**
diff --git a/include/git2/remote.h b/include/git2/remote.h
index 06fc8e9..ebd83c0 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -457,7 +457,7 @@ struct git_remote_callbacks {
* progress side-band will be passed to this function (this is
* the 'counting objects' output.
*/
- int (*sideband_progress)(const char *str, int len, void *data);
+ git_transport_message_cb sideband_progress;
/**
* Completion is called when different parts of the download
@@ -469,14 +469,14 @@ struct git_remote_callbacks {
* This will be called if the remote host requires
* authentication in order to connect to it.
*/
- int (*credentials)(git_cred **cred, const char *url, const char *username_from_url, unsigned int allowed_types, void *data);
+ git_cred_acquire_cb credentials;
/**
* During the download of new data, this will be regularly
* called with the current count of progress done by the
* indexer.
*/
- int (*transfer_progress)(const git_transfer_progress *stats, void *data);
+ git_transfer_progress_cb transfer_progress;
/**
* Each time a reference is updated locally, this function
diff --git a/include/git2/sys/odb_backend.h b/include/git2/sys/odb_backend.h
index 81bb082..77fe0dd 100644
--- a/include/git2/sys/odb_backend.h
+++ b/include/git2/sys/odb_backend.h
@@ -81,7 +81,7 @@ struct git_odb_backend {
int (* writepack)(
git_odb_writepack **, git_odb_backend *, git_odb *odb,
- git_transfer_progress_callback progress_cb, void *progress_payload);
+ git_transfer_progress_cb progress_cb, void *progress_payload);
void (* free)(git_odb_backend *);
};
diff --git a/include/git2/transport.h b/include/git2/transport.h
index 1665f97..a33146c 100644
--- a/include/git2/transport.h
+++ b/include/git2/transport.h
@@ -287,7 +287,7 @@ struct git_transport {
git_transport *transport,
git_repository *repo,
git_transfer_progress *stats,
- git_transfer_progress_callback progress_cb,
+ git_transfer_progress_cb progress_cb,
void *progress_payload);
/* Checks to see if the transport is connected */
diff --git a/include/git2/types.h b/include/git2/types.h
index 9db59b1..1b6f4cc 100644
--- a/include/git2/types.h
+++ b/include/git2/types.h
@@ -241,7 +241,7 @@ typedef struct git_transfer_progress {
* @param stats Structure containing information about the state of the transfer
* @param payload Payload provided by caller
*/
-typedef int (*git_transfer_progress_callback)(const git_transfer_progress *stats, void *payload);
+typedef int (*git_transfer_progress_cb)(const git_transfer_progress *stats, void *payload);
/**
* Opaque structure representing a submodule.
diff --git a/src/fetch.h b/src/fetch.h
index 9605da1..f66e446 100644
--- a/src/fetch.h
+++ b/src/fetch.h
@@ -17,7 +17,7 @@ int git_fetch__download_pack(
git_transport *t,
git_repository *repo,
git_transfer_progress *stats,
- git_transfer_progress_callback progress_cb,
+ git_transfer_progress_cb progress_cb,
void *progress_payload);
int git_fetch_setup_walk(git_revwalk **out, git_repository *repo);
diff --git a/src/indexer.c b/src/indexer.c
index 346870f..adf5cea 100644
--- a/src/indexer.c
+++ b/src/indexer.c
@@ -45,7 +45,7 @@ struct git_indexer {
unsigned int fanout[256];
git_hash_ctx hash_ctx;
git_oid hash;
- git_transfer_progress_callback progress_cb;
+ git_transfer_progress_cb progress_cb;
void *progress_payload;
char objbuf[8*1024];
@@ -120,7 +120,7 @@ int git_indexer_new(
const char *prefix,
unsigned int mode,
git_odb *odb,
- git_transfer_progress_callback progress_cb,
+ git_transfer_progress_cb progress_cb,
void *progress_payload)
{
git_indexer *idx;
diff --git a/src/odb.c b/src/odb.c
index 72d1506..00740d2 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -1051,7 +1051,7 @@ int git_odb_open_rstream(git_odb_stream **stream, git_odb *db, const git_oid *oi
return error;
}
-int git_odb_write_pack(struct git_odb_writepack **out, git_odb *db, git_transfer_progress_callback progress_cb, void *progress_payload)
+int git_odb_write_pack(struct git_odb_writepack **out, git_odb *db, git_transfer_progress_cb progress_cb, void *progress_payload)
{
size_t i, writes = 0;
int error = GIT_ERROR;
diff --git a/src/odb_pack.c b/src/odb_pack.c
index 9ab6838..3750da3 100644
--- a/src/odb_pack.c
+++ b/src/odb_pack.c
@@ -563,7 +563,7 @@ static void pack_backend__writepack_free(struct git_odb_writepack *_writepack)
static int pack_backend__writepack(struct git_odb_writepack **out,
git_odb_backend *_backend,
git_odb *odb,
- git_transfer_progress_callback progress_cb,
+ git_transfer_progress_cb progress_cb,
void *progress_payload)
{
struct pack_backend *backend;
diff --git a/src/pack-objects.c b/src/pack-objects.c
index c881e6d..7e5f667 100644
--- a/src/pack-objects.c
+++ b/src/pack-objects.c
@@ -1288,7 +1288,7 @@ int git_packbuilder_write(
git_packbuilder *pb,
const char *path,
unsigned int mode,
- git_transfer_progress_callback progress_cb,
+ git_transfer_progress_cb progress_cb,
void *progress_cb_payload)
{
git_indexer *indexer;
diff --git a/src/transports/local.c b/src/transports/local.c
index f8d511e..2c17e62 100644
--- a/src/transports/local.c
+++ b/src/transports/local.c
@@ -472,7 +472,7 @@ on_error:
typedef struct foreach_data {
git_transfer_progress *stats;
- git_transfer_progress_callback progress_cb;
+ git_transfer_progress_cb progress_cb;
void *progress_payload;
git_odb_writepack *writepack;
} foreach_data;
@@ -489,7 +489,7 @@ static int local_download_pack(
git_transport *transport,
git_repository *repo,
git_transfer_progress *stats,
- git_transfer_progress_callback progress_cb,
+ git_transfer_progress_cb progress_cb,
void *progress_payload)
{
transport_local *t = (transport_local*)transport;
diff --git a/src/transports/smart.h b/src/transports/smart.h
index 32f0be7..a2b6b2a 100644
--- a/src/transports/smart.h
+++ b/src/transports/smart.h
@@ -167,7 +167,7 @@ int git_smart__download_pack(
git_transport *transport,
git_repository *repo,
git_transfer_progress *stats,
- git_transfer_progress_callback progress_cb,
+ git_transfer_progress_cb progress_cb,
void *progress_payload);
/* smart.c */
diff --git a/src/transports/smart_protocol.c b/src/transports/smart_protocol.c
index 6f93517..cf67f90 100644
--- a/src/transports/smart_protocol.c
+++ b/src/transports/smart_protocol.c
@@ -450,7 +450,7 @@ static int no_sideband(transport_smart *t, struct git_odb_writepack *writepack,
struct network_packetsize_payload
{
- git_transfer_progress_callback callback;
+ git_transfer_progress_cb callback;
void *payload;
git_transfer_progress *stats;
size_t last_fired_bytes;
@@ -478,7 +478,7 @@ int git_smart__download_pack(
git_transport *transport,
git_repository *repo,
git_transfer_progress *stats,
- git_transfer_progress_callback transfer_progress_cb,
+ git_transfer_progress_cb transfer_progress_cb,
void *progress_payload)
{
transport_smart *t = (transport_smart *)transport;