5990271dce38a7f965264615d3e612f1b1210fd8
   1/*
   2 * Low level 3-way in-core file merge.
   3 */
   4
   5#ifndef LL_MERGE_H
   6#define LL_MERGE_H
   7
   8#define LL_OPT_VIRTUAL_ANCESTOR (1 << 0)
   9#define LL_OPT_FAVOR_MASK       ((1 << 1) | (1 << 2))
  10#define LL_OPT_FAVOR_SHIFT 1
  11
  12static inline int ll_opt_favor(int flag)
  13{
  14        return (flag & LL_OPT_FAVOR_MASK) >> LL_OPT_FAVOR_SHIFT;
  15}
  16
  17static inline int create_ll_flag(int favor)
  18{
  19        return ((favor << LL_OPT_FAVOR_SHIFT) & LL_OPT_FAVOR_MASK);
  20}
  21
  22int ll_merge(mmbuffer_t *result_buf,
  23             const char *path,
  24             mmfile_t *ancestor, const char *ancestor_label,
  25             mmfile_t *ours, const char *our_label,
  26             mmfile_t *theirs, const char *their_label,
  27             int flag);
  28
  29int ll_merge_marker_size(const char *path);
  30
  31#endif