xref: /dragonfly/contrib/grep/src/grep.h (revision 8edfbc5e)
1 /* grep.h - interface to grep driver for searching subroutines.
2    Copyright (C) 1992, 1998, 2001, 2007, 2009-2015 Free Software Foundation,
3    Inc.
4 
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 3, or (at your option)
8    any later version.
9 
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14 
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software
17    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
18    02110-1301, USA.  */
19 
20 #ifndef GREP_GREP_H
21 #define GREP_GREP_H 1
22 
23 #include <stdbool.h>
24 
25 /* The following flags are exported from grep for the matchers
26    to look at. */
27 extern bool match_icase;	/* -i */
28 extern bool match_words;	/* -w */
29 extern bool match_lines;	/* -x */
30 extern char eolbyte;		/* -z */
31 
32 /* An enum textbin describes the file's type, inferred from data read
33    before the first line is selected for output.  */
34 enum textbin
35   {
36     /* Binary, as it contains null bytes and the -z option is not in effect,
37        or it contains encoding errors.  */
38     TEXTBIN_BINARY = -1,
39 
40     /* Not known yet.  Only text has been seen so far.  */
41     TEXTBIN_UNKNOWN = 0,
42 
43     /* Text.  */
44     TEXTBIN_TEXT = 1
45   };
46 
47 /* Input file type.  */
48 extern enum textbin input_textbin;
49 
50 #endif
51