xref: /original-bsd/usr.bin/ctags/ctags.h (revision 3d751ffd)
1 /*
2  * Copyright (c) 1987 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that the above copyright notice and this paragraph are
7  * duplicated in all such forms and that any documentation,
8  * advertising materials, and other materials related to such
9  * distribution and use acknowledge that the software was developed
10  * by the University of California, Berkeley.  The name of the
11  * University may not be used to endorse or promote products derived
12  * from this software without specific prior written permission.
13  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  *	@(#)ctags.h	5.2 (Berkeley) 12/31/88
18  */
19 
20 #include <stdio.h>
21 #include <ctype.h>
22 
23 #define	bool	char
24 
25 #define	YES		1
26 #define	NO		0
27 #define	EOS		'\0'
28 
29 #define	ENDLINE		50		/* max length of pattern */
30 #define	MAXTOKEN	250		/* max size of single token */
31 
32 #define	SETLINE		{++lineno;lineftell = ftell(inf);}
33 #define	GETC(op,exp)	((c = getc(inf)) op (int)exp)
34 
35 #define	iswhite(arg)	(_wht[arg])	/* T if char is white */
36 #define	begtoken(arg)	(_btk[arg])	/* T if char can start token */
37 #define	intoken(arg)	(_itk[arg])	/* T if char can be in token */
38 #define	endtoken(arg)	(_etk[arg])	/* T if char ends tokens */
39 #define	isgood(arg)	(_gd[arg])	/* T if char can be after ')' */
40 
41 typedef struct nd_st {			/* sorting structure */
42 	struct nd_st	*left,
43 			*right;		/* left and right sons */
44 	char	*entry,			/* function or type name */
45 		*file,			/* file name */
46 		*pat;			/* search pattern */
47 	int	lno;			/* for -x option */
48 	bool	been_warned;		/* set if noticed dup */
49 } NODE;
50 
51 extern FILE	*inf;			/* ioptr for current input file */
52 extern long	lineftell;		/* ftell after getc( inf ) == '\n' */
53 extern int	lineno,			/* line number of current line */
54 		xflag;			/* -x: cxref style output */
55 extern bool	_wht[0177],_etk[0177],_itk[0177],_btk[0177],_gd[0177];
56 extern char	lbuf[BUFSIZ];
57