blob: 9f0852d321bbed548fa57b5afdc3aad25c1dd943 [file] [log] [blame]
Junio C Hamanobe3cfa82005-04-26 09:25:05 -07001/*
2 * Copyright (C) 2005 Junio C Hamano
3 */
Junio C Hamano86436c22005-04-25 18:22:47 -07004#ifndef DIFF_H
5#define DIFF_H
6
Junio C Hamano67574c42005-06-01 11:38:07 -07007#define DIFF_FILE_CANON_MODE(mode) \
8 (S_ISREG(mode) ? (S_IFREG | ce_permissions(mode)) : \
9 S_ISLNK(mode) ? S_IFLNK : S_IFDIR)
10
Junio C Hamano77eb2722005-04-27 09:21:00 -070011extern void diff_addremove(int addremove,
12 unsigned mode,
13 const unsigned char *sha1,
14 const char *base,
15 const char *path);
16
17extern void diff_change(unsigned mode1, unsigned mode2,
18 const unsigned char *sha1,
19 const unsigned char *sha2,
20 const char *base, const char *path);
21
Junio C Hamanob6d8f302005-05-23 14:55:33 -070022extern void diff_helper_input(unsigned mode1,
23 unsigned mode2,
24 const unsigned char *sha1,
25 const unsigned char *sha2,
26 const char *path1,
27 int status,
28 int score,
29 const char *path2);
Junio C Hamano81e50ea2005-05-21 19:42:18 -070030
Junio C Hamano77eb2722005-04-27 09:21:00 -070031extern void diff_unmerge(const char *path);
32
Junio C Hamano57fe64a2005-05-19 19:00:36 -070033extern int diff_scoreopt_parse(const char *opt);
34
Junio C Hamano19feebc2005-05-27 15:54:37 -070035#define DIFF_SETUP_REVERSE 1
Junio C Hamanof0c6b2a2005-05-27 15:56:38 -070036#define DIFF_SETUP_USE_CACHE 2
37#define DIFF_SETUP_USE_SIZE_CACHE 4
Junio C Hamanoce240672005-06-03 01:36:43 -070038
Junio C Hamano19feebc2005-05-27 15:54:37 -070039extern void diff_setup(int flags);
Junio C Hamano86436c22005-04-25 18:22:47 -070040
Junio C Hamano6b14d7f2005-05-22 10:04:37 -070041#define DIFF_DETECT_RENAME 1
42#define DIFF_DETECT_COPY 2
43
Junio C Hamano367cec12005-05-27 15:55:28 -070044#define DIFF_PICKAXE_ALL 1
Junio C Hamanof345b0a2005-05-30 00:08:37 -070045
Junio C Hamanobefe8632005-05-29 16:56:13 -070046extern void diffcore_std(const char **paths,
47 int detect_rename, int rename_score,
Junio C Hamanof345b0a2005-05-30 00:08:37 -070048 const char *pickaxe, int pickaxe_opts,
Junio C Hamanoaf5323e2005-05-30 00:09:07 -070049 int break_opt,
Junio C Hamanof2ce9fd2005-06-11 20:57:13 -070050 const char *orderfile, const char *filter);
51
52extern void diffcore_std_no_resolve(const char **paths,
53 const char *pickaxe, int pickaxe_opts,
54 const char *orderfile, const char *filter);
Junio C Hamanobefe8632005-05-29 16:56:13 -070055
Junio C Hamano38c6f782005-05-21 19:40:36 -070056extern int diff_queue_is_empty(void);
57
Junio C Hamano19feebc2005-05-27 15:54:37 -070058#define DIFF_FORMAT_HUMAN 0
59#define DIFF_FORMAT_MACHINE 1
60#define DIFF_FORMAT_PATCH 2
61#define DIFF_FORMAT_NO_OUTPUT 3
62
Junio C Hamanof2ce9fd2005-06-11 20:57:13 -070063extern void diff_flush(int output_style);
Junio C Hamano86436c22005-04-25 18:22:47 -070064
65#endif /* DIFF_H */