xref: /original-bsd/usr.bin/ctags/ctags.h (revision 5735763c)
17402ef7fSbostic /*
2*5735763cSpendry  * Copyright (c) 1987, 1993, 1994
392e3de6bSbostic  *	The Regents of the University of California.  All rights reserved.
4810bd126Sbostic  *
508c0cd70Sbostic  * %sccs.include.redist.c%
6810bd126Sbostic  *
7*5735763cSpendry  *	@(#)ctags.h	8.3 (Berkeley) 04/02/94
87402ef7fSbostic  */
97402ef7fSbostic 
107402ef7fSbostic #define	bool	char
117402ef7fSbostic 
127402ef7fSbostic #define	YES		1
137402ef7fSbostic #define	NO		0
147402ef7fSbostic #define	EOS		'\0'
157402ef7fSbostic 
167402ef7fSbostic #define	ENDLINE		50		/* max length of pattern */
177402ef7fSbostic #define	MAXTOKEN	250		/* max size of single token */
187402ef7fSbostic 
197402ef7fSbostic #define	SETLINE		{++lineno;lineftell = ftell(inf);}
207402ef7fSbostic #define	GETC(op,exp)	((c = getc(inf)) op (int)exp)
217402ef7fSbostic 
22356bb532Spendry #define	iswhite(arg)	(_wht[(unsigned)arg])	/* T if char is white */
23356bb532Spendry #define	begtoken(arg)	(_btk[(unsigned)arg])	/* T if char can start token */
24356bb532Spendry #define	intoken(arg)	(_itk[(unsigned)arg])	/* T if char can be in token */
25356bb532Spendry #define	endtoken(arg)	(_etk[(unsigned)arg])	/* T if char ends tokens */
26356bb532Spendry #define	isgood(arg)	(_gd[(unsigned)arg])	/* T if char can be after ')' */
277402ef7fSbostic 
287402ef7fSbostic typedef struct nd_st {			/* sorting structure */
297402ef7fSbostic 	struct nd_st	*left,
307402ef7fSbostic 			*right;		/* left and right sons */
317402ef7fSbostic 	char	*entry,			/* function or type name */
327402ef7fSbostic 		*file,			/* file name */
337402ef7fSbostic 		*pat;			/* search pattern */
347402ef7fSbostic 	int	lno;			/* for -x option */
357402ef7fSbostic 	bool	been_warned;		/* set if noticed dup */
367402ef7fSbostic } NODE;
377402ef7fSbostic 
38356bb532Spendry extern char	*curfile;		/* current input file name */
39356bb532Spendry extern NODE	*head;			/* head of the sorted binary tree */
407402ef7fSbostic extern FILE    *inf;			/* ioptr for current input file */
41356bb532Spendry extern FILE    *outf;			/* ioptr for current output file */
427402ef7fSbostic extern long	lineftell;		/* ftell after getc( inf ) == '\n' */
43356bb532Spendry extern int	lineno;			/* line number of current line */
44356bb532Spendry extern int	dflag;			/* -d: non-macro defines */
45356bb532Spendry extern int	tflag;			/* -t: create tags for typedefs */
46356bb532Spendry extern int	vflag;			/* -v: vgrind style index output */
47356bb532Spendry extern int	wflag;			/* -w: suppress warnings */
48356bb532Spendry extern int	xflag;			/* -x: cxref style output */
49356bb532Spendry extern bool	_wht[], _etk[], _itk[], _btk[], _gd[];
50356bb532Spendry extern char	lbuf[LINE_MAX];
51356bb532Spendry extern char    *lbp;
52356bb532Spendry extern char	searchar;		/* ex search character */
53356bb532Spendry 
54356bb532Spendry extern int	cicmp __P((char *));
55356bb532Spendry extern void	getline __P((void));
56356bb532Spendry extern void	pfnote __P((char *, int));
57356bb532Spendry extern int	skip_key __P((int));
58356bb532Spendry extern void	put_entries __P((NODE *));
59356bb532Spendry extern void	toss_yysec __P((void));
60356bb532Spendry extern void	l_entries __P((void));
61356bb532Spendry extern void	y_entries __P((void));
62356bb532Spendry extern int	PF_funcs __P((void));
63356bb532Spendry extern void	c_entries __P((void));
64356bb532Spendry extern void	skip_comment __P((void));
65