xref: /dragonfly/contrib/grep/src/system.h (revision 783d47c4)
1 /* Portability cruft.  Include after config.h and sys/types.h.
2    Copyright 1996, 1998-2000, 2007, 2009-2011 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 3, 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., 51 Franklin Street - Fifth Floor, Boston, MA
17    02110-1301, USA.  */
18 
19 #ifndef GREP_SYSTEM_H
20 #define GREP_SYSTEM_H 1
21 
22 #include <fcntl.h>
23 #include <unistd.h>
24 #include <errno.h>
25 
26 #include "binary-io.h"
27 #include "configmake.h"
28 #include "dirname.h"
29 #include "minmax.h"
30 
31 #if O_BINARY
32 # define HAVE_DOS_FILE_CONTENTS 1
33 #endif
34 
35 #ifdef EISDIR
36 # define is_EISDIR(e, f) ((e) == EISDIR)
37 #else
38 # define is_EISDIR(e, f) 0
39 #endif
40 
41 #include <stdlib.h>
42 #include <stddef.h>
43 #include <limits.h>
44 #include <string.h>
45 #include <ctype.h>
46 
47 enum { EXIT_TROUBLE = 2 };
48 
49 #include <gettext.h>
50 #define N_(String) gettext_noop(String)
51 #define _(String) gettext(String)
52 
53 #include <locale.h>
54 
55 #ifndef initialize_main
56 #define initialize_main(argcp, argvp)
57 #endif
58 
59 #include "unlocked-io.h"
60 #endif
61