Lines Matching refs:TT

72   if (TT.state>1 && *dlist->data != TT.state) {
73 char *s = dlist->data+(TT.state>3);
74 int i = TT.state == 2 ? 2 : TT.fileout;
80 if (FLAG(x)) fprintf(stderr, "DO %d: %s\n", TT.state, dlist->data);
88 if (TT.tempname) replace_tempfile(TT.filein, TT.fileout, &TT.tempname);
89 TT.fileout = TT.filein = -1;
94 if (!TT.current_hunk) return;
97 TT.hunknum, TT.oldline, TT.newline);
103 TT.state = 2;
104 llist_traverse(TT.current_hunk, do_line);
105 TT.current_hunk = NULL;
106 if (!FLAG(dry_run)) delete_tempfile(TT.filein, TT.fileout, &TT.tempname);
107 TT.state = 0;
138 dlist_terminate(TT.current_hunk);
141 for (plist = TT.current_hunk; plist; plist = plist->next) {
146 matcheof = !trailing || trailing < TT.context;
153 plist = TT.current_hunk;
157 char *data = get_line(TT.filein);
159 TT.linenum++;
164 if (!backwarn) backwarn = TT.linenum;
177 TT.hunknum, TT.linenum);
211 if (!TT.context || trailing>TT.context) {
216 TT.state = 3;
218 plist = TT.current_hunk;
236 TT.state = "-+"[reverse];
237 llist_traverse(TT.current_hunk, do_line);
238 TT.current_hunk = NULL;
239 TT.state = 1;
246 return TT.state;
291 if (TT.i) TT.filepatch = xopenro(TT.i);
292 TT.filein = TT.fileout = -1;
294 if (TT.d) xchdir(TT.d);
300 patchline = get_line(TT.filepatch);
320 dlist_add(&TT.current_hunk, patchline);
322 if (*patchline != '+') TT.oldlen--;
323 if (*patchline != '-') TT.newlen--;
326 if (*patchline==' ' && state==2) TT.context++;
330 if (!TT.oldlen && !TT.newlen) state = apply_one_hunk();
333 dlist_terminate(TT.current_hunk);
374 TT.oldlen = TT.newlen = 1;
375 TT.oldline = strtol(s, &s, 10);
376 if (*s == ',') TT.oldlen=strtol(s+1, &s, 10);
377 TT.newline = strtol(s+2, &s, 10);
378 if (*s == ',') TT.newlen = strtol(s+1, &s, 10);
380 TT.context = 0;
384 if (TT.filein == -1) {
388 oldsum = TT.oldline + TT.oldlen;
389 newsum = TT.newline + TT.newlen;
403 if (FLAG(p) && TT.p == i) break;
415 } else if (!FLAG(p) || i <= TT.p) {
421 TT.filein = xcreate(name, O_CREAT|O_EXCL|O_RDWR, 0666);
424 TT.filein = xopenro(name);
426 if (FLAG(dry_run)) TT.fileout = xopen("/dev/null", O_RDWR);
427 else TT.fileout = copy_tempfile(TT.filein, name, &TT.tempname);
428 TT.linenum = 0;
429 TT.hunknum = 0;
433 TT.hunknum++;
445 close(TT.filepatch);