xref: /freebsd-12.1/gnu/usr.bin/grep/grep.h (revision 7d0fc2f4)
1 /* grep.h - interface to grep driver for searching subroutines.
2    Copyright (C) 1992, 1998, 2001 Free Software Foundation, Inc.
3 
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 2, or (at your option)
7    any later version.
8 
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13 
14    You should have received a copy of the GNU General Public License
15    along with this program; if not, write to the Free Software
16    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17    02111-1307, USA.  */
18 
19 /* $FreeBSD$ */
20 
21 #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6) || __STRICT_ANSI__
22 # define __attribute__(x)
23 #endif
24 
25 #include "mbcache.h"
26 
27 /* Grep.c expects the matchers vector to be terminated
28    by an entry with a NULL compile, and to contain at least
29    an entry named "default". */
30 
31 extern struct matcher
32 {
33   char name[8];
34   void (*compile) PARAMS ((char const *, size_t));
35   size_t (*execute) PARAMS ((char const *, size_t, struct mb_cache *,
36 			     size_t *, int));
37 } const matchers[];
38 
39 /* Exported from fgrepmat.c, egrepmat.c, grepmat.c.  */
40 extern char const *matcher;
41 
42 /* The following flags are exported from grep for the matchers
43    to look at. */
44 extern int match_icase;		/* -i */
45 extern int match_words;		/* -w */
46 extern int match_lines;		/* -x */
47 extern unsigned char eolbyte;	/* -z */
48