ctags.h revision 56663
1/* $FreeBSD: head/usr.bin/ctags/ctags.h 56663 2000-01-27 05:46:58Z mjacob $ */
2/*
3 * Copyright (c) 1987, 1993, 1994
4 *	The Regents of the University of California.  All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 *    notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 *    notice, this list of conditions and the following disclaimer in the
13 *    documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software
15 *    must display the following acknowledgement:
16 *	This product includes software developed by the University of
17 *	California, Berkeley and its contributors.
18 * 4. Neither the name of the University nor the names of its contributors
19 *    may be used to endorse or promote products derived from this software
20 *    without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 *	@(#)ctags.h	8.3 (Berkeley) 4/2/94
35 */
36
37#define	bool	char
38
39#define	YES		1
40#define	NO		0
41#define	EOS		'\0'
42
43#define	ENDLINE		50		/* max length of pattern */
44#define	MAXTOKEN	250		/* max size of single token */
45
46#define	SETLINE		{++lineno;lineftell = ftell(inf);}
47#define	GETC(op,exp)	((c = getc(inf)) op (int)exp)
48
49#define	_egrd(idx, array)	\
50	(((int)idx < 0)? NO : array [ (int) idx ])
51
52#define	iswhite(arg)	_egrd(arg, _wht)	/* T if char is white */
53#define	begtoken(arg)	_egrd(arg, _btk)	/* T if char can start token */
54#define	intoken(arg)	_egrd(arg, _itk)	/* T if char can be in token */
55#define	endtoken(arg)	_egrd(arg, _etk)	/* T if char ends tokens */
56#define	isgood(arg)	_egrd(arg, _gd)	/* T if char can be after ')' */
57
58typedef struct nd_st {			/* sorting structure */
59	struct nd_st	*left,
60			*right;		/* left and right sons */
61	char	*entry,			/* function or type name */
62		*file,			/* file name */
63		*pat;			/* search pattern */
64	int	lno;			/* for -x option */
65	bool	been_warned;		/* set if noticed dup */
66} NODE;
67
68extern char	*curfile;		/* current input file name */
69extern NODE	*head;			/* head of the sorted binary tree */
70extern FILE    *inf;			/* ioptr for current input file */
71extern FILE    *outf;			/* ioptr for current output file */
72extern long	lineftell;		/* ftell after getc( inf ) == '\n' */
73extern int	lineno;			/* line number of current line */
74extern int	dflag;			/* -d: non-macro defines */
75extern int	tflag;			/* -t: create tags for typedefs */
76extern int	vflag;			/* -v: vgrind style index output */
77extern int	wflag;			/* -w: suppress warnings */
78extern int	xflag;			/* -x: cxref style output */
79extern bool	_wht[], _etk[], _itk[], _btk[], _gd[];
80extern char	lbuf[LINE_MAX];
81extern char    *lbp;
82extern char	searchar;		/* ex search character */
83
84extern int	cicmp __P((char *));
85extern void	getline __P((void));
86extern void	pfnote __P((char *, int));
87extern int	skip_key __P((int));
88extern void	put_entries __P((NODE *));
89extern void	toss_yysec __P((void));
90extern void	l_entries __P((void));
91extern void	y_entries __P((void));
92extern int	PF_funcs __P((void));
93extern void	c_entries __P((void));
94extern void	skip_comment __P((void));
95