summaryrefslogtreecommitdiff
path: root/include/git2/status.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-11-21 11:53:54 -0800
committerBen Straub <bs@github.com>2012-11-27 13:18:29 -0800
commitd574de0e6ef05c5de89810b5460bc201ddc513de (patch)
treefb68b0e7acfa8ba70a9225eec305bb284e042304 /include/git2/status.h
parent9daf240053dbe843ed925ccb713edad4a4ddff9e (diff)
downloadlibgit2-d574de0e6ef05c5de89810b5460bc201ddc513de.tar.gz
API updates for status.h
Diffstat (limited to 'include/git2/status.h')
-rw-r--r--include/git2/status.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/include/git2/status.h b/include/git2/status.h
index 8c59d768d..c6926f343 100644
--- a/include/git2/status.h
+++ b/include/git2/status.h
@@ -47,6 +47,18 @@ typedef enum {
} git_status_t;
/**
+ * Function pointer to receive status on individual files
+ *
+ * `path` is the relative path to the file from the root of the repository.
+ *
+ * `status_flags` is a combination of `git_status_t` values that apply.
+ *
+ * `payload` is the value you passed to the foreach function as payload.
+ */
+typedef int (*git_status_cb)(
+ const char *path, unsigned int status_flags, void *payload);
+
+/**
* Gather file statuses and run a callback for each one.
*
* The callback is passed the path of the file, the status (a combination of
@@ -63,7 +75,7 @@ typedef enum {
*/
GIT_EXTERN(int) git_status_foreach(
git_repository *repo,
- int (*callback)(const char *, unsigned int, void *),
+ git_status_cb callback,
void *payload);
/**
@@ -146,9 +158,10 @@ typedef enum {
* `GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH` is specified in the flags.
*/
typedef struct {
+ unsigned int version;
git_status_show_t show;
- unsigned int flags;
- git_strarray pathspec;
+ unsigned int flags;
+ git_strarray pathspec;
} git_status_options;
/**
@@ -168,7 +181,7 @@ typedef struct {
GIT_EXTERN(int) git_status_foreach_ext(
git_repository *repo,
const git_status_options *opts,
- int (*callback)(const char *, unsigned int, void *),
+ git_status_cb callback,
void *payload);
/**