Browse Source

apply: move libified code from builtin/apply.c to apply.{c,h}

As most of the apply code in builtin/apply.c has been libified by a number of
previous commits, it can now be moved to apply.{c,h}, so that more code can
use it.

Helped-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Helped-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Christian Couder 9 years ago committed by Junio C Hamano
parent
commit
13b5af22f3
  1. 4731
      apply.c
  2. 19
      apply.h
  3. 4733
      builtin/apply.c

4731
apply.c

File diff suppressed because it is too large Load Diff

19
apply.h

@ -102,6 +102,20 @@ extern int parse_whitespace_option(struct apply_state *state, @@ -102,6 +102,20 @@ extern int parse_whitespace_option(struct apply_state *state,
extern int parse_ignorewhitespace_option(struct apply_state *state,
const char *option);

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);
@ -115,4 +129,9 @@ extern int check_apply_state(struct apply_state *state, int force_apply); @@ -115,4 +129,9 @@ extern int check_apply_state(struct apply_state *state, int force_apply);
#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

4733
builtin/apply.c

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save