* Copyright (c) 1987 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
static char sccsid
[] = "@(#)print.c 5.1 (Berkeley) %G%";
extern char searchar
; /* ex search character */
* get the line the token of interest occurred on,
* prepare it for printing.
(void)fseek(inf
,lineftell
,L_SET
);
for (cp
= lbuf
;GETC(!=,'\n');*cp
++ = c
);
* do all processing here, so we don't step through the
* line more than once; means you don't call this routine
* unless you're sure you've got a keeper.
else for (cnt
= 0,cp
= lbuf
;GETC(!=,EOF
) && cnt
< ENDLINE
;++cnt
) {
if (c
== (int)'\\') { /* backslashes */
*cp
++ = '\\'; *cp
++ = '\\';
else if (c
== (int)searchar
) { /* search character */
else if (c
== (int)'\n') { /* end of keep */
*cp
++ = '$'; /* can find whole line */
(void)fseek(inf
,saveftell
,L_SET
);
extern FILE *outf
; /* ioptr for tags file */
extern int vflag
; /* -v: vgrind style output */
node
->entry
,node
->file
,(node
->lno
+ 63) / 64);
printf("%-16s%4d %-16s %s\n",
node
->entry
,node
->lno
,node
->file
,node
->pat
);
fprintf(outf
,"%s\t%s\t%c^%s%c\n",
node
->entry
,node
->file
,searchar
,node
->pat
,searchar
);
put_entries(node
->right
);
if (!(space
= malloc((u_int
)len
))) {
* should probably free up the tree, here,
* we're just as likely to fail here as we
* are when getting the NODE structure
fputs("ctags: no more space.\n",stderr
);