LINENUM
extern LINENUM input_lines; /* how long is input file in lines */
ifetch(LINENUM line, int whichbuf)
LINENUM offline = line % lines_per_buf;
LINENUM baseline = line - offline;
static LINENUM tiline[2] = {-1, -1}; /* 1st line in each buffer */
char *ifetch(LINENUM, int);
static void copy_till(LINENUM, bool);
static void dump_line(LINENUM, bool);
copy_till(LINENUM lastline, bool endoffile)
static bool patch_match(LINENUM, LINENUM, LINENUM);
dump_line(LINENUM line, bool write_newline)
patch_match(LINENUM base, LINENUM offset, LINENUM fuzz)
LINENUM pline = 1 + fuzz;
LINENUM iline;
LINENUM pat_lines = pch_ptrn_lines() - fuzz;
static LINENUM last_frozen_line = 0;
static LINENUM last_offset = 0;
static LINENUM maxfuzz = 2;
LINENUM where = 0, newwhere, fuzz, mymaxfuzz;
static LINENUM
locate_hunk(LINENUM fuzz)
LINENUM first_guess = pch_first() + last_offset;
LINENUM offset;
LINENUM pat_lines = pch_ptrn_lines();
LINENUM max_pos_offset = input_lines - first_guess - pat_lines + 1;
LINENUM max_neg_offset = first_guess - last_frozen_line - 1 + pch_context();
LINENUM i;
const LINENUM pat_end = pch_end();
const LINENUM oldfirst = pch_first() + last_offset;
const LINENUM newfirst = pch_newfirst() + last_offset;
const LINENUM oldlast = oldfirst + pch_ptrn_lines() - 1;
const LINENUM newlast = newfirst + pch_repl_lines() - 1;
rej_line(int ch, LINENUM i)
LINENUM i, j, split;
const LINENUM pat_end = pch_end();
const LINENUM oldfirst = pch_first() + last_offset;
const LINENUM newfirst = pch_newfirst() + last_offset;
LINENUM input_lines = 0; /* how long is input file in lines */
apply_hunk(LINENUM where)
LINENUM old = 1;
const LINENUM lastline = pch_ptrn_lines();
LINENUM new = lastline + 1;
const LINENUM pat_end = pch_end();
static LINENUM locate_hunk(LINENUM);
static void rej_line(int, LINENUM);
static void apply_hunk(LINENUM);
LINENUM min, max;
LINENUM i;
LINENUM i;
LINENUM n;
LINENUM
LINENUM
LINENUM
LINENUM
LINENUM
LINENUM
pch_line_len(LINENUM line)
pch_char(LINENUM line)
pfetch(LINENUM line)
LINENUM
static LINENUM
LINENUM rv;
LINENUM fcl_line = -1;
next_intuit_at(off_t file_pos, LINENUM file_line)
skip_to(off_t file_pos, LINENUM file_line)
static LINENUM p_first; /* 1st line number */
static LINENUM p_newfirst; /* 1st line number of replacement */
static LINENUM p_ptrn_lines; /* # lines in pattern */
static LINENUM p_repl_lines; /* # lines in replacement text */
static LINENUM p_end = -1; /* last line in hunk */
LINENUM repl_beginning; /* index of --- line */
static LINENUM p_max; /* max allowed value of p_end */
LINENUM fillcnt; /* #lines of missing ptrn or repl */
LINENUM fillsrc; /* index of first line to copy */
LINENUM filldst; /* index of first missing line */
LINENUM repl_patch_line; /* input line number for same */
LINENUM ptrn_copiable; /* # of copiable lines in ptrn */
static LINENUM p_context = 3; /* # of context lines */
static LINENUM p_input_line = 0; /* current line # from patch file */
static LINENUM p_bline; /* line # of p_base */
static LINENUM p_sline; /* and the line number for it */
static LINENUM p_hunk_beg; /* line number of current hunk */
static LINENUM p_efake = -1; /* end of faked up lines--don't free */
static LINENUM p_bfake = -1; /* beg of faked up lines */
static void next_intuit_at(off_t, LINENUM);
static void skip_to(off_t, LINENUM);
static LINENUM strtolinenum(char *, char **);
LINENUM fillold; /* index of old lines */
LINENUM fillnew; /* index of new lines */
p_end = (LINENUM) - 1;
char *pfetch(LINENUM);
size_t pch_line_len(LINENUM);
LINENUM pch_first(void);
LINENUM pch_ptrn_lines(void);
LINENUM pch_newfirst(void);
LINENUM pch_repl_lines(void);
LINENUM pch_end(void);
LINENUM pch_context(void);
LINENUM pch_hunk_beg(void);
char pch_char(LINENUM);