From eecc80502975df5ef3aa9027d1b8b929cd6181bd Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Tue, 20 Nov 2012 14:03:05 -0800 Subject: Update callback fn ptr for git_reference_foreach As part of API review, use a typedef for the callback fn ptr. --- include/git2/refs.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/git2/refs.h') diff --git a/include/git2/refs.h b/include/git2/refs.h index 4e5a691e6..c92646115 100644 --- a/include/git2/refs.h +++ b/include/git2/refs.h @@ -288,6 +288,8 @@ GIT_EXTERN(int) git_reference_packall(git_repository *repo); */ GIT_EXTERN(int) git_reference_list(git_strarray *array, git_repository *repo, unsigned int list_flags); +typedef int (*git_reference_foreach_cb)(const char *refname, void *payload); + /** * Perform a callback on each reference in the repository. * @@ -308,7 +310,11 @@ GIT_EXTERN(int) git_reference_list(git_strarray *array, git_repository *repo, un * @param payload Additional data to pass to the callback * @return 0 on success, GIT_EUSER on non-zero callback, or error code */ -GIT_EXTERN(int) git_reference_foreach(git_repository *repo, unsigned int list_flags, int (*callback)(const char *, void *), void *payload); +GIT_EXTERN(int) git_reference_foreach( + git_repository *repo, + unsigned int list_flags, + git_reference_foreach_cb callback, + void *payload); /** * Check if a reference has been loaded from a packfile. -- cgit v1.2.1