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