* Copyright (c) 1987 The Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that: (1) source distributions retain this entire copyright
* notice and comment, and (2) distributions including binaries display
* the following acknowledgement: ``This product includes software
* developed by the University of California, Berkeley and its contributors''
* in the documentation or other materials provided with the distribution
* and in all advertising materials mentioning features or use of this
* software. Neither the name of the University nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
static char sccsid
[] = "@(#)print.c 5.3 (Berkeley) 6/1/90";
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
);