]> git.proxmox.com Git - libgit2.git/blobdiff - src/patch.h
New upstream version 1.4.3+dfsg.1
[libgit2.git] / src / patch.h
index ecab570d5f4703828cf1cba7e432e25335546afb..1e1471ed613abe8f11a0bbc6479e6753bd6bfd10 100644 (file)
@@ -7,6 +7,8 @@
 #ifndef INCLUDE_patch_h__
 #define INCLUDE_patch_h__
 
+#include "common.h"
+
 #include "git2/patch.h"
 #include "array.h"
 
@@ -33,8 +35,6 @@ struct git_patch {
        size_t content_size;
        size_t context_size;
 
-       const git_diff_file *(*newfile)(git_patch *patch);
-       const git_diff_file *(*oldfile)(git_patch *patch);
        void (*free_fn)(git_patch *patch);
 };
 
@@ -52,6 +52,18 @@ extern int git_patch_line_stats(
        size_t *total_dels,
        const git_patch *patch);
 
+/** Options for parsing patch files. */
+typedef struct {
+       /**
+        * The length of the prefix (in path segments) for the filenames.
+        * This prefix will be removed when looking for files.  The default is 1.
+        */
+       uint32_t prefix_len;
+} git_patch_options;
+
+#define GIT_PATCH_OPTIONS_INIT { 1 }
+
+extern int git_patch__to_buf(git_str *out, git_patch *patch);
 extern void git_patch_free(git_patch *patch);
 
 #endif