600 |
* printtag: print a tag's line |
* printtag: print a tag's line |
601 |
* |
* |
602 |
* i) op output stream |
* i) op output stream |
603 |
* i) line tag's line |
* i) ctags_x ctags -x format record |
604 |
*/ |
*/ |
605 |
void |
void |
606 |
printtag(FILE *op, const char *line) /* virtually const */ |
printtag(FILE *op, const char *ctags_x) /* virtually const */ |
607 |
{ |
{ |
608 |
if (xflag) { |
if (xflag) { |
609 |
fputs(line, op); |
fputs(ctags_x, op); |
610 |
} else { |
} else { |
611 |
SPLIT ptable; |
SPLIT ptable; |
612 |
int n; |
int n; |
614 |
/* |
/* |
615 |
* Split tag line. |
* Split tag line. |
616 |
*/ |
*/ |
617 |
n = split((char *)line, 4, &ptable); |
n = split((char *)ctags_x, 4, &ptable); |
618 |
|
|
619 |
if (tflag) { |
if (tflag) { |
620 |
fputs(ptable.part[0].start, op); /* tag */ |
fputs(ptable.part[PART_TAG].start, op); /* tag */ |
621 |
(void)putc('\t', op); |
(void)putc('\t', op); |
622 |
fputs(ptable.part[2].start, op); /* path */ |
fputs(ptable.part[PART_PATH].start, op);/* path */ |
623 |
(void)putc('\t', op); |
(void)putc('\t', op); |
624 |
fputs(ptable.part[1].start, op); /* line number */ |
fputs(ptable.part[PART_LNO].start, op); /* line number */ |
625 |
} else { |
} else { |
626 |
fputs(ptable.part[2].start, op); /* path */ |
fputs(ptable.part[PART_PATH].start, op);/* path */ |
627 |
} |
} |
628 |
recover(&ptable); |
recover(&ptable); |
629 |
} |
} |