diff options
| author | Jesse Ezell <[email protected]> | 2014-02-26 10:41:20 -0800 |
|---|---|---|
| committer | Jesse Ezell <[email protected]> | 2014-02-26 10:41:20 -0800 |
| commit | e2db9b16cda4aec7c94efc19cf2379578bef1b48 (patch) | |
| tree | 165db4b63d6296e93b1a8febd6b780f858f969b4 /wrapper.c | |
| parent | 1c1f7bd1fab3be4a1274149292979bea4ee8aadf (diff) | |
| parent | 32bf5f0a234e0c3cd00dc8eec349ee820f765f19 (diff) | |
merge latest, cleanup error handling, add thread locks
Diffstat (limited to 'wrapper.c')
| -rw-r--r-- | wrapper.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -24,4 +24,31 @@ int _go_git_odb_foreach(git_odb *db, void *payload) { return git_odb_foreach(db, (git_odb_foreach_cb)&odbForEachCb, payload); } + +void _go_git_setup_callbacks(git_remote_callbacks *callbacks) { + typedef int (*progress_cb)(const char *str, int len, void *data); + typedef int (*completion_cb)(git_remote_completion_type type, void *data); + typedef int (*credentials_cb)(git_cred **cred, const char *url, const char *username_from_url, unsigned int allowed_types, void *data); + typedef int (*transfer_progress_cb)(const git_transfer_progress *stats, void *data); + typedef int (*update_tips_cb)(const char *refname, const git_oid *a, const git_oid *b, void *data); + callbacks->progress = (progress_cb)progressCallback; + callbacks->completion = (completion_cb)completionCallback; + callbacks->credentials = (credentials_cb)credentialsCallback; + callbacks->transfer_progress = (transfer_progress_cb)transferProgressCallback; + callbacks->update_tips = (update_tips_cb)updateTipsCallback; +} + +git_remote_callbacks _go_git_remote_callbacks_init() { + git_remote_callbacks ret = GIT_REMOTE_CALLBACKS_INIT; + return ret; +} + +void _go_git_set_strarray_n(git_strarray *array, char *str, size_t n) { + array->strings[n] = str; +} + +char *_go_git_get_strarray_n(git_strarray *array, size_t n) { + return array->strings[n]; +} + /* EOF */ |
