summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorjoshaber <joshaber@gmail.com>2015-12-08 11:34:00 -0500
committerjoshaber <joshaber@gmail.com>2015-12-08 11:34:00 -0500
commiteda726cfb5ea44659e471ba10aee21f16ce2e800 (patch)
tree4b6342ad0d91a87efe598fa1ad2d45c1c4fddb11 /include/git2
parenta3dc4190e77ff794109c3ff2fbcb3fa87e5f7c48 (diff)
downloadlibgit2-eda726cfb5ea44659e471ba10aee21f16ce2e800.tar.gz
Use a typedef for the submodule_foreach callback.
This fits with the style for the rest of the project, but more importantly, makes life easier for bindings authors who auto-generate code.
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/submodule.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/git2/submodule.h b/include/git2/submodule.h
index 689fe4b64..96187b0e1 100644
--- a/include/git2/submodule.h
+++ b/include/git2/submodule.h
@@ -108,6 +108,18 @@ typedef enum {
GIT_SUBMODULE_STATUS_WD_UNTRACKED)) != 0)
/**
+ * Function pointer to receive each submodule
+ *
+ * `sm` is the `git_submodule` currently being visited.
+ *
+ * `name` is the name of the submodule.
+ *
+ * `payload` is the value you passed to the foreach function as payload.
+ */
+typedef int (*git_submodule_cb)(
+ git_submodule *sm, const char *name, void *payload);
+
+/**
* Submodule update options structure
*
* Use the GIT_SUBMODULE_UPDATE_OPTIONS_INIT to get the default settings,
@@ -239,7 +251,7 @@ GIT_EXTERN(void) git_submodule_free(git_submodule *submodule);
*/
GIT_EXTERN(int) git_submodule_foreach(
git_repository *repo,
- int (*callback)(git_submodule *sm, const char *name, void *payload),
+ git_submodule_cb callback,
void *payload);
/**