• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt/router/busybox/editors/

Lines Matching defs:TT

240 #define TT (*ptr_to_globals)
242 SET_PTR_TO_GLOBALS(xzalloc(sizeof(TT))); \
269 if (TT.state>1 && *dlist->data != TT.state)
270 fdprintf(TT.state == 2 ? 2 : TT.fileout,
271 "%s\n", dlist->data+(TT.state>3 ? 1 : 0));
273 if (PATCH_DEBUG) fdprintf(2, "DO %d: %s\n", TT.state, dlist->data);
281 if (TT.tempname) replace_tempfile(TT.filein, TT.fileout, &TT.tempname);
282 TT.fileout = TT.filein = -1;
287 if (!TT.current_hunk) return;
288 TT.current_hunk->prev->next = 0;
290 fdprintf(2, "Hunk %d FAILED %ld/%ld.\n", TT.hunknum, TT.oldline, TT.newline);
291 TT.exitval = 1;
296 TT.state = 2;
297 llist_free(TT.current_hunk, do_line);
298 TT.current_hunk = NULL;
299 delete_tempfile(TT.filein, TT.fileout, &TT.tempname);
300 TT.state = 0;
320 TT.current_hunk->prev->next = NULL;
323 for (plist = TT.current_hunk; plist; plist = plist->next) {
328 matcheof = matcheof < TT.context;
335 plist = TT.current_hunk;
337 if (TT.context) for (;;) {
338 char *data = get_line(TT.filein);
340 TT.linenum++;
354 TT.hunknum, TT.linenum);
391 TT.state = 3;
396 plist = TT.current_hunk;
418 TT.state = "-+"[reverse ^ dummy_revert];
419 llist_free(TT.current_hunk, do_line);
420 TT.current_hunk = NULL;
421 TT.state = 1;
428 return TT.state;
452 TT.prefix = (opts & FLAG_PATHLEN) ? xatoi(opt_p) : 0; // can be negative!
453 TT.filein = TT.fileout = -1;
455 TT.filepatch = xopen_stdin(opt_i);
458 TT.filepatch = xopen_stdin(argv[1]);
470 patchline = get_line(TT.filepatch);
483 dlist_add(&TT.current_hunk, patchline);
485 if (*patchline != '+') TT.oldlen--;
486 if (*patchline != '-') TT.newlen--;
489 if (*patchline==' ' && state==2) TT.context++;
494 if (!TT.oldlen && !TT.newlen) state = apply_one_hunk();
541 TT.oldlen = TT.newlen = 1;
542 TT.oldline = strtol(s, &s, 10);
543 if (*s == ',') TT.oldlen=strtol(s+1, &s, 10);
544 TT.newline = strtol(s+2, &s, 10);
545 if (*s == ',') TT.newlen = strtol(s+1, &s, 10);
547 TT.context = 0;
551 if (TT.filein == -1) {
555 oldsum = TT.oldline + TT.oldlen;
556 newsum = TT.newline + TT.newlen;
570 if ((option_mask32 & FLAG_PATHLEN) && TT.prefix == i) break;
582 } else if (!(option_mask32 & FLAG_PATHLEN) || i <= TT.prefix) {
592 TT.filein = xopen3(name, O_CREAT|O_EXCL|O_RDWR, 0666);
595 TT.filein = xopen(name, O_RDWR);
597 TT.fileout = copy_tempfile(TT.filein, name, &TT.tempname);
598 TT.linenum = 0;
599 TT.hunknum = 0;
603 TT.hunknum++;
615 close(TT.filepatch);
620 return TT.exitval;