usage: add set_warn_routine()
[gitweb.git] / apply.h
diff --git a/apply.h b/apply.h
index 7493a40c730a636c43e3b21bd06a2027da003a68..f0154031111a516e58aa616259ad5ae423adc193 100644 (file)
--- a/apply.h
+++ b/apply.h
@@ -13,6 +13,12 @@ enum apply_ws_ignore {
        ignore_ws_change
 };
 
+enum apply_verbosity {
+       verbosity_silent = -1,
+       verbosity_normal = 0,
+       verbosity_verbose = 1
+};
+
 /*
  * We need to keep track of how symlinks in the preimage are
  * manipulated by the patches.  A patch to add a/b/c where a/b
@@ -51,13 +57,13 @@ struct apply_state {
        int allow_overlap;
        int apply_in_reverse;
        int apply_with_reject;
-       int apply_verbosely;
        int no_add;
        int threeway;
        int unidiff_zero;
        int unsafe_paths;
 
        /* Other non boolean parameters */
+       enum apply_verbosity apply_verbosity;
        const char *fake_ancestor;
        const char *patch_input_file;
        int line_termination;
@@ -97,4 +103,36 @@ struct apply_state {
        int applied_after_fixing_ws;
 };
 
+extern int apply_option_parse_exclude(const struct option *opt,
+                                     const char *arg, int unset);
+extern int apply_option_parse_include(const struct option *opt,
+                                     const char *arg, int unset);
+extern int apply_option_parse_p(const struct option *opt,
+                               const char *arg,
+                               int unset);
+extern int apply_option_parse_whitespace(const struct option *opt,
+                                        const char *arg, int unset);
+extern int apply_option_parse_directory(const struct option *opt,
+                                       const char *arg, int unset);
+extern int apply_option_parse_space_change(const struct option *opt,
+                                          const char *arg, int unset);
+
+extern int init_apply_state(struct apply_state *state,
+                           const char *prefix,
+                           struct lock_file *lock_file);
+extern void clear_apply_state(struct apply_state *state);
+extern int check_apply_state(struct apply_state *state, int force_apply);
+
+/*
+ * Some aspects of the apply behavior are controlled by the following
+ * bits in the "options" parameter passed to apply_all_patches().
+ */
+#define APPLY_OPT_INACCURATE_EOF       (1<<0) /* accept inaccurate eof */
+#define APPLY_OPT_RECOUNT              (1<<1) /* accept inaccurate line count */
+
+extern int apply_all_patches(struct apply_state *state,
+                            int argc,
+                            const char **argv,
+                            int options);
+
 #endif