xref: /original-bsd/usr.bin/ctags/ctags.h (revision c3e32dec)
1 /*
2  * Copyright (c) 1987, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)ctags.h	8.1 (Berkeley) 06/06/93
8  */
9 
10 #define	bool	char
11 
12 #define	YES		1
13 #define	NO		0
14 #define	EOS		'\0'
15 
16 #define	ENDLINE		50		/* max length of pattern */
17 #define	MAXTOKEN	250		/* max size of single token */
18 
19 #define	SETLINE		{++lineno;lineftell = ftell(inf);}
20 #define	GETC(op,exp)	((c = getc(inf)) op (int)exp)
21 
22 #define	iswhite(arg)	(_wht[arg])	/* T if char is white */
23 #define	begtoken(arg)	(_btk[arg])	/* T if char can start token */
24 #define	intoken(arg)	(_itk[arg])	/* T if char can be in token */
25 #define	endtoken(arg)	(_etk[arg])	/* T if char ends tokens */
26 #define	isgood(arg)	(_gd[arg])	/* T if char can be after ')' */
27 
28 typedef struct nd_st {			/* sorting structure */
29 	struct nd_st	*left,
30 			*right;		/* left and right sons */
31 	char	*entry,			/* function or type name */
32 		*file,			/* file name */
33 		*pat;			/* search pattern */
34 	int	lno;			/* for -x option */
35 	bool	been_warned;		/* set if noticed dup */
36 } NODE;
37 
38 extern FILE	*inf;			/* ioptr for current input file */
39 extern long	lineftell;		/* ftell after getc( inf ) == '\n' */
40 extern int	lineno,			/* line number of current line */
41 		xflag;			/* -x: cxref style output */
42 extern bool	_wht[0177],_etk[0177],_itk[0177],_btk[0177],_gd[0177];
43 extern char	lbuf[BUFSIZ];
44