summaryrefslogtreecommitdiff
path: root/include/git2/diff.h
diff options
context:
space:
mode:
authorVicent Marti <vicent@github.com>2014-03-06 13:14:15 +0100
committerVicent Marti <vicent@github.com>2014-03-06 13:14:15 +0100
commitefc822ef0d8bb632f8ea5853321084193f5e95b9 (patch)
tree942fc712d3df5cec7a8ad04979e0317b1a9a9afa /include/git2/diff.h
parenta5139485f75c677d391a7ba95f56c38642b7fc4e (diff)
parentb9f819978c571cc806827e8b3ebc1a58a0755999 (diff)
downloadlibgit2-efc822ef0d8bb632f8ea5853321084193f5e95b9.tar.gz
Merge pull request #2014 from mgbowen/cpp-options-init
Function-based options initializers
Diffstat (limited to 'include/git2/diff.h')
-rw-r--r--include/git2/diff.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/git2/diff.h b/include/git2/diff.h
index 943e2ec4c..f855f52ba 100644
--- a/include/git2/diff.h
+++ b/include/git2/diff.h
@@ -377,6 +377,19 @@ typedef struct {
{GIT_DIFF_OPTIONS_VERSION, 0, GIT_SUBMODULE_IGNORE_DEFAULT, {NULL,0}, NULL, NULL, 3}
/**
+* Initializes a `git_diff_options` with default values. Equivalent to
+* creating an instance with GIT_DIFF_OPTIONS_INIT.
+*
+* @param opts the `git_diff_options` instance to initialize.
+* @param version the version of the struct; you should pass
+* `GIT_DIFF_OPTIONS_VERSION` here.
+* @return Zero on success; -1 on failure.
+*/
+GIT_EXTERN(int) git_diff_init_options(
+ git_diff_options* opts,
+ int version);
+
+/**
* When iterating over a diff, callback that will be made per file.
*
* @param delta A pointer to the delta data for the file
@@ -604,6 +617,19 @@ typedef struct {
#define GIT_DIFF_FIND_OPTIONS_VERSION 1
#define GIT_DIFF_FIND_OPTIONS_INIT {GIT_DIFF_FIND_OPTIONS_VERSION}
+/**
+* Initializes a `git_diff_find_options` with default values. Equivalent to
+* creating an instance with GIT_DIFF_FIND_OPTIONS_INIT.
+*
+* @param opts the `git_diff_find_options` instance to initialize.
+* @param version the version of the struct; you should pass
+* `GIT_DIFF_FIND_OPTIONS_VERSION` here.
+* @return Zero on success; -1 on failure.
+*/
+GIT_EXTERN(int) git_diff_find_init_options(
+ git_diff_find_options* opts,
+ int version);
+
/** @name Diff Generator Functions
*
* These are the functions you would use to create (or destroy) a